diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-14 18:48:00 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-14 18:48:00 +0000 |
| commit | e006a24ad152b3faec748afe8c1ff0829699b2e6 (patch) | |
| tree | d00e01d25270b4b04aac3c723b9e440a56d8a085 /src/include/optimizer/pathnode.h | |
| parent | ef1c807c25b47960aa86cd185fb74371e88d0cbf (diff) | |
| download | postgresql-e006a24ad152b3faec748afe8c1ff0829699b2e6.tar.gz | |
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.
Diffstat (limited to 'src/include/optimizer/pathnode.h')
| -rw-r--r-- | src/include/optimizer/pathnode.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index c5a1f93c34..1db1674e12 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.h @@ -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/pathnode.h,v 1.77 2008/01/01 19:45:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/pathnode.h,v 1.78 2008/08/14 18:48:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -50,7 +50,7 @@ extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths); extern ResultPath *create_result_path(List *quals); extern MaterialPath *create_material_path(RelOptInfo *rel, Path *subpath); extern UniquePath *create_unique_path(PlannerInfo *root, RelOptInfo *rel, - Path *subpath); + Path *subpath, SpecialJoinInfo *sjinfo); extern Path *create_subqueryscan_path(RelOptInfo *rel, List *pathkeys); extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel); @@ -58,6 +58,7 @@ extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel); extern NestPath *create_nestloop_path(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, + SpecialJoinInfo *sjinfo, Path *outer_path, Path *inner_path, List *restrict_clauses, @@ -66,6 +67,7 @@ extern NestPath *create_nestloop_path(PlannerInfo *root, extern MergePath *create_mergejoin_path(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, + SpecialJoinInfo *sjinfo, Path *outer_path, Path *inner_path, List *restrict_clauses, @@ -77,6 +79,7 @@ extern MergePath *create_mergejoin_path(PlannerInfo *root, extern HashPath *create_hashjoin_path(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, + SpecialJoinInfo *sjinfo, Path *outer_path, Path *inner_path, List *restrict_clauses, @@ -93,7 +96,7 @@ extern RelOptInfo *build_join_rel(PlannerInfo *root, Relids joinrelids, RelOptInfo *outer_rel, RelOptInfo *inner_rel, - JoinType jointype, + SpecialJoinInfo *sjinfo, List **restrictlist_ptr); #endif /* PATHNODE_H */ |
