1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

Remove Existential, and ifdef out generate_fjoin. Neither did anything.

This commit is contained in:
Bruce Momjian
1997-12-18 12:54:45 +00:00
parent 4469eb63a3
commit 6a45941f2f
13 changed files with 26 additions and 200 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.19 1997/12/18 12:30:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.20 1997/12/18 12:54:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1175,10 +1175,10 @@ make_unique(List *tlist, Plan *lefttree, char *uniqueAttr)
return (node);
}
#ifdef NOT_USED
List *
generate_fjoin(List *tlist)
{
#if 0
List tlistP;
List newTlist = NIL;
List fjoinList = NIL;
@ -1227,6 +1227,7 @@ generate_fjoin(List *tlist)
newTlist = lappend(newTlist, tempList);
}
return newTlist;
#endif
return tlist; /* do nothing for now - ay 10/94 */
}
#endif

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.10 1997/12/18 12:30:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.11 1997/12/18 12:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -259,7 +259,9 @@ query_planner(Query *root,
* Destructively modify the query plan's targetlist to add fjoin lists
* to flatten functions that return sets of base types
*/
#ifdef NOT_USED
subplan->targetlist = generate_fjoin(subplan->targetlist);
#endif
return (subplan);
}
@ -360,7 +362,9 @@ make_result(List *tlist,
Result *node = makeNode(Result);
Plan *plan = &node->plan;
#ifdef NOT_USED
tlist = generate_fjoin(tlist);
#endif
plan->cost = (subplan ? subplan->cost : 0);
plan->state = (EState *) NULL;
plan->targetlist = tlist;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.11 1997/11/25 21:59:59 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.12 1997/12/18 12:54:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -48,7 +48,6 @@
static Plan *make_sortplan(List *tlist, List *sortcls, Plan *plannode);
static Plan *init_query_planner(Query *parse);
static Existential *make_existential(Plan *left, Plan *right);
/*****************************************************************************
*
@ -184,8 +183,7 @@ make_sortplan(List *tlist, List *sortcls, Plan *plannode)
/*
* init-query-planner--
* Deals with all non-union preprocessing, including existential
* qualifications and CNFifying the qualifications.
* Deals with all non-union preprocessing,and CNFifying the qualifications.
*
* Returns a query plan.
* MODIFIES: tlist,qual
@ -195,8 +193,6 @@ static Plan *
init_query_planner(Query *root)
{
List *primary_qual;
List *existential_qual;
Existential *exist_plan;
List *tlist = root->targetList;
tlist = preprocess_targetlist(tlist,
@ -204,51 +200,12 @@ init_query_planner(Query *root)
root->resultRelation,
root->rtable);
primary_qual =
preprocess_qualification((Expr *) root->qual,
tlist,
&existential_qual);
primary_qual = cnfify((Expr *) root->qual, true);
if (existential_qual == NULL)
{
return (query_planner(root,
root->commandType,
tlist,
primary_qual));
}
else
{
int temp = root->commandType;
Plan *existential_plan;
root->commandType = CMD_SELECT;
existential_plan = query_planner(root,
temp,
NIL,
existential_qual);
exist_plan = make_existential(existential_plan,
query_planner(root,
root->commandType,
tlist,
primary_qual));
return ((Plan *) exist_plan);
}
}
/*
* make_existential--
* Instantiates an existential plan node and fills in
* the left and right subtree slots.
*/
static Existential *
make_existential(Plan *left, Plan *right)
{
Existential *node = makeNode(Existential);
node->lefttree = left;
node->righttree = left;
return (node);
return (query_planner(root,
root->commandType,
tlist,
primary_qual));
}
/*

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.6 1997/09/08 21:45:31 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.7 1997/12/18 12:54:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -36,42 +36,6 @@ static List *qualcleanup(Expr *qual);
static List *remove_ands(Expr *qual);
static List *remove_duplicates(List *list);
/*
* preprocess-qualification--
* Driver routine for modifying the parse tree qualification.
*
* Returns the new base qualification and the existential qualification
* in existentialQualPtr.
*
* XXX right now, update_clauses() does nothing so
* preprocess-qualification simply converts the qual in conjunctive
* normal form (see cnfify() below )
*/
List *
preprocess_qualification(Expr *qual, List *tlist, List **existentialQualPtr)
{
List *cnf_qual = cnfify(qual, true);
/*
List *existential_qual =
update_clauses(intCons(_query_result_relation_,
update_relations(tlist)),
cnf_qual,
_query_command_type_);
if (existential_qual) {
*existentialQualPtr = existential_qual;
return set_difference(cnf_qual, existential_qual);
} else {
*existentialQualPtr = NIL;
return cnf_qual;
}
*/
/* update_clauses() is not working right now */
*existentialQualPtr = NIL;
return cnf_qual;
}
/*****************************************************************************
*
* CNF CONVERSION ROUTINES
@ -607,27 +571,6 @@ remove_ands(Expr *qual)
}
}
/*****************************************************************************
*
* EXISTENTIAL QUALIFICATIONS
*
*****************************************************************************/
/*
* update-relations--
* Returns the range table indices (i.e., varnos) for all relations which
* are referenced in the target list.
*
*/
#ifdef NOT_USED
static List *
update_relations(List *tlist)
{
return (NIL);
}
#endif
/*****************************************************************************
*
*