Bird
0
0

Which operator benefits most from a GIN index on a JSONB column?

easy📝 Conceptual Q2 of 15
PostgreSQL - JSON and JSONB
Which operator benefits most from a GIN index on a JSONB column?
AThe equality operator =
BThe subtraction operator -
CThe concatenation operator ||
DThe containment operator @>
Step-by-Step Solution
Solution:
  1. Step 1: Identify operator usage with GIN

    The containment operator @> is commonly used to check if one JSONB contains another, and GIN indexes optimize this.
  2. Step 2: Eliminate other operators

    Equality, concatenation, and subtraction operators do not benefit as much from GIN indexes on JSONB.
  3. Final Answer:

    The containment operator @> -> Option D
  4. Quick Check:

    Operator optimized by GIN = @> [OK]
Quick Trick: Use @> operator with GIN indexes for fast JSONB containment queries [OK]
Common Mistakes:
  • Choosing equality operator = for GIN optimization
  • Confusing concatenation || with index usage
  • Assuming subtraction - uses GIN index

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes