mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Implement SEMI and ANTI joins in the planner and executor. (Semijoins replace
the old JOIN_IN code, but antijoins are new functionality.) Teach the planner to convert appropriate EXISTS and NOT EXISTS subqueries into semi and anti joins respectively. Also, LEFT JOINs with suitable upper-level IS NULL filters are recognized as being anti joins. Unify the InClauseInfo and OuterJoinInfo infrastructure into "SpecialJoinInfo". With that change, it becomes possible to associate a SpecialJoinInfo with every join attempt, which permits some cleanup of join selectivity estimation. That needs to be taken much further than this patch does, but the next step is to change the API for oprjoin selectivity functions, which seems like material for a separate patch. So for the moment the output size estimates for semi and especially anti joins are quite bogus.
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.60 2008/03/18 22:04:14 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/prep.h,v 1.61 2008/08/14 18:48:00 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -21,7 +21,7 @@
|
||||
/*
|
||||
* prototypes for prepjointree.c
|
||||
*/
|
||||
extern Node *pull_up_IN_clauses(PlannerInfo *root, Node *node);
|
||||
extern Node *pull_up_sublinks(PlannerInfo *root, Node *node);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user