*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.16 1997/12/29 05:13:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.17 1998/02/13 03:21:30 vadim Exp $
*
*-------------------------------------------------------------------------
*/
break;
}
+#if 0
for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
+#endif
appendStringInfo(str, pname);
switch (nodeTag(plan))
appendStringInfo(str, buf);
}
appendStringInfo(str, "\n");
+
+ /* initPlan-s */
+ if (plan->initPlan)
+ {
+ List *saved_rtable = es->rtable;
+ List *lst;
+
+ for (i = 0; i < indent; i++)
+ appendStringInfo(str, " ");
+ appendStringInfo(str, " InitPlan\n");
+ foreach (lst, plan->initPlan)
+ {
+ es->rtable = ((SubPlan*) lfirst(lst))->rtable;
+ for (i = 0; i < indent; i++)
+ appendStringInfo(str, " ");
+ appendStringInfo(str, " -> ");
+ explain_outNode(str, ((SubPlan*) lfirst(lst))->plan, indent + 4, es);
+ }
+ es->rtable = saved_rtable;
+ }
/* lefttree */
if (outerPlan(plan))
{
for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
- appendStringInfo(str, " -> ");
- explain_outNode(str, outerPlan(plan), indent + 1, es);
+ appendStringInfo(str, " -> ");
+ explain_outNode(str, outerPlan(plan), indent + 3, es);
}
/* righttree */
{
for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
- appendStringInfo(str, " -> ");
- explain_outNode(str, innerPlan(plan), indent + 1, es);
+ appendStringInfo(str, " -> ");
+ explain_outNode(str, innerPlan(plan), indent + 3, es);
+ }
+
+ /* subPlan-s */
+ if (plan->subPlan)
+ {
+ List *saved_rtable = es->rtable;
+ List *lst;
+
+ for (i = 0; i < indent; i++)
+ appendStringInfo(str, " ");
+ appendStringInfo(str, " SubPlan\n");
+ foreach (lst, plan->subPlan)
+ {
+ es->rtable = ((SubPlan*) lfirst(lst))->rtable;
+ for (i = 0; i < indent; i++)
+ appendStringInfo(str, " ");
+ appendStringInfo(str, " -> ");
+ explain_outNode(str, ((SubPlan*) lfirst(lst))->plan, indent + 4, es);
+ }
+ es->rtable = saved_rtable;
}
return;
}