diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/nodes/relation.h | 15 | ||||
-rw-r--r-- | src/include/optimizer/restrictinfo.h | 9 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 3d4b9ddcf8c..b5cde02b8c9 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.154.2.3 2008/12/01 21:06:20 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.154.2.4 2009/04/16 20:42:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -897,8 +897,14 @@ typedef struct HashPath * * RestrictInfo nodes also contain an outerjoin_delayed flag, which is true * if the clause's applicability must be delayed due to any outer joins - * appearing below its own syntactic level (ie, it references any Vars from - * the nullable side of any lower outer join). + * appearing below it (ie, it has to be postponed to some join level higher + * than the set of relations it actually references). There is also a + * nullable_relids field, which is the set of rels it references that can be + * forced null by some outer join below the clause. outerjoin_delayed = true + * is subtly different from nullable_relids != NULL: a clause might reference + * some nullable rels and yet not be outerjoin_delayed because it also + * references all the other rels of the outer join(s). A clause that is not + * outerjoin_delayed can be enforced anywhere it is computable. * * In general, the referenced clause might be arbitrarily complex. The * kinds of clauses we can handle as indexscan quals, mergejoin clauses, @@ -960,6 +966,9 @@ typedef struct RestrictInfo /* The set of relids required to evaluate the clause: */ Relids required_relids; + /* The relids used in the clause that are nullable by lower outer joins: */ + Relids nullable_relids; + /* These fields are set for any binary opclause: */ Relids left_relids; /* relids in left side of clause */ Relids right_relids; /* relids in right side of clause */ diff --git a/src/include/optimizer/restrictinfo.h b/src/include/optimizer/restrictinfo.h index fe26489353f..06bb8fe8868 100644 --- a/src/include/optimizer/restrictinfo.h +++ b/src/include/optimizer/restrictinfo.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/restrictinfo.h,v 1.41 2008/01/01 19:45:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/restrictinfo.h,v 1.41.2.1 2009/04/16 20:42:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,11 +17,16 @@ #include "nodes/relation.h" +/* Convenience macro for the common case of a valid-everywhere qual */ +#define make_simple_restrictinfo(clause) \ + make_restrictinfo(clause, true, false, false, NULL, NULL) + extern RestrictInfo *make_restrictinfo(Expr *clause, bool is_pushed_down, bool outerjoin_delayed, bool pseudoconstant, - Relids required_relids); + Relids required_relids, + Relids nullable_relids); extern List *make_restrictinfo_from_bitmapqual(Path *bitmapqual, bool is_pushed_down, bool include_predicates); |