3 ms·
That'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 pr
by lobster_johnson 11y ago
That'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.