summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/joinpath.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-03-24 21:53:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-03-24 21:53:12 +0000
commit6644be6ece53df7b3c71cc65c7c3d406bdf5a95a (patch)
tree58ec2d2a5e9bb5d2ba6c08d6dd7320857579456f /src/backend/optimizer/path/joinpath.c
parent63995f01edcf0101ea2efa751fb999cb6f5d853f (diff)
When a relation has been proven empty by constraint exclusion, propagate that
knowledge up through any joins it participates in. We were doing that already in some special cases but not in the general case. Also, defend against zero row estimates for the input relations in cost_mergejoin --- this fix may have eliminated the only scenario in which that can happen, but be safe. Per report from Alex Solovey.
Diffstat (limited to 'src/backend/optimizer/path/joinpath.c')
-rw-r--r--src/backend/optimizer/path/joinpath.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index d5e2506d7a0..b26d2077e6f 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.115 2008/01/09 20:42:27 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.115.2.1 2008/03/24 21:53:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -837,11 +837,9 @@ best_appendrel_indexscan(PlannerInfo *root, RelOptInfo *rel,
/*
* Check to see if child was rejected by constraint exclusion. If so,
- * it will have a cheapest_total_path that's an Append path with no
- * members (see set_plain_rel_pathlist).
+ * it will have a cheapest_total_path that's a "dummy" path.
*/
- if (IsA(childrel->cheapest_total_path, AppendPath) &&
- ((AppendPath *) childrel->cheapest_total_path)->subpaths == NIL)
+ if (IS_DUMMY_PATH(childrel->cheapest_total_path))
continue; /* OK, we can ignore it */
/*