EXPLAIN VERBOSE prints the plan, and now pretty-prints the plan to
authorBruce Momjian
Tue, 4 Aug 1998 15:00:28 +0000 (15:00 +0000)
committerBruce Momjian
Tue, 4 Aug 1998 15:00:28 +0000 (15:00 +0000)
the postmaster log file.

src/backend/commands/explain.c
src/man/explain.l

index d97e05c71c504b36adeb3acf85f1fe39a67335e8..2fb312cade1e0d145ab15016cf6327d9f7fc96a1 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.21 1998/08/04 04:50:15 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.22 1998/08/04 15:00:26 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -30,7 +30,7 @@ typedef struct ExplainState
 {
    /* options */
    bool        printCost;      /* print cost */
-   bool        printNodes;     /* do pprint() instead */
+   bool        printNodes;     /* do nodeToString() instead */
    /* other states */
    List       *rtable;         /* range table */
 } ExplainState;
@@ -81,8 +81,11 @@ ExplainQuery(Query *query, bool verbose, CommandDest dest)
    es->rtable = query->rtable;
 
    if (es->printNodes)
-       s = pprint(plan);
-
+   {
+       pprint(plan); /* display in postmaster log file */
+       s = nodeToString(plan);
+   }
+   
    if (es->printCost)
    {
        s2 = Explain_PlanToString(plan, es);
index a50912eed10c8dd034af9de48cf4845643fe8ed6..9bc0925bf2d78034e52204a7434f7a56a4fda366 100644 (file)
@@ -1,6 +1,6 @@
 .\" This is -*-nroff-*-
 .\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.9 1998/02/10 04:02:59 momjian Exp $
+.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.10 1998/08/04 15:00:28 momjian Exp $
 .TH EXPLAIN SQL 06/12/97 PostgreSQL PostgreSQL
 .SH NAME
 explain - explains statement execution details
@@ -11,7 +11,8 @@ explain - explains statement execution details
 .SH DESCRIPTION
 This command outputs details about the supplied query.  The default
 output is the computed query cost.  \f2verbose\f1 displays the full query
-plan and cost.
+plan and cost to your screen, and pretty-prints the plan to the postmaster
+log file.
 
 .SH EXAMPLES
 In the examples, the table has a single column of float4.