diff options
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index ef3d9beb062..048d12f97a2 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994-5, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.190 2009/08/22 02:06:32 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.191 2009/10/10 01:43:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -581,6 +581,7 @@ ExplainNode(Plan *plan, PlanState *planstate, const char *pname; /* node type name for text output */ const char *sname; /* node type name for non-text output */ const char *strategy = NULL; + const char *operation = NULL; int save_indent = es->indent; bool haschildren; @@ -591,6 +592,24 @@ ExplainNode(Plan *plan, PlanState *planstate, case T_Result: pname = sname = "Result"; break; + case T_ModifyTable: + sname = "ModifyTable"; + switch (((ModifyTable *) plan)->operation) + { + case CMD_INSERT: + pname = operation = "Insert"; + break; + case CMD_UPDATE: + pname = operation = "Update"; + break; + case CMD_DELETE: + pname = operation = "Delete"; + break; + default: + pname = "???"; + break; + } + break; case T_Append: pname = sname = "Append"; break; @@ -736,6 +755,8 @@ ExplainNode(Plan *plan, PlanState *planstate, ExplainPropertyText("Node Type", sname, es); if (strategy) ExplainPropertyText("Strategy", strategy, es); + if (operation) + ExplainPropertyText("Operation", operation, es); if (relationship) ExplainPropertyText("Parent Relationship", relationship, es); if (plan_name) @@ -1023,6 +1044,7 @@ ExplainNode(Plan *plan, PlanState *planstate, haschildren = plan->initPlan || outerPlan(plan) || innerPlan(plan) || + IsA(plan, ModifyTable) || IsA(plan, Append) || IsA(plan, BitmapAnd) || IsA(plan, BitmapOr) || @@ -1059,6 +1081,11 @@ ExplainNode(Plan *plan, PlanState *planstate, /* special child plans */ switch (nodeTag(plan)) { + case T_ModifyTable: + ExplainMemberNodes(((ModifyTable *) plan)->plans, + ((ModifyTableState *) planstate)->mt_plans, + outer_plan, es); + break; case T_Append: ExplainMemberNodes(((Append *) plan)->appendplans, ((AppendState *) planstate)->appendplans, @@ -1408,7 +1435,8 @@ ExplainScanTarget(Scan *plan, ExplainState *es) } /* - * Explain the constituent plans of an Append, BitmapAnd, or BitmapOr node. + * Explain the constituent plans of a ModifyTable, Append, BitmapAnd, + * or BitmapOr node. * * Ordinarily we don't pass down outer_plan to our child nodes, but in these * cases we must, since the node could be an "inner indexscan" in which case |