Bird
0
0

Why might a partial index with a complex WHERE clause sometimes be less efficient than a full index?

hard📝 Conceptual Q10 of 15
PostgreSQL - Indexing Strategies
Why might a partial index with a complex WHERE clause sometimes be less efficient than a full index?
ABecause PostgreSQL does not support partial indexes on large tables.
BBecause partial indexes always take more disk space than full indexes.
CBecause partial indexes require more CPU to maintain during inserts.
DBecause the query planner may not use it if the query's filters do not exactly match the partial index condition.
Step-by-Step Solution
Solution:
  1. Step 1: Understand partial index limitations

    Partial indexes are only used if the query's WHERE clause matches the index condition exactly.
  2. Step 2: Compare efficiency

    If queries vary, the planner may skip the partial index, making a full index more reliable.
  3. Final Answer:

    Because the query planner may not use it if the query's filters do not exactly match the partial index condition. -> Option D
  4. Quick Check:

    Partial index usage depends on query match = D [OK]
Quick Trick: Partial index efficiency depends on query condition match [OK]
Common Mistakes:
  • Thinking partial indexes always use more space
  • Assuming higher CPU cost for partial indexes
  • Believing PostgreSQL limits partial indexes by table size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes