index b1a5c785c1ff0cdd05f2e6941a3741c213d627b9..c2a1199d6c72d5752fa2e80ce31289317b16d0b5 100644 (file)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.13 2006年03月05日 15:58:29 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.14 2006年04月28日 20:57:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -117,15 +117,6 @@ optimize_minmax_aggregates(PlannerInfo *root, List *tlist, Path *best_path)
return NULL;
rel = find_base_rel(root, rtr->rtindex);
- /*
- * Also reject cases with subplans or volatile functions in WHERE. This
- * may be overly paranoid, but it's not entirely clear if the
- * transformation is safe then.
- */
- if (contain_subplans(parse->jointree->quals) ||
- contain_volatile_functions(parse->jointree->quals))
- return NULL;
-
/*
* Since this optimization is not applicable all that often, we want to
* fall out before doing very much work if possible. Therefore we do the
@@ -509,7 +500,7 @@ make_agg_subplan(PlannerInfo *root, MinMaxAggInfo *info, List *constant_quals)
ntest->nulltesttype = IS_NOT_NULL;
ntest->arg = copyObject(info->target);
- plan->qual = lappend(plan->qual, ntest);
+ plan->qual = lcons(ntest, plan->qual);
if (constant_quals)
plan = (Plan *) make_result(copyObject(plan->targetlist),
index 5296bb04359670e97f53a010884f8ed6839dd49d..b9e123d8e63e87d3649d8174f5783efa69f5f7e5 100644 (file)
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.105 2006年04月22日 01:25:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.106 2006年04月28日 20:57:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1248,8 +1248,6 @@ SS_make_initplan_from_plan(PlannerInfo *root, Plan *plan,
List *saved_initplan = PlannerInitPlan;
SubPlan *node;
Param *prm;
- Bitmapset *tmpset;
- int paramid;
/*
* Set up for a new level of subquery. This is just to keep
@@ -1280,18 +1278,9 @@ SS_make_initplan_from_plan(PlannerInfo *root, Plan *plan,
PlannerInitPlan = lappend(PlannerInitPlan, node);
/*
- * Make parParam list of params that current query level will pass to this
- * child plan. (In current usage there probably aren't any.)
+ * The node can't have any inputs (since it's an initplan), so the
+ * parParam and args lists remain empty.
*/
- tmpset = bms_copy(plan->extParam);
- while ((paramid = bms_first_member(tmpset)) >= 0)
- {
- PlannerParamItem *pitem = list_nth(PlannerParamList, paramid);
-
- if (pitem->abslevel == PlannerQueryLevel)
- node->parParam = lappend_int(node->parParam, paramid);
- }
- bms_free(tmpset);
/*
* Make a Param that will be the subplan's output.