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)
commit66d1413419daee92ac2b60a1f1e588d5e947a075
tree120506ecd45e8ee4f405a9af03f4c11f28ff5f68
parent00968e648dc03d81306b112f1ca0a95bbe0f29a7
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