]> granicus.if.org Git - postgresql/commit
When estimating without benefit of MCV lists (suggesting that one or both
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Oct 2008 00:24:50 +0000 (00:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Oct 2008 00:24:50 +0000 (00:24 +0000)
commit7f3eba30c9d622d1981b1368f2d79ba0999cdff2
tree751f2ba4fcfbc42636ef3745397fa68378dc0b8f
parent31468d05d89d494de00156e66c3e57d6dff9c79f
When estimating without benefit of MCV lists (suggesting that one or both
inputs is unique or nearly so), make eqjoinsel() clamp the ndistinct estimates
to be not more than the estimated number of rows coming from the input
relations.  This allows the estimate to change in response to the selectivity
of restriction conditions on the inputs.

This is a pretty narrow patch and maybe we should be more aggressive about
similarly clamping ndistinct in other cases; but I'm worried about
double-counting the effects of the restriction conditions.  However, it seems
to help for the case exhibited by Grzegorz Jaskiewicz (antijoin against a
small subset of a relation), so let's try this for awhile.
src/backend/utils/adt/selfuncs.c