diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-14 23:54:36 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-14 23:54:36 +0000 |
commit | 659d3b2b0ecda0726957c106522f9cbd477cf4ee (patch) | |
tree | 5b657add3a305c0e931021eb03c5d10ea42621c7 /src/include | |
parent | c42d63335211852d6253b4240cb69ed84d0f1d0f (diff) | |
download | postgresql-659d3b2b0ecda0726957c106522f9cbd477cf4ee.tar.gz postgresql-659d3b2b0ecda0726957c106522f9cbd477cf4ee.zip |
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/include')
-rw-r--r-- | src/include/nodes/relation.h | 9 | ||||
-rw-r--r-- | src/include/optimizer/restrictinfo.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 01aa96d7171..c40c2b6c62c 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.119 2005/10/15 02:49:45 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.119.2.1 2005/11/14 23:54:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -714,6 +714,11 @@ typedef struct HashPath * joined, will also have is_pushed_down set because it will get attached to * some lower joinrel. * + * When application of a qual must be delayed by outer join, we also mark it + * with outerjoin_delayed = true. This isn't redundant with required_relids + * because that might equal clause_relids whether or not it's an outer-join + * clause. + * * In general, the referenced clause might be arbitrarily complex. The * kinds of clauses we can handle as indexscan quals, mergejoin clauses, * or hashjoin clauses are fairly limited --- the code for each kind of @@ -740,6 +745,8 @@ typedef struct RestrictInfo bool is_pushed_down; /* TRUE if clause was pushed down in level */ + bool outerjoin_delayed; /* TRUE if delayed by outer join */ + /* * This flag is set true if the clause looks potentially useful as a merge * or hash join clause, that is if it is a binary opclause with diff --git a/src/include/optimizer/restrictinfo.h b/src/include/optimizer/restrictinfo.h index 0715df59d68..e19b5a67627 100644 --- a/src/include/optimizer/restrictinfo.h +++ b/src/include/optimizer/restrictinfo.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/restrictinfo.h,v 1.34 2005/10/15 02:49:45 momjian Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/restrictinfo.h,v 1.34.2.1 2005/11/14 23:54:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,6 +19,7 @@ extern RestrictInfo *make_restrictinfo(Expr *clause, bool is_pushed_down, + bool outerjoin_delayed, Relids required_relids); extern List *make_restrictinfo_from_bitmapqual(Path *bitmapqual, bool is_pushed_down, |