diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-12-30 23:53:15 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-12-30 23:53:15 +0000 |
| commit | be6c38b9033c546e2a8a9fab4329b89be57a263b (patch) | |
| tree | 521c34b2c94d52614160a5582654751e089b226e /src/backend/optimizer/util/clauses.c | |
| parent | 5e545151671fa4ab3cf0e62ffd1e207609ad1517 (diff) | |
| download | postgresql-be6c38b9033c546e2a8a9fab4329b89be57a263b.tar.gz | |
Adjust the definition of RestrictInfo's left_relids and right_relids
fields: now they are valid whenever the clause is a binary opclause,
not only when it is a potential join clause (there is a new boolean
field canjoin to signal the latter condition). This lets us avoid
recomputing the relid sets over and over while examining indexes.
Still more work to do to make this as useful as it could be, because
there are places that could use the info but don't have access to the
RestrictInfo node.
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
| -rw-r--r-- | src/backend/optimizer/util/clauses.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index d6f0bb3ad2..35efa6bc63 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.157 2003/12/28 21:57:37 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.158 2003/12/30 23:53:15 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -812,6 +812,20 @@ is_pseudo_constant_clause(Node *clause) } /* + * is_pseudo_constant_clause_relids + * Same as above, except caller already has available the var membership + * of the clause; this lets us avoid the contain_var_clause() scan. + */ +bool +is_pseudo_constant_clause_relids(Node *clause, Relids relids) +{ + if (bms_is_empty(relids) && + !contain_volatile_functions(clause)) + return true; + return false; +} + +/* * pull_constant_clauses * Scan through a list of qualifications and separate "constant" quals * from those that are not. |
