aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-04-16 19:44:10 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-04-16 19:44:10 +0000
commitcdcaec5c53b290cc5e51a520980a97ac9eb4d5e3 (patch)
tree12987a37f4779b0d889f6c23501a8b5f786f3437 /src
parent722f7efdd96e979b4c8e081eb31e0ea0f08b3591 (diff)
downloadpostgresql-cdcaec5c53b290cc5e51a520980a97ac9eb4d5e3.tar.gz
postgresql-cdcaec5c53b290cc5e51a520980a97ac9eb4d5e3.zip
Avoid reversing user-given order of WHERE clauses while attaching clauses
to specific base or join RelOptInfo nodes during planning. This preserves the more-intuitive behavior of 7.0.* --- if you write an expensive clause (such as a sub-select) last, it should get evaluated last. Someday we ought to try to have some intelligence about the order of evaluation of WHERE clauses, but for now we should not override what the user wrote.
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/plan/initsplan.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index 2b2ebf238fe..7c3e15a8f88 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.58 2001/03/22 03:59:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.59 2001/04/16 19:44:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -444,8 +444,8 @@ distribute_qual_to_rels(Query *root, Node *clause,
*/
RelOptInfo *rel = get_base_rel(root, lfirsti(relids));
- rel->baserestrictinfo = lcons(restrictinfo,
- rel->baserestrictinfo);
+ rel->baserestrictinfo = lappend(rel->baserestrictinfo,
+ restrictinfo);
/*
* Check for a "mergejoinable" clause even though it's not a join
@@ -549,8 +549,8 @@ add_join_info_to_rels(Query *root, RestrictInfo *restrictinfo,
*/
joininfo = find_joininfo_node(get_base_rel(root, cur_relid),
unjoined_relids);
- joininfo->jinfo_restrictinfo = lcons(restrictinfo,
- joininfo->jinfo_restrictinfo);
+ joininfo->jinfo_restrictinfo = lappend(joininfo->jinfo_restrictinfo,
+ restrictinfo);
}
}