Minor fixes for the EXPLAIN reference page. Mention the fact that
authorNeil Conway
Thu, 12 Apr 2007 22:39:21 +0000 (22:39 +0000)
committerNeil Conway
Thu, 12 Apr 2007 22:39:21 +0000 (22:39 +0000)
EXPLAIN ANALYZE can sometimes be significantly slower than running
the same query normally, and make some minor markup improvements.

doc/src/sgml/ref/explain.sgml

index 70e2be68ac5da4d5f041db9e2530866ef97c7ae1..1a216f7c90abe064bbf718f1e4d771a37c9b6a0d 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -72,7 +72,7 @@ EXPLAIN [ ANALYZE ] [ VERBOSE ] statement
   
    
     Keep in mind that the statement is actually executed when
-    ANALYZE is used.  Although
+    the ANALYZE option is used.  Although
     EXPLAIN will discard any output that a
     SELECT would return, other side effects of the
     statement will happen as usual.  If you wish to use
@@ -141,23 +141,33 @@ ROLLBACK;
   
    In order to allow the PostgreSQL query
    planner to make reasonably informed decisions when optimizing
-   queries, the ANALYZE statement should be run to
-   record statistics about the distribution of data within the
-   table. If you have not done this (or if the statistical
-   distribution of the data in the table has changed significantly
-   since the last time ANALYZE was run), the
-   estimated costs are unlikely to conform to the real properties of
-   the query, and consequently an inferior query plan might be chosen.
+   queries, the 
+   statement should be run to record statistics about the distribution
+   of data within the table. If you have not done this (or if the
+   statistical distribution of the data in the table has changed
+   significantly since the last time ANALYZE was
+   run), the estimated costs are unlikely to conform to the real
+   properties of the query, and consequently an inferior query plan
+   might be chosen.
   
 
   
-   Genetic query optimization (GEQO) randomly 
-   tests execution plans.  Therefore, when the number of tables exceeds
-   geqo_threshold causing genetic query optimization to be 
-   used, the execution plan is likely to change each time the statement
-   is executed.
+   Genetic query optimization (GEQO) randomly tests
+   execution plans.  Therefore, when the number of join relations
+   exceeds  causing genetic query
+   optimization to be used, the execution plan is likely to change
+   each time the statement is executed.
   
 
+  
+   In order to measure the runtime cost of each node in the execution
+   plan, the current implementation of EXPLAIN
+   ANALYZE can add considerable profiling overhead to query
+   execution. As a result, running EXPLAIN ANALYZE
+   on a query can sometimes take significantly longer than executing
+   the query normally. The amount of overhead depends on the nature of
+   the query.
+  
  
 
  
@@ -194,8 +204,8 @@ EXPLAIN SELECT * FROM foo WHERE i = 4;
   
 
   
-   And here is an example of a query plan for a query
-   using an aggregate function:
+   Here is an example of a query plan for a query using an aggregate
+   function:
 
 
 EXPLAIN SELECT sum(i) FROM foo WHERE i < 10;