Databases · Middle · Question 7 of 75
Why might PostgreSQL choose a sequential scan even though an index exists?
- ✓Correct answer: If the query returns a large share of the table, reading it sequentially is cheaper than many random index lookups
- 2PostgreSQL ignores indexes on tables with more than 1 million rows
- 3Indexes are used only after a restart
Explanation
The planner estimates costs from statistics. For low-selectivity conditions (e.g. status = 'active' matching 90% of rows) a seq scan is the right choice.