Verify your knowledge
- How can you inspect the plan of a query?
The special command
EXPLAINallows 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
EXPLAINandEXPLAINEXPLAIN’?The
EXPLAINcommand will not execute the query, computing only the access plan; on the other hand, theEXPLAIN ANALYZEcommand 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
ANALYZEcommand 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...