mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Improve sublink pullup code to handle ANY/EXISTS sublinks that are at top
level of a JOIN/ON clause, not only at top level of WHERE. (However, we can't do this in an outer join's ON clause, unless the ANY/EXISTS refers only to the nullable side of the outer join, so that it can effectively be pushed down into the nullable side.) Per request from Kevin Grittner. In passing, fix a bug in the initial implementation of EXISTS pullup: it would Assert if the EXIST's WHERE clause used a join alias variable. Since we haven't yet flattened join aliases when this transformation happens, it's necessary to include join relids in the computed set of RHS relids.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/prep.h,v 1.61 2008/08/14 18:48:00 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/prep.h,v 1.62 2008/08/17 01:20:00 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -21,12 +21,12 @@
|
||||
/*
|
||||
* prototypes for prepjointree.c
|
||||
*/
|
||||
extern Node *pull_up_sublinks(PlannerInfo *root, Node *node);
|
||||
extern void pull_up_sublinks(PlannerInfo *root);
|
||||
extern void inline_set_returning_functions(PlannerInfo *root);
|
||||
extern Node *pull_up_subqueries(PlannerInfo *root, Node *jtnode,
|
||||
bool below_outer_join, bool append_rel_member);
|
||||
extern void reduce_outer_joins(PlannerInfo *root);
|
||||
extern Relids get_relids_in_jointree(Node *jtnode);
|
||||
extern Relids get_relids_in_jointree(Node *jtnode, bool include_joins);
|
||||
extern Relids get_relids_for_join(PlannerInfo *root, int joinrelid);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user