← Backend PythonQuestion 43 of 49
Why might PostgreSQL choose a sequential scan instead of using an index?
📘 Explanation
PostgreSQL may prefer a sequential scan when the table is small, when the condition matches a large share of rows (low selectivity), or when statistics are outdated and mislead the planner. The other options list unrelated or incorrect conditions like write load, missing primary keys, or index fragmentation that aren't the real reasons behind this choice.
Related questions
- Why can having too many indexes slow down a database even though indexes improve query performance?
- What is the difference between EXPLAIN and EXPLAIN ANALYZE in PostgreSQL?
- Why might a query using LOWER(email) not use an index on email?
- What is the difference between ANALYZE and VACUUM ANALYZE in PostgreSQL?
- What is the left-prefix rule for composite indexes?
← PreviousNo login needed