mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
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.
This commit is contained in:
@@ -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
|
||||
@@ -811,6 +811,20 @@ is_pseudo_constant_clause(Node *clause)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user