mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +03:00
Change EXPLAIN output so that subplans and initplans (particularly CTEs)
are individually labeled, rather than just grouped under an "InitPlan" or "SubPlan" heading. This in turn makes it possible for decompilation of a subplan reference to usefully identify which subplan it's referencing. I also made InitPlans identify which parameter symbol(s) they compute, so that references to those parameters elsewhere in the plan tree can be connected to the initplan that will be executed. Per a gripe from Robert Haas about EXPLAIN output of a WITH query being inadequate, plus some longstanding pet peeves of my own.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.147 2009/03/10 22:09:26 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.148 2009/04/05 19:59:40 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -502,6 +502,8 @@ typedef struct SubPlan
|
||||
List *paramIds; /* IDs of Params embedded in the above */
|
||||
/* Identification of the Plan tree to use: */
|
||||
int plan_id; /* Index (from 1) in PlannedStmt.subplans */
|
||||
/* Identification of the SubPlan for EXPLAIN and debugging purposes: */
|
||||
char *plan_name; /* A name assigned during planning */
|
||||
/* Extra data useful for determining subplan's output type: */
|
||||
Oid firstColType; /* Type of first column of subplan result */
|
||||
int32 firstColTypmod; /* Typmod of first column of subplan result */
|
||||
|
||||
Reference in New Issue
Block a user