-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode JSONBOID as binary bytes, like TextOID and JSONOID #115
base: master
Are you sure you want to change the base?
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.