Fix cost_mergejoin's failure to adjust for rescanning of non-unique merge join
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 6 Feb 2009 23:43:24 +0000 (23:43 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 6 Feb 2009 23:43:24 +0000 (23:43 +0000)
commitc473d923515e03fe5fd43c2ca15d52363a93f488
treeca1de3f8f20beb73fbd244f9f24e0e1fd7a3ca22
parentc87c31f10bfd77234b62175f03b9ae8a6f961411
Fix cost_mergejoin's failure to adjust for rescanning of non-unique merge join
keys when considering a semi or anti join.  This requires estimating the
selectivity of the merge qual as though it were a regular inner join condition.
To allow caching both that and the real outer-join-aware selectivity, split
RestrictInfo.this_selec into two fields.

This fixes one of the problems reported by Kevin Grittner.
src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c
src/backend/optimizer/path/clausesel.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/restrictinfo.c
src/include/nodes/relation.h