mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* copyfuncs.c--
|
||||
* Copy functions for Postgres tree nodes.
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.57 1999/02/02 03:44:26 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.58 1999/02/03 20:15:20 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1064,7 +1064,7 @@ _copyRelOptInfo(RelOptInfo * from)
|
||||
newnode->ordering[len] = 0;
|
||||
}
|
||||
|
||||
Node_Copy(from, newnode, clauseinfo);
|
||||
Node_Copy(from, newnode, restrictinfo);
|
||||
Node_Copy(from, newnode, joininfo);
|
||||
Node_Copy(from, newnode, innerjoin);
|
||||
Node_Copy(from, newnode, superrels);
|
||||
@@ -1119,7 +1119,7 @@ CopyPathFields(Path *from, Path *newnode)
|
||||
newnode->outerjoincost = from->outerjoincost;
|
||||
|
||||
newnode->joinid = listCopy(from->joinid);
|
||||
Node_Copy(from, newnode, locclauseinfo);
|
||||
Node_Copy(from, newnode, loc_restrictinfo);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -1184,7 +1184,7 @@ _copyIndexPath(IndexPath *from)
|
||||
static void
|
||||
CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
|
||||
{
|
||||
Node_Copy(from, newnode, pathclauseinfo);
|
||||
Node_Copy(from, newnode, pathinfo);
|
||||
Node_Copy(from, newnode, outerjoinpath);
|
||||
Node_Copy(from, newnode, innerjoinpath);
|
||||
}
|
||||
@@ -1324,13 +1324,13 @@ _copyMergeOrder(MergeOrder *from)
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _copyClauseInfo
|
||||
* _copyRestrictInfo
|
||||
* ----------------
|
||||
*/
|
||||
static ClauseInfo *
|
||||
_copyClauseInfo(ClauseInfo * from)
|
||||
static RestrictInfo *
|
||||
_copyRestrictInfo(RestrictInfo * from)
|
||||
{
|
||||
ClauseInfo *newnode = makeNode(ClauseInfo);
|
||||
RestrictInfo *newnode = makeNode(RestrictInfo);
|
||||
|
||||
/* ----------------
|
||||
* copy remainder of node
|
||||
@@ -1430,7 +1430,7 @@ _copyJoinInfo(JoinInfo * from)
|
||||
* ----------------
|
||||
*/
|
||||
newnode->otherrels = listCopy(from->otherrels);
|
||||
Node_Copy(from, newnode, jinfoclauseinfo);
|
||||
Node_Copy(from, newnode, jinfo_restrictinfo);
|
||||
|
||||
newnode->mergejoinable = from->mergejoinable;
|
||||
newnode->hashjoinable = from->hashjoinable;
|
||||
@@ -1792,8 +1792,8 @@ copyObject(void *from)
|
||||
case T_MergeOrder:
|
||||
retval = _copyMergeOrder(from);
|
||||
break;
|
||||
case T_ClauseInfo:
|
||||
retval = _copyClauseInfo(from);
|
||||
case T_RestrictInfo:
|
||||
retval = _copyRestrictInfo(from);
|
||||
break;
|
||||
case T_JoinMethod:
|
||||
retval = _copyJoinMethod(from);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.21 1999/02/02 23:53:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.22 1999/02/03 20:15:22 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -278,13 +278,13 @@ _equalFunc(Func *a, Func *b)
|
||||
}
|
||||
|
||||
/*
|
||||
* ClauseInfo is a subclass of Node.
|
||||
* RestrictInfo is a subclass of Node.
|
||||
*/
|
||||
static bool
|
||||
_equalClauseInfo(ClauseInfo * a, ClauseInfo * b)
|
||||
_equalRestrictInfo(RestrictInfo * a, RestrictInfo * b)
|
||||
{
|
||||
Assert(IsA(a, ClauseInfo));
|
||||
Assert(IsA(b, ClauseInfo));
|
||||
Assert(IsA(a, RestrictInfo));
|
||||
Assert(IsA(b, RestrictInfo));
|
||||
|
||||
if (!equal(a->clause, b->clause))
|
||||
return false;
|
||||
@@ -298,8 +298,7 @@ _equalClauseInfo(ClauseInfo * a, ClauseInfo * b)
|
||||
#endif
|
||||
if (a->hashjoinoperator != b->hashjoinoperator)
|
||||
return false;
|
||||
return (equal((a->indexids),
|
||||
(b->indexids)));
|
||||
return equal(a->indexids, b->indexids);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -311,8 +310,7 @@ _equalRelOptInfo(RelOptInfo * a, RelOptInfo * b)
|
||||
Assert(IsA(a, RelOptInfo));
|
||||
Assert(IsA(b, RelOptInfo));
|
||||
|
||||
return (equal((a->relids),
|
||||
(b->relids)));
|
||||
return equal(a->relids, b->relids);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -321,11 +319,9 @@ _equalJoinMethod(JoinMethod *a, JoinMethod *b)
|
||||
Assert(IsA(a, JoinMethod));
|
||||
Assert(IsA(b, JoinMethod));
|
||||
|
||||
if (!equal((a->jmkeys),
|
||||
(b->jmkeys)))
|
||||
if (!equal(a->jmkeys, b->jmkeys))
|
||||
return false;
|
||||
if (!equal((a->clauses),
|
||||
(b->clauses)))
|
||||
if (!equal(a->clauses, b->clauses))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -368,19 +364,16 @@ _equalPath(Path *a, Path *b)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!equal((a->p_ordering.ord.merge),
|
||||
(b->p_ordering.ord.merge)))
|
||||
if (!equal(a->p_ordering.ord.merge, b->p_ordering.ord.merge))
|
||||
return false;
|
||||
}
|
||||
if (!equal((a->keys),
|
||||
(b->keys)))
|
||||
if (!equal(a->keys, b->keys))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* if (a->outerjoincost != b->outerjoincost) return(false);
|
||||
*/
|
||||
if (!equali((a->joinid),
|
||||
(b->joinid)))
|
||||
if (!equali(a->joinid, b->joinid))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -390,9 +383,9 @@ _equalIndexPath(IndexPath *a, IndexPath *b)
|
||||
{
|
||||
if (!_equalPath((Path *) a, (Path *) b))
|
||||
return false;
|
||||
if (!equali((a->indexid), (b->indexid)))
|
||||
if (!equali(a->indexid, b->indexid))
|
||||
return false;
|
||||
if (!equal((a->indexqual), (b->indexqual)))
|
||||
if (!equal(a->indexqual, b->indexqual))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -405,11 +398,11 @@ _equalJoinPath(JoinPath *a, JoinPath *b)
|
||||
|
||||
if (!_equalPath((Path *) a, (Path *) b))
|
||||
return false;
|
||||
if (!equal((a->pathclauseinfo), (b->pathclauseinfo)))
|
||||
if (!equal(a->pathinfo, b->pathinfo))
|
||||
return false;
|
||||
if (!equal((a->outerjoinpath), (b->outerjoinpath)))
|
||||
if (!equal(a->outerjoinpath, b->outerjoinpath))
|
||||
return false;
|
||||
if (!equal((a->innerjoinpath), (b->innerjoinpath)))
|
||||
if (!equal(a->innerjoinpath, b->innerjoinpath))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -454,9 +447,9 @@ _equalJoinKey(JoinKey *a, JoinKey *b)
|
||||
Assert(IsA(a, JoinKey));
|
||||
Assert(IsA(b, JoinKey));
|
||||
|
||||
if (!equal((a->outer), (b->outer)))
|
||||
if (!equal(a->outer, b->outer))
|
||||
return false;
|
||||
if (!equal((a->inner), (b->inner)))
|
||||
if (!equal(a->inner, b->inner))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -506,13 +499,13 @@ _equalIndexScan(IndexScan *a, IndexScan *b)
|
||||
* if(a->scan.plan.cost != b->scan.plan.cost) return(false);
|
||||
*/
|
||||
|
||||
if (!equal((a->indxqual), (b->indxqual)))
|
||||
if (!equal(a->indxqual, b->indxqual))
|
||||
return false;
|
||||
|
||||
if (a->scan.scanrelid != b->scan.scanrelid)
|
||||
return false;
|
||||
|
||||
if (!equali((a->indxid), (b->indxid)))
|
||||
if (!equali(a->indxid, b->indxid))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -523,7 +516,7 @@ _equalSubPlan(SubPlan *a, SubPlan *b)
|
||||
if (a->plan_id != b->plan_id)
|
||||
return false;
|
||||
|
||||
if (!equal((a->sublink->oper), (b->sublink->oper)))
|
||||
if (!equal(a->sublink->oper, b->sublink->oper))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -534,9 +527,9 @@ _equalJoinInfo(JoinInfo * a, JoinInfo * b)
|
||||
{
|
||||
Assert(IsA(a, JoinInfo));
|
||||
Assert(IsA(b, JoinInfo));
|
||||
if (!equal((a->otherrels), (b->otherrels)))
|
||||
if (!equal(a->otherrels, b->otherrels))
|
||||
return false;
|
||||
if (!equal((a->jinfoclauseinfo), (b->jinfoclauseinfo)))
|
||||
if (!equal(a->jinfo_restrictinfo, b->jinfo_restrictinfo))
|
||||
return false;
|
||||
if (a->mergejoinable != b->mergejoinable)
|
||||
return false;
|
||||
@@ -673,8 +666,8 @@ equal(void *a, void *b)
|
||||
case T_Func:
|
||||
retval = _equalFunc(a, b);
|
||||
break;
|
||||
case T_ClauseInfo:
|
||||
retval = _equalClauseInfo(a, b);
|
||||
case T_RestrictInfo:
|
||||
retval = _equalRestrictInfo(a, b);
|
||||
break;
|
||||
case T_RelOptInfo:
|
||||
retval = _equalRelOptInfo(a, b);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: outfuncs.c,v 1.62 1999/02/02 03:44:26 momjian Exp $
|
||||
* $Id: outfuncs.c,v 1.63 1999/02/03 20:15:22 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@@ -879,11 +879,11 @@ _outRelOptInfo(StringInfo str, RelOptInfo * node)
|
||||
*/
|
||||
|
||||
appendStringInfo(str,
|
||||
" :unorderedpath @ 0x%x :cheapestpath @ 0x%x :pruneable %s :clauseinfo ",
|
||||
" :unorderedpath @ 0x%x :cheapestpath @ 0x%x :pruneable %s :restrictinfo ",
|
||||
(int) node->unorderedpath,
|
||||
(int) node->cheapestpath,
|
||||
node->pruneable ? "true" : "false");
|
||||
_outNode(str, node->clauseinfo);
|
||||
_outNode(str, node->restrictinfo);
|
||||
|
||||
appendStringInfo(str, " :joininfo ");
|
||||
_outNode(str, node->joininfo);
|
||||
@@ -967,8 +967,8 @@ _outJoinPath(StringInfo str, JoinPath *node)
|
||||
node->path.path_cost);
|
||||
_outNode(str, node->path.keys);
|
||||
|
||||
appendStringInfo(str, " :pathclauseinfo ");
|
||||
_outNode(str, node->pathclauseinfo);
|
||||
appendStringInfo(str, " :pathinfo ");
|
||||
_outNode(str, node->pathinfo);
|
||||
|
||||
/*
|
||||
* Not sure if these are nodes; they're declared as "struct path *".
|
||||
@@ -995,8 +995,8 @@ _outMergePath(StringInfo str, MergePath *node)
|
||||
node->jpath.path.path_cost);
|
||||
_outNode(str, node->jpath.path.keys);
|
||||
|
||||
appendStringInfo(str, " :pathclauseinfo ");
|
||||
_outNode(str, node->jpath.pathclauseinfo);
|
||||
appendStringInfo(str, " :pathinfo ");
|
||||
_outNode(str, node->jpath.pathinfo);
|
||||
|
||||
/*
|
||||
* Not sure if these are nodes; they're declared as "struct path *".
|
||||
@@ -1032,8 +1032,8 @@ _outHashPath(StringInfo str, HashPath *node)
|
||||
node->jpath.path.path_cost);
|
||||
_outNode(str, node->jpath.path.keys);
|
||||
|
||||
appendStringInfo(str, " :pathclauseinfo ");
|
||||
_outNode(str, node->jpath.pathclauseinfo);
|
||||
appendStringInfo(str, " :pathinfo ");
|
||||
_outNode(str, node->jpath.pathinfo);
|
||||
|
||||
/*
|
||||
* Not sure if these are nodes; they're declared as "struct path *".
|
||||
@@ -1102,10 +1102,10 @@ _outMergeOrder(StringInfo str, MergeOrder *node)
|
||||
}
|
||||
|
||||
/*
|
||||
* ClauseInfo is a subclass of Node.
|
||||
* RestrictInfo is a subclass of Node.
|
||||
*/
|
||||
static void
|
||||
_outClauseInfo(StringInfo str, ClauseInfo * node)
|
||||
_outRestrictInfo(StringInfo str, RestrictInfo * node)
|
||||
{
|
||||
appendStringInfo(str, " CINFO :clause ");
|
||||
_outNode(str, node->clause);
|
||||
@@ -1158,8 +1158,8 @@ _outJoinInfo(StringInfo str, JoinInfo * node)
|
||||
appendStringInfo(str, " JINFO :otherrels ");
|
||||
_outIntList(str, node->otherrels);
|
||||
|
||||
appendStringInfo(str, " :jinfoclauseinfo ");
|
||||
_outNode(str, node->jinfoclauseinfo);
|
||||
appendStringInfo(str, " :jinfo_restrictinfo ");
|
||||
_outNode(str, node->jinfo_restrictinfo);
|
||||
|
||||
appendStringInfo(str, " :mergejoinable %s :hashjoinable %s ",
|
||||
node->mergejoinable ? "true" : "false",
|
||||
@@ -1572,8 +1572,8 @@ _outNode(StringInfo str, void *obj)
|
||||
case T_MergeOrder:
|
||||
_outMergeOrder(str, obj);
|
||||
break;
|
||||
case T_ClauseInfo:
|
||||
_outClauseInfo(str, obj);
|
||||
case T_RestrictInfo:
|
||||
_outRestrictInfo(str, obj);
|
||||
break;
|
||||
case T_JoinMethod:
|
||||
_outJoinMethod(str, obj);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.44 1999/02/02 03:44:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.45 1999/02/03 20:15:22 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||
@@ -1348,8 +1348,8 @@ _readRelOptInfo()
|
||||
sscanf(token, "%x", (unsigned int *) &local_node->cheapestpath);
|
||||
|
||||
|
||||
token = lsptok(NULL, &length); /* get :clauseinfo */
|
||||
local_node->clauseinfo = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :restrictinfo */
|
||||
local_node->restrictinfo = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :joininfo */
|
||||
local_node->joininfo = nodeRead(true); /* now read it */
|
||||
@@ -1560,8 +1560,8 @@ _readJoinPath()
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
local_node->path.keys = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :pathclauseinfo */
|
||||
local_node->pathclauseinfo = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :pathinfo */
|
||||
local_node->pathinfo = nodeRead(true); /* now read it */
|
||||
|
||||
/*
|
||||
* Not sure if these are nodes; they're declared as "struct path *".
|
||||
@@ -1628,8 +1628,8 @@ _readMergePath()
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
local_node->jpath.path.keys = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :pathclauseinfo */
|
||||
local_node->jpath.pathclauseinfo = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :pathinfo */
|
||||
local_node->jpath.pathinfo = nodeRead(true); /* now read it */
|
||||
|
||||
/*
|
||||
* Not sure if these are nodes; they're declared as "struct path *".
|
||||
@@ -1705,8 +1705,8 @@ _readHashPath()
|
||||
token = lsptok(NULL, &length); /* get :keys */
|
||||
local_node->jpath.path.keys = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :pathclauseinfo */
|
||||
local_node->jpath.pathclauseinfo = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :pathinfo */
|
||||
local_node->jpath.pathinfo = nodeRead(true); /* now read it */
|
||||
|
||||
/*
|
||||
* Not sure if these are nodes; they're declared as "struct path *".
|
||||
@@ -1844,19 +1844,19 @@ _readMergeOrder()
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _readClauseInfo
|
||||
* _readRestrictInfo
|
||||
*
|
||||
* ClauseInfo is a subclass of Node.
|
||||
* RestrictInfo is a subclass of Node.
|
||||
* ----------------
|
||||
*/
|
||||
static ClauseInfo *
|
||||
_readClauseInfo()
|
||||
static RestrictInfo *
|
||||
_readRestrictInfo()
|
||||
{
|
||||
ClauseInfo *local_node;
|
||||
RestrictInfo *local_node;
|
||||
char *token;
|
||||
int length;
|
||||
|
||||
local_node = makeNode(ClauseInfo);
|
||||
local_node = makeNode(RestrictInfo);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :clause */
|
||||
local_node->clause = nodeRead(true); /* now read it */
|
||||
@@ -1960,8 +1960,8 @@ _readJoinInfo()
|
||||
local_node->otherrels =
|
||||
toIntList(nodeRead(true)); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :jinfoclauseinfo */
|
||||
local_node->jinfoclauseinfo = nodeRead(true); /* now read it */
|
||||
token = lsptok(NULL, &length); /* get :jinfo_restrictinfo */
|
||||
local_node->jinfo_restrictinfo = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :mergejoinable */
|
||||
|
||||
@@ -2096,7 +2096,7 @@ parsePlanString(void)
|
||||
else if (!strncmp(token, "MERGEORDER", length))
|
||||
return_value = _readMergeOrder();
|
||||
else if (!strncmp(token, "CLAUSEINFO", length))
|
||||
return_value = _readClauseInfo();
|
||||
return_value = _readRestrictInfo();
|
||||
else if (!strncmp(token, "JOINMETHOD", length))
|
||||
return_value = _readJoinMethod();
|
||||
else if (!strncmp(token, "JOININFO", length))
|
||||
|
||||
Reference in New Issue
Block a user