Bird
0
0

You created a B-tree index on column email but notice queries filtering by LOWER(email) are slow. What is the likely problem?

medium📝 Debug Q14 of 15
PostgreSQL - Indexing Strategies
You created a B-tree index on column email but notice queries filtering by LOWER(email) are slow. What is the likely problem?
AB-tree indexes only work on numeric columns
BThe index was created on the wrong table
CB-tree indexes do not support functions like LOWER() by default
DThe database needs to be restarted to use the index
Step-by-Step Solution
Solution:
  1. Step 1: Understand function usage in WHERE clause

    Using LOWER(email) means the query filters on a transformed value, not the raw column.
  2. Step 2: Recognize index limitations

    Regular B-tree indexes do not support functions unless a functional index is created.
  3. Final Answer:

    B-tree indexes do not support functions like LOWER() by default -> Option C
  4. Quick Check:

    Function in filter needs functional index [OK]
Quick Trick: Use functional indexes for queries with functions like LOWER() [OK]
Common Mistakes:
  • Thinking B-tree only works on numbers
  • Assuming index applies automatically after restart
  • Mistaking wrong table for index issue

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes