Bird
0
0

You created a GiST index on a text column for full-text search but your queries are still slow. Which of the following is a likely cause?

medium📝 Debug Q14 of 15
PostgreSQL - Indexing Strategies
You created a GiST index on a text column for full-text search but your queries are still slow. Which of the following is a likely cause?
AYou created the index on the wrong table
BGiST indexes do not support text search
CYou forgot to use the <code>@@</code> operator in your WHERE clause
DYou need to vacuum the table before using the index
Step-by-Step Solution
Solution:
  1. Step 1: Understand GiST index usage for full-text search

    GiST indexes support full-text search but queries must use the @@ operator to use the index.
  2. Step 2: Analyze options

    The most likely cause is forgetting the @@ operator, which prevents index usage. GiST indexes do not support text search is false--GiST supports text search. Options A and D are possible but less directly related to index usage.
  3. Final Answer:

    You forgot to use the @@ operator in your WHERE clause -> Option C
  4. Quick Check:

    Full-text search needs @@ operator to use GiST index [OK]
Quick Trick: Use @@ operator in WHERE to leverage GiST full-text index [OK]
Common Mistakes:
  • Assuming GiST doesn't support text search
  • Not using @@ operator in queries
  • Ignoring index table or vacuum issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes