Commit 0201dac1 authored by Tom Lane's avatar Tom Lane

Push down outer qualification clauses into UNION and INTERSECT subqueries.

Per pghackers discussion from back around 1-August.
parent d2236800
This diff is collapsed.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.75 2002/08/02 18:15:06 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.76 2002/08/29 16:03:48 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -66,7 +66,6 @@ static List *generate_setop_tlist(List *colTypes, int flag, ...@@ -66,7 +66,6 @@ static List *generate_setop_tlist(List *colTypes, int flag,
static List *generate_append_tlist(List *colTypes, bool flag, static List *generate_append_tlist(List *colTypes, bool flag,
List *input_plans, List *input_plans,
List *refnames_tlist); List *refnames_tlist);
static bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
static Node *adjust_inherited_attrs_mutator(Node *node, static Node *adjust_inherited_attrs_mutator(Node *node,
adjust_inherited_attrs_context *context); adjust_inherited_attrs_context *context);
...@@ -579,7 +578,7 @@ generate_append_tlist(List *colTypes, bool flag, ...@@ -579,7 +578,7 @@ generate_append_tlist(List *colTypes, bool flag,
* Resjunk columns are ignored if junkOK is true; otherwise presence of * Resjunk columns are ignored if junkOK is true; otherwise presence of
* a resjunk column will always cause a 'false' result. * a resjunk column will always cause a 'false' result.
*/ */
static bool bool
tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK) tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
{ {
List *i; List *i;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: prep.h,v 1.32 2002/06/20 20:29:51 momjian Exp $ * $Id: prep.h,v 1.33 2002/08/29 16:03:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -43,4 +43,6 @@ extern Node *adjust_inherited_attrs(Node *node, ...@@ -43,4 +43,6 @@ extern Node *adjust_inherited_attrs(Node *node,
Index old_rt_index, Oid old_relid, Index old_rt_index, Oid old_relid,
Index new_rt_index, Oid new_relid); Index new_rt_index, Oid new_relid);
extern bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
#endif /* PREP_H */ #endif /* PREP_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment