Bird
0
0

A developer created an index but the database shows it is not being used. What is a common mistake causing this?

medium📝 Debug Q7 of 15
SQL - Indexes and Query Performance
A developer created an index but the database shows it is not being used. What is a common mistake causing this?
AThe index name is too long and ignored by the database.
BThe index was created on a different table than queried.
CThe database automatically disables all indexes after creation.
DThe query uses functions on the indexed column, preventing index use.
Step-by-Step Solution
Solution:
  1. Step 1: Understand index usage restrictions

    Using functions on indexed columns can prevent the database from using the index.
  2. Step 2: Analyze options

    The query uses functions on the indexed column, preventing index use. correctly identifies a common cause; others are false or unlikely.
  3. Final Answer:

    The query uses functions on the indexed column, preventing index use. -> Option D
  4. Quick Check:

    Functions on indexed columns block index use [OK]
Quick Trick: Avoid functions on indexed columns to use indexes [OK]
Common Mistakes:
  • Assuming indexes disable automatically
  • Ignoring table mismatch
  • Believing index name length matters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes