mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
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?)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user