← Backend PythonQuestion 32 of 49
If PostgreSQL chooses a bad query plan because statistics are stale, what command should you run?
📘 Explanation
ANALYZE (or VACUUM ANALYZE) refreshes the planner statistics that PostgreSQL uses to choose good query plans. REINDEX, CLUSTER, and EXPLAIN ANALYZE serve different purposes and don't refresh these statistics in the way needed here.
Related questions
- What is a composite index and when would you use one instead of single-column indexes?
- What are partial indexes and functional indexes, and what problems do they solve?
- What is the difference between ANALYZE and VACUUM ANALYZE in PostgreSQL?
- Why might a query using LOWER(email) not use an index on email?
- What is the difference between EXPLAIN and EXPLAIN ANALYZE in PostgreSQL?
← PreviousNo login needed