Fix cost_mergejoin's failure to adjust for rescanning of non-unique merge join
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/nodes/copyfuncs.c | modified | +3 −2 |
| src/backend/nodes/outfuncs.c | modified | +3 −2 |
| src/backend/optimizer/path/clausesel.c | modified | +24 −6 |
| src/backend/optimizer/path/costsize.c | modified | +33 −29 |
| src/backend/optimizer/path/equivclass.c | modified | +7 −4 |
| src/backend/optimizer/path/orindxpath.c | modified | +5 −4 |
| src/backend/optimizer/prep/prepunion.c | modified | +3 −2 |
| src/backend/optimizer/util/restrictinfo.c | modified | +3 −2 |
| src/include/nodes/relation.h | modified | +5 −2 |