Bird
0
0

You created a GIN index on to_tsvector('english', content) but queries using to_tsvector('simple', content) are slow. Why?

medium📝 Debug Q6 of 15
PostgreSQL - Full-Text Search
You created a GIN index on to_tsvector('english', content) but queries using to_tsvector('simple', content) are slow. Why?
AThe index type should be BTREE
BIndex was built with 'english' config, not 'simple'
CThe content column is empty
DGIN indexes do not support to_tsvector
Step-by-Step Solution
Solution:
  1. Step 1: Check index configuration

    The index uses 'english' config, so it matches only queries with 'english'.
  2. Step 2: Understand config mismatch effect

    Queries with 'simple' config don't use the index, causing slow scans.
  3. Final Answer:

    Index was built with 'english' config, not 'simple' -> Option B
  4. Quick Check:

    Config mismatch causes no index use [OK]
Quick Trick: Index and query configs must match for GIN use [OK]
Common Mistakes:
  • Thinking GIN doesn't support to_tsvector
  • Assuming empty content causes slow queries
  • Using wrong index type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes