Questions: Query Execution Plans and EXPLAIN Analysis

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

EXPLAIN ANALYZE shows the optimizer estimated 10 rows for a table scan, but the actual count was 85,000. What is the most likely root cause and fix?

AThe query is missing an index; add one on the filtered column
BThe table statistics are stale; run ANALYZE to refresh them
CThe work_mem setting is too low; increase it to avoid disk spills
DThe join algorithm chosen is incorrect for this query size
Question 2 Multiple Choice

A developer wants to inspect whether a query will use an index without actually executing the query. Which command should they use?

AEXPLAIN ANALYZE — it shows the actual execution plan with real timing
BEXPLAIN — it shows the optimizer's plan without executing the query
CEXPLAIN VERBOSE — it shows extra detail including actual row counts
DEXPLAIN BUFFERS — it shows cache hit statistics for the query
Question 3 True / False

A Seq Scan in EXPLAIN output usually indicates a missing index and should be replaced with an Index Scan.

TTrue
FFalse
Question 4 True / False

EXPLAIN ANALYZE can safely be used to diagnose slow INSERT or DELETE statements without any side effects.

TTrue
FFalse
Question 5 Short Answer

In EXPLAIN output, what does a large discrepancy between estimated rows and actual rows tell you, and why does it matter for query performance?

Think about your answer, then reveal below.