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 (@>, ?, ?|, ?&
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
What is the difference between JSON and JSONB in PostgreSQL?