What does `JSONB` offer over `JSON` in PostgreSQL?

Advanced SQL Developer Medium

Advanced SQL Developer — Medium

What does `JSONB` offer over `JSON` in PostgreSQL?

Key points

  • JSONB stores data in a decomposed binary format for efficient indexing
  • JSON allows for preserving whitespace and key order but lacks indexing capabilities
  • JSONB enables fast key lookups and operators like @>
  • JSON cannot be indexed efficiently due to storing data as raw text

Ready to go further?

Related questions