1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Rethink the order of expression preprocessing: eval_const_expressions

really ought to run before canonicalize_qual, because it can now produce
forms that canonicalize_qual knows how to improve (eg, NOT clauses).
Also, because eval_const_expressions already knows about flattening
nested ANDs and ORs into N-argument form, the initial flatten_andors
pass in canonicalize_qual is now completely redundant and can be
removed.  This doesn't save a whole lot of code, but the time and
palloc traffic eliminated is a useful gain on large expression trees.
This commit is contained in:
Tom Lane
2005-03-28 00:58:26 +00:00
parent bf3dbb5881
commit 5db2e83852
7 changed files with 61 additions and 140 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.171 2005/03/27 06:29:36 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.172 2005/03/28 00:58:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -750,8 +750,8 @@ check_partial_indexes(Query *root, RelOptInfo *rel)
* that the given predicate is true.
*
* The top-level List structure of each list corresponds to an AND list.
* We assume that canonicalize_qual() has been applied and so there are
* no un-flattened ANDs or ORs (e.g., no AND immediately within an AND,
* We assume that eval_const_expressions() has been applied and so there
* are no un-flattened ANDs or ORs (e.g., no AND immediately within an AND,
* including AND just below the top-level List structure).
* If this is not true we might fail to prove an implication that is
* valid, but no worse consequences will ensue.