Bird
0
0

What does the following EXPLAIN ANALYZE output line indicate?

medium📝 query result Q5 of 15
PostgreSQL - Set Operations and Advanced Queries
What does the following EXPLAIN ANALYZE output line indicate?
Seq Scan on customers  (cost=0.00..100.00 rows=1000 width=50) (actual time=0.01..5.00 rows=1000 loops=1)
AThe query used a sequential scan and processed 1000 rows in about 5 ms
BThe query used an index scan and processed 1000 rows in 0.01 ms
CThe query failed due to cost exceeding 100
DThe query did not run because loops=1 is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Interpret the plan node

    Seq Scan means sequential scan on the customers table.
  2. Step 2: Understand actual time and rows

    Actual time shows start and end times (0.01 to 5.00 ms) and rows processed (1000).
  3. Final Answer:

    The query used a sequential scan and processed 1000 rows in about 5 ms -> Option A
  4. Quick Check:

    Seq Scan with actual time and rows = The query used a sequential scan and processed 1000 rows in about 5 ms [OK]
Quick Trick: Seq Scan means full table scan with actual timing [OK]
Common Mistakes:
  • Confusing Seq Scan with Index Scan
  • Misreading actual time as cost
  • Thinking loops=1 is an error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes