Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6a45941

Browse files
committed
Remove Existential, and ifdef out generate_fjoin. Neither did anything.
1 parent 4469eb6 commit 6a45941

File tree

13 files changed

+26
-200
lines changed

13 files changed

+26
-200
lines changed

src/backend/executor/execTuples.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.12 1997/11/26 01:10:54 momjian Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.13 1997/12/18 12:53:42 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -888,8 +888,6 @@ NodeGetResultTupleSlot(Plan *node)
888888
* the node's inner or outer subplan easily without having
889889
* to inspect the subplan.. -cim 10/16/89
890890
*
891-
* Assume that for existential nodes, we get the targetlist out
892-
* of the right node's targetlist
893891
* ----------------------------------------------------------------
894892
*/
895893

src/backend/nodes/copyfuncs.c

+1-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.19 1997/12/18 05:58:40 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.20 1997/12/18 12:53:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -108,24 +108,6 @@ _copyPlan(Plan *from)
108108
}
109109

110110

111-
/* ----------------
112-
* _copyExistential
113-
* ----------------
114-
*/
115-
static Existential *
116-
_copyExistential(Existential *from)
117-
{
118-
Existential *newnode = makeNode(Existential);
119-
120-
/* ----------------
121-
* copy node superclass fields
122-
* ----------------
123-
*/
124-
CopyPlanFields(from, newnode);
125-
126-
return newnode;
127-
}
128-
129111
/* ----------------
130112
* _copyResult
131113
* ----------------
@@ -1623,9 +1605,6 @@ copyObject(void *from)
16231605
case T_Plan:
16241606
retval = _copyPlan(from);
16251607
break;
1626-
case T_Existential:
1627-
retval = _copyExistential(from);
1628-
break;
16291608
case T_Result:
16301609
retval = _copyResult(from);
16311610
break;

src/backend/nodes/outfuncs.c

+1-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.11 1997/12/04 23:20:32 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.12 1997/12/18 12:53:51 momjian Exp $
1111
*
1212
* NOTES
1313
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -258,21 +258,6 @@ _outResult(StringInfo str, Result *node)
258258

259259
}
260260

261-
/*
262-
* Existential is a subclass of Plan.
263-
*/
264-
static void
265-
_outExistential(StringInfo str, Existential *node)
266-
{
267-
char buf[500];
268-
269-
sprintf(buf, "EXISTENTIAL");
270-
appendStringInfo(str, buf);
271-
_outPlanInfo(str, (Plan *) node);
272-
273-
274-
}
275-
276261
/*
277262
* Append is a subclass of Plan.
278263
*/
@@ -1641,9 +1626,6 @@ _outNode(StringInfo str, void *obj)
16411626
case T_Result:
16421627
_outResult(str, obj);
16431628
break;
1644-
case T_Existential:
1645-
_outExistential(str, obj);
1646-
break;
16471629
case T_Append:
16481630
_outAppend(str, obj);
16491631
break;

src/backend/nodes/print.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.11 1997/11/25 21:59:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.12 1997/12/18 12:53:56 momjian Exp $
1111
*
1212
* HISTORY
1313
* AUTHOR DATE MAJOR EVENT
@@ -304,9 +304,6 @@ plannode_type(Plan *p)
304304
case T_Plan:
305305
return "PLAN";
306306
break;
307-
case T_Existential:
308-
return "EXISTENTIAL";
309-
break;
310307
case T_Result:
311308
return "RESULT";
312309
break;

src/backend/nodes/readfuncs.c

+1-23
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.10 1997/10/25 01:09:30 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.11 1997/12/18 12:53:59 momjian Exp $
1111
*
1212
* NOTES
1313
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -217,24 +217,6 @@ _readResult()
217217
return (local_node);
218218
}
219219

220-
/* ----------------
221-
* _readExistential
222-
*
223-
* Existential nodes are only used by the planner.
224-
* ----------------
225-
*/
226-
static Existential *
227-
_readExistential()
228-
{
229-
Existential *local_node;
230-
231-
local_node = makeNode(Existential);
232-
233-
_getPlan((Plan *) local_node);
234-
235-
return (local_node);
236-
}
237-
238220
/* ----------------
239221
* _readAppend
240222
*
@@ -1884,10 +1866,6 @@ parsePlanString(void)
18841866
{
18851867
return_value = _readResult();
18861868
}
1887-
else if (!strncmp(token, "EXISTENTIAL", 11))
1888-
{
1889-
return_value = _readExistential();
1890-
}
18911869
else if (!strncmp(token, "APPEND", 6))
18921870
{
18931871
return_value = _readAppend();

src/backend/optimizer/plan/createplan.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.19 1997/12/18 12:30:43 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.20 1997/12/18 12:54:04 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1175,10 +1175,10 @@ make_unique(List *tlist, Plan *lefttree, char *uniqueAttr)
11751175
return (node);
11761176
}
11771177

1178+
#ifdef NOT_USED
11781179
List *
11791180
generate_fjoin(List *tlist)
11801181
{
1181-
#if 0
11821182
List tlistP;
11831183
List newTlist = NIL;
11841184
List fjoinList = NIL;
@@ -1227,6 +1227,7 @@ generate_fjoin(List *tlist)
12271227
newTlist = lappend(newTlist, tempList);
12281228
}
12291229
return newTlist;
1230-
#endif
12311230
return tlist; /* do nothing for now - ay 10/94 */
12321231
}
1232+
#endif
1233+

src/backend/optimizer/plan/planmain.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.10 1997/12/18 12:30:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.11 1997/12/18 12:54:09 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -259,7 +259,9 @@ query_planner(Query *root,
259259
* Destructively modify the query plan's targetlist to add fjoin lists
260260
* to flatten functions that return sets of base types
261261
*/
262+
#ifdef NOT_USED
262263
subplan->targetlist = generate_fjoin(subplan->targetlist);
264+
#endif
263265

264266
return (subplan);
265267
}
@@ -360,7 +362,9 @@ make_result(List *tlist,
360362
Result *node = makeNode(Result);
361363
Plan *plan = &node->plan;
362364

365+
#ifdef NOT_USED
363366
tlist = generate_fjoin(tlist);
367+
#endif
364368
plan->cost = (subplan ? subplan->cost : 0);
365369
plan->state = (EState *) NULL;
366370
plan->targetlist = tlist;

src/backend/optimizer/plan/planner.c

+7-50
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.11 1997/11/25 21:59:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.12 1997/12/18 12:54:11 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -48,7 +48,6 @@
4848

4949
static Plan *make_sortplan(List *tlist, List *sortcls, Plan *plannode);
5050
static Plan *init_query_planner(Query *parse);
51-
static Existential *make_existential(Plan *left, Plan *right);
5251

5352
/*****************************************************************************
5453
*
@@ -184,8 +183,7 @@ make_sortplan(List *tlist, List *sortcls, Plan *plannode)
184183

185184
/*
186185
* init-query-planner--
187-
* Deals with all non-union preprocessing, including existential
188-
* qualifications and CNFifying the qualifications.
186+
* Deals with all non-union preprocessing,and CNFifying the qualifications.
189187
*
190188
* Returns a query plan.
191189
* MODIFIES: tlist,qual
@@ -195,60 +193,19 @@ static Plan *
195193
init_query_planner(Query *root)
196194
{
197195
List *primary_qual;
198-
List *existential_qual;
199-
Existential *exist_plan;
200196
List *tlist = root->targetList;
201197

202198
tlist = preprocess_targetlist(tlist,
203199
root->commandType,
204200
root->resultRelation,
205201
root->rtable);
206202

207-
primary_qual =
208-
preprocess_qualification((Expr *) root->qual,
209-
tlist,
210-
&existential_qual);
203+
primary_qual = cnfify((Expr *) root->qual, true);
211204

212-
if (existential_qual == NULL)
213-
{
214-
return (query_planner(root,
215-
root->commandType,
216-
tlist,
217-
primary_qual));
218-
}
219-
else
220-
{
221-
int temp = root->commandType;
222-
Plan *existential_plan;
223-
224-
root->commandType = CMD_SELECT;
225-
existential_plan = query_planner(root,
226-
temp,
227-
NIL,
228-
existential_qual);
229-
230-
exist_plan = make_existential(existential_plan,
231-
query_planner(root,
232-
root->commandType,
233-
tlist,
234-
primary_qual));
235-
return ((Plan *) exist_plan);
236-
}
237-
}
238-
239-
/*
240-
* make_existential--
241-
* Instantiates an existential plan node and fills in
242-
* the left and right subtree slots.
243-
*/
244-
static Existential *
245-
make_existential(Plan *left, Plan *right)
246-
{
247-
Existential *node = makeNode(Existential);
248-
249-
node->lefttree = left;
250-
node->righttree = left;
251-
return (node);
205+
return (query_planner(root,
206+
root->commandType,
207+
tlist,
208+
primary_qual));
252209
}
253210

254211
/*

src/backend/optimizer/prep/prepqual.c

+1-58
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.6 1997/09/08 21:45:31 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.7 1997/12/18 12:54:15 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -36,42 +36,6 @@ static List *qualcleanup(Expr *qual);
3636
static List *remove_ands(Expr *qual);
3737
static List *remove_duplicates(List *list);
3838

39-
/*
40-
* preprocess-qualification--
41-
* Driver routine for modifying the parse tree qualification.
42-
*
43-
* Returns the new base qualification and the existential qualification
44-
* in existentialQualPtr.
45-
*
46-
* XXX right now, update_clauses() does nothing so
47-
* preprocess-qualification simply converts the qual in conjunctive
48-
* normal form (see cnfify() below )
49-
*/
50-
List *
51-
preprocess_qualification(Expr *qual, List *tlist, List **existentialQualPtr)
52-
{
53-
List *cnf_qual = cnfify(qual, true);
54-
55-
/*
56-
List *existential_qual =
57-
update_clauses(intCons(_query_result_relation_,
58-
update_relations(tlist)),
59-
cnf_qual,
60-
_query_command_type_);
61-
if (existential_qual) {
62-
*existentialQualPtr = existential_qual;
63-
return set_difference(cnf_qual, existential_qual);
64-
} else {
65-
*existentialQualPtr = NIL;
66-
return cnf_qual;
67-
}
68-
*/
69-
/* update_clauses() is not working right now */
70-
*existentialQualPtr = NIL;
71-
return cnf_qual;
72-
73-
}
74-
7539
/*****************************************************************************
7640
*
7741
* CNF CONVERSION ROUTINES
@@ -607,27 +571,6 @@ remove_ands(Expr *qual)
607571
}
608572
}
609573

610-
/*****************************************************************************
611-
*
612-
* EXISTENTIAL QUALIFICATIONS
613-
*
614-
*****************************************************************************/
615-
616-
/*
617-
* update-relations--
618-
* Returns the range table indices (i.e., varnos) for all relations which
619-
* are referenced in the target list.
620-
*
621-
*/
622-
#ifdef NOT_USED
623-
static List *
624-
update_relations(List *tlist)
625-
{
626-
return (NIL);
627-
}
628-
629-
#endif
630-
631574
/*****************************************************************************
632575
*
633576
*

0 commit comments

Comments
 (0)