Decode JSONBOID as binary bytes, like TextOID and JSONOID#115
Decode JSONBOID as binary bytes, like TextOID and JSONOID#115sean- wants to merge 1 commit intojackc:masterfrom
Conversation
|
I'm assuming this PR is correct (this PR was dry-coded). Registering the following data type worked around the performance problem I was experiencing (reading data from one database and writing it to another). Before: |
|
I don't think this will work in the general case as is. The binary format of Beyond that, some care needs to be taken when choosing whether binary or text format is preferred. I've found that the text format is significantly faster in some cases. Not sure whether that is the case with Oh, one other thing. If your underlying use case is copying data from one database to another at high speed then you should check out the copy protocol support in pgconn. You can use |
Oh! Interesting, I didn't notice that... but that's probably because I was splatting things into a different
This is actually querying data from CockroachDB, not PostgreSQL. In this case, the team will be querying the data as JSON. I suppose it's possible to cast https://www.postgresql.org/docs/current/datatype-json.html
With the |
It does seem that way. This is a Postgres SQL shell: |
This results in a >10x improvement in throughput when working with the JSONB data type.