3 ms·
Postgres was actually somewhat crippled in these tests since they used json rather than jsonb for storage, which stores the json in a binary format which doesn'
by JamesMcMinn 11y ago
Postgres was actually somewhat crippled in these tests since they used json rather than jsonb for storage, which stores the json in a binary format which doesn't need to be serialised on reads.
- lobster_johnson 11y agoThat's not quite correct. The jsonb requires that reads deserialize jsonb into textual JSON, whereas the json type can be sent directly to the client with no processing. jsonb is superior when: 1. You want to use any of the built-in JSON functions, e.g. for extracting fields from the document. 2. You want to index the JSON (either the entire thing via GIN, or individual fields via ordinary B-tree indexes). 3. You want to save space; jsonb strips whitespace. jsonb incurs an overhead on both reads and writes since it must serialize to/from textual JSON.