Verify your knowledge
- How can you inspect the plan of a query?
The special command
EXPLAIN
allows you to inspect how PostgreSQL is going to execute a given query, showing a “node” for each execution step. See the The EXPLAIN statement section for more details.
- What is the difference between
EXPLAIN
andEXPLAIN
EXPLAIN’?The
EXPLAIN
command will not execute the query, computing only the access plan; on the other hand, theEXPLAIN ANALYZE
command will execute the query and print the query plan in the output. See the EXPLAIN ANALYZE section for more details.
- How does PostgreSQL keep the statistics up to date?
The statistics are updated every time a manual
ANALYZE
command is executed or the auto-vacuum (auto-analyze) daemon runs against a table. See the ANALYZE and how to update statistics section for more details.
- How does PostgreSQL choose to use a specific access method (e.g., an index...