ANALYZE
A command that gathers statistics about the values in tables, which the query planner uses to estimate row counts.
In more detail
PostgreSQL runs it automatically in the background and SQLite runs it when asked. As an option, EXPLAIN ANALYZE instead runs the query for real and reports actual rows and timings next to the estimates.
Related terms
- row estimate — The planner's guess at how many rows a step of a query will produce, used to choose the plan.
- query planner — The part of the database that turns a SQL query into a plan, choosing among indexes, scans and join orders.
- EXPLAIN — A command placed before a query that shows the plan the database would use instead of running it normally.
Taught in
- Reading An EXPLAIN Plan — PostgreSQL, Indexing & Relational Data Modeling