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:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-03-24 21:53:04 +0000
commitfd791e7b5a1bf53131ad15e68e4d4f8ca795fcb4 (patch)
tree4fbde4ad7311749be170edf100dac55fa464c7f3 /src/backend/optimizer/path/joinpath.c
parent2a346725bafbc6c7a5dd1771c6004703545a935c (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..3e646d10325 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.116 2008/03/24 21:53:03 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 */
/*