summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/joinpath.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-02-04 23:03:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-02-04 23:03:20 +0000
commit3893127431b41a3341ac5ff9611c7ea0215b9110 (patch)
tree7d15367f9f19df8f39b1b5c00b4c33aaed1025d7 /src/backend/optimizer/path/joinpath.c
parent48d9ad372251d188bcb0a733e875018a5f1f3503 (diff)
Fix constraint exclusion to work in inherited UPDATE/DELETE queries
... in fact, it will be applied now in any query whatsoever. I'm still a bit concerned about the cycles that might be expended in failed proof attempts, but given that CE is turned off by default, it's the user's choice whether to expend those cycles or not. (Possibly we should change the simple bool constraint_exclusion parameter to something more fine-grained?)
Diffstat (limited to 'src/backend/optimizer/path/joinpath.c')
-rw-r--r--src/backend/optimizer/path/joinpath.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index df3bd128747..450bc26bed9 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.100 2006/02/03 21:08:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.101 2006/02/04 23:03:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -867,14 +867,13 @@ join_before_append(PlannerInfo *root,
Assert(childrel->reloptkind == RELOPT_OTHER_MEMBER_REL);
/*
- * If the child has no cheapest_total_path, assume it was deemed
- * excludable by constraint exclusion (see set_append_rel_pathlist).
+ * 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).
*/
- if (childrel->cheapest_total_path == NULL)
- {
- Assert(constraint_exclusion);
- continue;
- }
+ if (IsA(childrel->cheapest_total_path, AppendPath) &&
+ ((AppendPath *) childrel->cheapest_total_path)->subpaths == NIL)
+ continue; /* OK, we can ignore it */
/*
* Get the best innerjoin indexpath (if any) for this outer rel.