Bird
0
0

Which of the following is the correct way to get a detailed query plan with actual run times in PostgreSQL?

easy📝 Syntax Q3 of 15
PostgreSQL - Performance Tuning
Which of the following is the correct way to get a detailed query plan with actual run times in PostgreSQL?
AEXPLAIN SELECT * FROM employees;
BEXPLAIN ANALYZE SELECT * FROM employees;
CANALYZE EXPLAIN SELECT * FROM employees;
DEXPLAIN RUN SELECT * FROM employees;
Step-by-Step Solution
Solution:
  1. Step 1: Recall syntax for detailed EXPLAIN

    EXPLAIN ANALYZE runs the query and shows actual times.
  2. Step 2: Check other options for correctness

    EXPLAIN alone shows plan only; ANALYZE EXPLAIN and EXPLAIN RUN are invalid.
  3. Final Answer:

    EXPLAIN ANALYZE SELECT * FROM employees; -> Option B
  4. Quick Check:

    EXPLAIN ANALYZE = Detailed plan with timings [OK]
Quick Trick: Use EXPLAIN ANALYZE for real execution times [OK]
Common Mistakes:
  • Using EXPLAIN without ANALYZE for timings
  • Swapping ANALYZE and EXPLAIN keywords
  • Using non-existent EXPLAIN RUN command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes