Clean up optimizer's handling of indexscan quals that need to be
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Aug 1999 04:32:54 +0000 (04:32 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Aug 1999 04:32:54 +0000 (04:32 +0000)
commit8f9f6e51a8ad47da466a62be66474ef5358403c0
treecb7c1f434efcf5cc79dd711496e5c0ab12444127
parentaae034d28c98eee5fbd37d27234d3e825c53b91e
Clean up optimizer's handling of indexscan quals that need to be
commuted (ie, the index var appears on the right).  These are now handled
the same way as merge and hash join quals that need to be commuted: the
actual reversing of the clause only happens if we actually choose the path
and generate a plan from it.  Furthermore, the clause is only reversed in
the 'indexqual' field of the plan, not in the 'indxqualorig' field.  This
allows the clause to still be recognized and removed from qpquals of upper
level join plans.  Also, simplify and generalize match_clause_to_indexkey;
now it recognizes binary-compatible indexes for join as well as restriction
clauses.
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/util/clauses.c
src/include/optimizer/clauses.h