Bird
0
0

Why might the EXPLAIN plan show different results for the same query run at different times?

hard📝 Conceptual Q10 of 15
SQL - Indexes and Query Performance
Why might the EXPLAIN plan show different results for the same query run at different times?
ABecause the database statistics or data distribution changed
BBecause EXPLAIN randomly changes its output
CBecause the query syntax was altered
DBecause EXPLAIN caches the first result always
Step-by-Step Solution
Solution:
  1. Step 1: Understand factors affecting EXPLAIN output

    Database statistics and data distribution affect query plans.
  2. Step 2: Recognize why plans change over time

    Updates to data or stats cause the optimizer to choose different plans.
  3. Final Answer:

    Because the database statistics or data distribution changed -> Option A
  4. Quick Check:

    EXPLAIN varies with data stats changes [OK]
Quick Trick: EXPLAIN changes if data or stats change [OK]
Common Mistakes:
  • Thinking EXPLAIN output is random
  • Assuming query syntax changed without evidence
  • Believing EXPLAIN caches plans permanently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes