mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Fix bushy plans. Cleanup.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.30 1999/02/14 22:24:25 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.31 1999/02/18 00:49:37 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -369,7 +369,7 @@ pull_constant_clauses(List *quals, List **constantQual)
|
||||
*
|
||||
*/
|
||||
void
|
||||
clause_get_relids_vars(Node *clause, List **relids, List **vars)
|
||||
clause_get_relids_vars(Node *clause, Relids *relids, List **vars)
|
||||
{
|
||||
List *clvars = pull_var_clause(clause);
|
||||
List *var_list = NIL;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.17 1999/02/15 05:21:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.18 1999/02/18 00:49:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -38,16 +38,16 @@
|
||||
JoinInfo *
|
||||
joininfo_member(List *join_relids, List *joininfo_list)
|
||||
{
|
||||
List *i = NIL;
|
||||
List *other_rels = NIL;
|
||||
List *i;
|
||||
|
||||
foreach(i, joininfo_list)
|
||||
{
|
||||
other_rels = lfirst(i);
|
||||
if (same(join_relids, ((JoinInfo *) other_rels)->unjoined_rels))
|
||||
return (JoinInfo *) other_rels;
|
||||
JoinInfo *joininfo = (JoinInfo *)lfirst(i);
|
||||
|
||||
if (same(join_relids, joininfo->unjoined_relids))
|
||||
return joininfo;
|
||||
}
|
||||
return (JoinInfo *) NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ joininfo_member(List *join_relids, List *joininfo_list)
|
||||
*
|
||||
*/
|
||||
JoinInfo *
|
||||
find_joininfo_node(RelOptInfo *this_rel, List *join_relids)
|
||||
find_joininfo_node(RelOptInfo *this_rel, Relids join_relids)
|
||||
{
|
||||
JoinInfo *joininfo = joininfo_member(join_relids,
|
||||
this_rel->joininfo);
|
||||
@@ -70,11 +70,10 @@ find_joininfo_node(RelOptInfo *this_rel, List *join_relids)
|
||||
if (joininfo == NULL)
|
||||
{
|
||||
joininfo = makeNode(JoinInfo);
|
||||
joininfo->unjoined_rels = join_relids;
|
||||
joininfo->unjoined_relids = join_relids;
|
||||
joininfo->jinfo_restrictinfo = NIL;
|
||||
joininfo->mergejoinable = false;
|
||||
joininfo->hashjoinable = false;
|
||||
joininfo->bushy_inactive = false;
|
||||
this_rel->joininfo = lcons(joininfo, this_rel->joininfo);
|
||||
}
|
||||
return joininfo;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.36 1999/02/15 03:22:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.37 1999/02/18 00:49:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -633,7 +633,7 @@ create_hashjoin_path(RelOptInfo *joinrel,
|
||||
pathnode->jpath.path.pathorder->ordtype = SORTOP_ORDER;
|
||||
pathnode->jpath.path.pathorder->ord.sortop = NULL;
|
||||
pathnode->jpath.path.outerjoincost = (Cost) 0.0;
|
||||
pathnode->jpath.path.joinid = (Relid) NULL;
|
||||
pathnode->jpath.path.joinid = (Relids) NULL;
|
||||
/* pathnode->hashjoinoperator = operator; */
|
||||
pathnode->path_hashclauses = hashclauses;
|
||||
pathnode->outerhashkeys = outerkeys;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.14 1999/02/15 03:22:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.15 1999/02/18 00:49:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -30,7 +30,7 @@
|
||||
RelOptInfo *
|
||||
get_base_rel(Query *root, int relid)
|
||||
{
|
||||
List *relids;
|
||||
Relids relids;
|
||||
RelOptInfo *rel;
|
||||
|
||||
relids = lconsi(relid, NIL);
|
||||
@@ -53,7 +53,6 @@ get_base_rel(Query *root, int relid)
|
||||
rel->restrictinfo = NIL;
|
||||
rel->joininfo = NIL;
|
||||
rel->innerjoin = NIL;
|
||||
rel->superrels = NIL;
|
||||
|
||||
root->base_rel_list = lcons(rel, root->base_rel_list);
|
||||
|
||||
@@ -76,7 +75,6 @@ get_base_rel(Query *root, int relid)
|
||||
bool hasindex;
|
||||
int pages,
|
||||
tuples;
|
||||
|
||||
/*
|
||||
* Otherwise, retrieve relation characteristics from the
|
||||
* system catalogs.
|
||||
@@ -93,11 +91,10 @@ get_base_rel(Query *root, int relid)
|
||||
/*
|
||||
* get_join_rel
|
||||
* Returns relation entry corresponding to 'relid' (a list of relids),
|
||||
* creating a new one if necessary. This is for join relations.
|
||||
*
|
||||
* or NULL.
|
||||
*/
|
||||
RelOptInfo *
|
||||
get_join_rel(Query *root, List *relid)
|
||||
get_join_rel(Query *root, Relids relid)
|
||||
{
|
||||
return rel_member(relid, root->join_rel_list);
|
||||
}
|
||||
@@ -111,17 +108,17 @@ get_join_rel(Query *root, List *relid)
|
||||
*
|
||||
*/
|
||||
RelOptInfo *
|
||||
rel_member(List *relid, List *rels)
|
||||
rel_member(Relids relids, List *rels)
|
||||
{
|
||||
List *temp = NIL;
|
||||
List *temprelid = NIL;
|
||||
|
||||
if (relid != NIL && rels != NIL)
|
||||
if (relids != NIL && rels != NIL)
|
||||
{
|
||||
foreach(temp, rels)
|
||||
{
|
||||
temprelid = ((RelOptInfo *) lfirst(temp))->relids;
|
||||
if (same(temprelid, relid))
|
||||
if (same(temprelid, relids))
|
||||
return (RelOptInfo *) (lfirst(temp));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user