Rethink the order of expression preprocessing: eval_const_expressions
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 28 Mar 2005 00:58:26 +0000 (00:58 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 28 Mar 2005 00:58:26 +0000 (00:58 +0000)
commit5db2e83852cc3f25fdea48c4aa0da8696c88a826
tree1b6db39b1a6af12052bb93f1a7892a46a0a504d7
parentbf3dbb5881e9b886ee9fe84bca2153c698eea885
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.
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepqual.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/restrictinfo.c
src/backend/utils/cache/relcache.c
src/include/optimizer/prep.h