Skip to content
RED SAGSkills
medium10 pts · first answer countsquery-tuningpostgresql

Reading an EXPLAIN ANALYZE plan

This PostgreSQL plan is from a query on a 50 million row table. What is the most likely fix?

Seq Scan on orders  (cost=0.00..1250000.00 rows=12 width=96)
                    (actual time=0.03..8421.55 rows=9 loops=1)
  Filter: (customer_id = 42)
  Rows Removed by Filter: 49999991
Planning Time: 0.2 ms
Execution Time: 8421.70 ms
Choose one answer