beginnerPostgreSQL Specifics — MVCC, JSONB & VACUUM
What is the difference between JSON and JSONB in PostgreSQL?
JSON: stored as plain text, preserved exactly as-is (including whitespace and duplicate keys). Validation only on input. Slower reads (must reparse text on every access). No GIN index support. JSONB: stored as a decomposed binary format. Keys are sorted; duplicate keys removed (last one wins). Faster for reads (no reparsing). Supports GIN index for fast key/value containment queries (@>, ?, ?|, ?&
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response