Bird
0
0

Why does PostgreSQL offer both JSON and JSONB data types, and when is JSONB preferred?

hard📝 Conceptual Q10 of 15
PostgreSQL - JSON and JSONB
Why does PostgreSQL offer both JSON and JSONB data types, and when is JSONB preferred?
AJSON stores data in binary; JSONB stores plain text for readability.
BJSONB stores data in binary format for faster querying and indexing; preferred for frequent reads.
CJSONB is deprecated; JSON is the modern standard.
DJSONB disables indexing; JSON enables indexing.
Step-by-Step Solution
Solution:
  1. Step 1: Understand JSON vs JSONB

    JSON stores exact text; JSONB stores binary parsed data for efficiency.
  2. Step 2: Identify use case for JSONB

    JSONB supports indexing and faster queries, preferred for frequent access.
  3. Final Answer:

    JSONB stores data in binary format for faster querying and indexing; preferred for frequent reads. -> Option B
  4. Quick Check:

    JSONB = binary, faster, indexable [OK]
Quick Trick: Use JSONB for faster queries and indexing [OK]
Common Mistakes:
  • Confusing JSON and JSONB storage formats
  • Thinking JSONB is deprecated
  • Assuming JSONB disables indexing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes