1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Fix explain for union and inheritance. Rename Append structure

members to be clearer.  Fix cost computation for these.
This commit is contained in:
Bruce Momjian
1998-07-15 14:54:39 +00:00
parent 9fdbbdc877
commit 9e964f90fb
10 changed files with 185 additions and 128 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.42 1998/06/15 19:28:30 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.43 1998/07/15 14:54:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -162,11 +162,11 @@ _copyAppend(Append *from)
* copy remainder of node
* ----------------
*/
Node_Copy(from, newnode, unionplans);
Node_Copy(from, newnode, unionrts);
newnode->unionrelid = from->unionrelid;
Node_Copy(from, newnode, unionrtentries);
Node_Copy(from, newnode, unionstate);
Node_Copy(from, newnode, appendplans);
Node_Copy(from, newnode, unionrtables);
newnode->inheritrelid = from->inheritrelid;
Node_Copy(from, newnode, inheritrtable);
Node_Copy(from, newnode, appendstate);
return newnode;
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.39 1998/07/14 01:45:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.40 1998/07/15 14:54:32 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -354,17 +354,17 @@ _outAppend(StringInfo str, Append *node)
appendStringInfo(str, " APPEND ");
_outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :unionplans ");
_outNode(str, node->unionplans);
appendStringInfo(str, " :appendplans ");
_outNode(str, node->appendplans);
appendStringInfo(str, " :unionrts ");
_outNode(str, node->unionrts);
appendStringInfo(str, " :unionrtables ");
_outNode(str, node->unionrtables);
sprintf(buf, " :unionrelid %d ", node->unionrelid);
sprintf(buf, " :inheritrelid %d ", node->inheritrelid);
appendStringInfo(str, buf);
appendStringInfo(str, " :unionrtentries ");
_outNode(str, node->unionrtentries);
appendStringInfo(str, " :inheritrtable ");
_outNode(str, node->inheritrtable);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.15 1998/06/15 19:28:32 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.16 1998/07/15 14:54:33 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -387,6 +387,23 @@ print_plan_recursive(Plan *p, Query *parsetree, int indentLevel, char *label)
printf("\n");
print_plan_recursive(p->lefttree, parsetree, indentLevel + 3, "l: ");
print_plan_recursive(p->righttree, parsetree, indentLevel + 3, "r: ");
if (nodeTag(p) == T_Append)
{
List *lst;
int whichplan = 0;
Append *appendplan = (Append *)p;
foreach(lst, appendplan->appendplans)
{
Plan *subnode = (Plan *)lfirst(lst);
/* I don't think we need to fiddle with the range table here, bjm */
print_plan_recursive(subnode, parsetree, indentLevel + 3, "a: ");
whichplan++;
}
}
}
/* print_plan

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.31 1998/07/14 01:45:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.32 1998/07/15 14:54:34 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -322,18 +322,18 @@ _readAppend()
_getPlan((Plan *) local_node);
token = lsptok(NULL, &length); /* eat :unionplans */
local_node->unionplans = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* eat :appendplans */
local_node->appendplans = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* eat :unionrts */
local_node->unionrts = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* eat :unionrtables */
local_node->unionrtables = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* eat :unionrelid */
token = lsptok(NULL, &length); /* get unionrelid */
local_node->unionrelid = strtoul(token, NULL, 10);
token = lsptok(NULL, &length); /* eat :inheritrelid */
token = lsptok(NULL, &length); /* get inheritrelid */
local_node->inheritrelid = strtoul(token, NULL, 10);
token = lsptok(NULL, &length); /* eat :unionrtentries */
local_node->unionrtentries = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* eat :inheritrtable */
local_node->inheritrtable = nodeRead(true); /* now read it */
return (local_node);
}