mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Optimizer cleanup.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.62 1999/02/05 19:59:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.63 1999/02/08 04:29:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1093,25 +1093,25 @@ CopyPathFields(Path *from, Path *newnode)
|
||||
|
||||
newnode->path_cost = from->path_cost;
|
||||
|
||||
newnode->p_ordering.ordtype = from->p_ordering.ordtype;
|
||||
if (from->p_ordering.ordtype == SORTOP_ORDER)
|
||||
newnode->path_order.ordtype = from->path_order.ordtype;
|
||||
if (from->path_order.ordtype == SORTOP_ORDER)
|
||||
{
|
||||
int len,
|
||||
i;
|
||||
Oid *ordering = from->p_ordering.ord.sortop;
|
||||
Oid *ordering = from->path_order.ord.sortop;
|
||||
|
||||
if (ordering)
|
||||
{
|
||||
for (len = 0; ordering[len] != 0; len++)
|
||||
;
|
||||
newnode->p_ordering.ord.sortop = (Oid *) palloc(sizeof(Oid) * (len + 1));
|
||||
newnode->path_order.ord.sortop = (Oid *) palloc(sizeof(Oid) * (len + 1));
|
||||
for (i = 0; i < len; i++)
|
||||
newnode->p_ordering.ord.sortop[i] = ordering[i];
|
||||
newnode->p_ordering.ord.sortop[len] = 0;
|
||||
newnode->path_order.ord.sortop[i] = ordering[i];
|
||||
newnode->path_order.ord.sortop[len] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
Node_Copy(from, newnode, p_ordering.ord.merge);
|
||||
Node_Copy(from, newnode, path_order.ord.merge);
|
||||
|
||||
Node_Copy(from, newnode, keys);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.25 1999/02/07 00:52:12 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.26 1999/02/08 04:29:04 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -337,33 +337,33 @@ _equalPath(Path *a, Path *b)
|
||||
/*
|
||||
* if (a->path_cost != b->path_cost) return(false);
|
||||
*/
|
||||
if (a->p_ordering.ordtype == SORTOP_ORDER)
|
||||
if (a->path_order.ordtype == SORTOP_ORDER)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (a->p_ordering.ord.sortop == NULL ||
|
||||
b->p_ordering.ord.sortop == NULL)
|
||||
if (a->path_order.ord.sortop == NULL ||
|
||||
b->path_order.ord.sortop == NULL)
|
||||
{
|
||||
if (a->p_ordering.ord.sortop != b->p_ordering.ord.sortop)
|
||||
if (a->path_order.ord.sortop != b->path_order.ord.sortop)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (a->p_ordering.ord.sortop[i] != 0 &&
|
||||
b->p_ordering.ord.sortop[i] != 0)
|
||||
while (a->path_order.ord.sortop[i] != 0 &&
|
||||
b->path_order.ord.sortop[i] != 0)
|
||||
{
|
||||
if (a->p_ordering.ord.sortop[i] != b->p_ordering.ord.sortop[i])
|
||||
if (a->path_order.ord.sortop[i] != b->path_order.ord.sortop[i])
|
||||
return false;
|
||||
i++;
|
||||
}
|
||||
if (a->p_ordering.ord.sortop[i] != 0 ||
|
||||
b->p_ordering.ord.sortop[i] != 0)
|
||||
if (a->path_order.ord.sortop[i] != 0 ||
|
||||
b->path_order.ord.sortop[i] != 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!equal(a->p_ordering.ord.merge, b->p_ordering.ord.merge))
|
||||
if (!equal(a->path_order.ord.merge, b->path_order.ord.merge))
|
||||
return false;
|
||||
}
|
||||
if (!equal(a->keys, b->keys))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.1 1999/02/06 16:50:25 wieck Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.2 1999/02/08 04:29:04 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -756,13 +756,13 @@ _freeRelOptInfo(RelOptInfo * node)
|
||||
static void
|
||||
FreePathFields(Path *node)
|
||||
{
|
||||
if (node->p_ordering.ordtype == SORTOP_ORDER)
|
||||
if (node->path_order.ordtype == SORTOP_ORDER)
|
||||
{
|
||||
if (node->p_ordering.ord.sortop)
|
||||
pfree(node->p_ordering.ord.sortop);
|
||||
if (node->path_order.ord.sortop)
|
||||
pfree(node->path_order.ord.sortop);
|
||||
}
|
||||
else
|
||||
freeObject(node->p_ordering.ord.merge);
|
||||
freeObject(node->path_order.ord.merge);
|
||||
|
||||
freeObject(node->keys);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.49 1999/02/05 19:59:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.50 1999/02/08 04:29:04 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||
@@ -1474,8 +1474,8 @@ _readPath()
|
||||
local_node->path_cost = (Cost) atof(token);
|
||||
|
||||
#if 0
|
||||
token = lsptok(NULL, &length); /* get :p_ordering */
|
||||
local_node->p_ordering = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :path_order */
|
||||
local_node->path_order = nodeRead(true); /* now read it */
|
||||
#endif
|
||||
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
@@ -1508,8 +1508,8 @@ _readIndexPath()
|
||||
local_node->path.path_cost = (Cost) atof(token);
|
||||
|
||||
#if 0
|
||||
token = lsptok(NULL, &length); /* get :p_ordering */
|
||||
local_node->path.p_ordering = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :path_order */
|
||||
local_node->path.path_order = nodeRead(true); /* now read it */
|
||||
#endif
|
||||
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
@@ -1549,8 +1549,8 @@ _readJoinPath()
|
||||
local_node->path.path_cost = (Cost) atof(token);
|
||||
|
||||
#if 0
|
||||
token = lsptok(NULL, &length); /* get :p_ordering */
|
||||
local_node->path.p_ordering = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :path_order */
|
||||
local_node->path.path_order = nodeRead(true); /* now read it */
|
||||
#endif
|
||||
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
@@ -1616,8 +1616,8 @@ _readMergePath()
|
||||
local_node->jpath.path.path_cost = (Cost) atof(token);
|
||||
|
||||
#if 0
|
||||
token = lsptok(NULL, &length); /* get :p_ordering */
|
||||
local_node->jpath.path.p_ordering = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :path_order */
|
||||
local_node->jpath.path.path_order = nodeRead(true); /* now read it */
|
||||
#endif
|
||||
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
@@ -1692,8 +1692,8 @@ _readHashPath()
|
||||
local_node->jpath.path.path_cost = (Cost) atof(token);
|
||||
|
||||
#if 0
|
||||
token = lsptok(NULL, &length); /* get :p_ordering */
|
||||
local_node->jpath.path.p_ordering = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :path_order */
|
||||
local_node->jpath.path.path_order = nodeRead(true); /* now read it */
|
||||
#endif
|
||||
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
|
||||
Reference in New Issue
Block a user