diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-14 23:54:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-14 23:54:23 +0000 |
commit | 1bdf124b94af3c24d3c3083c820804274df8262b (patch) | |
tree | 580185c38a9903dd1bb390d099719e781044d2de /src/backend/optimizer/path/orindxpath.c | |
parent | e93fb885ebbf4ecbafe3e16813dc47397eda84ea (diff) |
Restore the former RestrictInfo field valid_everywhere (but invert the flag
sense and rename to "outerjoin_delayed" to more clearly reflect what it
means). I had decided that it was redundant in 8.1, but the folly of this
is exposed by a bug report from Sebastian Böck. The place where it's
needed is to prevent orindxpath.c from cherry-picking arms of an outer-join
OR clause to form a relation restriction that isn't actually legal to push
down to the relation scan level. There may be some legal cases that this
forbids optimizing, but we'd need much closer analysis to determine it.
Diffstat (limited to 'src/backend/optimizer/path/orindxpath.c')
-rw-r--r-- | src/backend/optimizer/path/orindxpath.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/optimizer/path/orindxpath.c b/src/backend/optimizer/path/orindxpath.c index be5a0c3434f..10b12890dae 100644 --- a/src/backend/optimizer/path/orindxpath.c +++ b/src/backend/optimizer/path/orindxpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/orindxpath.c,v 1.75 2005/10/15 02:49:20 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/orindxpath.c,v 1.76 2005/11/14 23:54:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -90,13 +90,19 @@ create_or_index_quals(PlannerInfo *root, RelOptInfo *rel) ListCell *i; /* - * Find potentially interesting OR joinclauses. + * Find potentially interesting OR joinclauses. Note we must ignore any + * joinclauses that are marked outerjoin_delayed, because they cannot + * be pushed down to the per-relation level due to outer-join rules. + * (XXX in some cases it might be possible to allow this, but it would + * require substantially more bookkeeping about where the clause came + * from.) */ foreach(i, rel->joininfo) { RestrictInfo *rinfo = (RestrictInfo *) lfirst(i); - if (restriction_is_or_clause(rinfo)) + if (restriction_is_or_clause(rinfo) && + !rinfo->outerjoin_delayed) { /* * Use the generate_bitmap_or_paths() machinery to estimate the |