changeset 2479:ab3f4aad1b37

Interpreting results of ``EXPLAIN``.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Sun, 20 Dec 2020 20:11:29 +0200
parents 2bf9b2739ecb
children 0766b2899607
files postgres.rst
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/postgres.rst	Sun Dec 20 13:00:45 2020 +0200
+++ b/postgres.rst	Sun Dec 20 20:11:29 2020 +0200
@@ -251,8 +251,17 @@
   EXPLAIN (TIMING false, COSTS false, ANALYSE) SELECT 1;
   EXPLAIN (TIMING false, COSTS false, BUFFERS false, VERBOSE false, ANALYSE) SELECT 1;
 
+``EXPLAIN ANALYSE`` actually executes a query, if it is destructive enclose the query into a
+transaction::
+
+  BEGIN;
+  EXPLAIN ANALYZE ...;
+  ROLLBACK;
+
 https://www.postgresql.org/docs/11/sql-explain.html
-  ``EXPLAIN``.
+  Syntax of ``EXPLAIN``.
+https://www.postgresql.org/docs/11/using-explain.html
+  Interpreting results of ``EXPLAIN``.
 
 List databases, schemas and tables
 ==================================