]> granicus.if.org Git - postgresql/commitdiff
Make WHERE conditions pulled up from subqueries be executed before outer
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 13 Jun 2002 15:10:25 +0000 (15:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 13 Jun 2002 15:10:25 +0000 (15:10 +0000)
WHERE conditions, if there is no reason to do it differently.

src/backend/optimizer/plan/planner.c

index a28c088e8faeb78e71e012c5e400a3a970823cd7..7e1c7ffdc00812743f619f948f4da06d28337f5e 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.119 2002/05/18 18:49:41 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.120 2002/06/13 15:10:25 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -656,7 +656,7 @@ preprocess_jointree(Query *parse, Node *jtnode)
                                if (childlen <= 1 || (childlen + myothers) <= geqo_rels / 2)
                                {
                                        newlist = nconc(newlist, subf->fromlist);
-                                       f->quals = make_and_qual(f->quals, subf->quals);
+                                       f->quals = make_and_qual(subf->quals, f->quals);
                                }
                                else
                                        newlist = lappend(newlist, child);