Modify planner's implied-equality-deduction code so that when a set
authorTom Lane
Fri, 24 Jan 2003 03:58:44 +0000 (03:58 +0000)
committerTom Lane
Fri, 24 Jan 2003 03:58:44 +0000 (03:58 +0000)
commitf5e83662d06a40f90ceb3516fc88674eb6c1e4f9
tree5b682c9bcbc9dd88b7bcc19f1ca1bf43c8335a83
parentef7422510e93266e5aa9bb926d6747d5f2ae21f4
Modify planner's implied-equality-deduction code so that when a set
of known-equal expressions includes any constant expressions (including
Params from outer queries), we actively suppress any 'var = var'
clauses that are or could be deduced from the set, generating only the
deducible 'var = const' clauses instead.  The idea here is to push down
the restrictions implied by the equality set to base relations whenever
possible.  Once we have applied the 'var = const' clauses, the 'var = var'
clauses are redundant, and should be suppressed both to save work at
execution and to avoid double-counting restrictivity.
12 files changed:
src/backend/nodes/list.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/pathkeys.c
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/util/joininfo.c
src/backend/optimizer/util/relnode.c
src/backend/optimizer/util/restrictinfo.c
src/backend/utils/adt/selfuncs.c
src/include/nodes/pg_list.h
src/include/optimizer/joininfo.h
src/include/optimizer/paths.h
src/include/optimizer/planmain.h