Andres Freund <andres(at)anarazel(dot)de> writes:
> Whats your opinion on this?
Looks pretty bogus to me. You're essentially assuming that the side of
the join without statistics is unique, which is a mighty dubious
assumption. (In cases where we *know* it's unique, something like this
could be reasonable, but I believe get_variable_numdistinct already
accounts for such cases.) The reason for the reversion to pre-8.4
behavior was that with the other behavior, we might sometimes make
extremely optimistic estimates (ie, conclude that the join result is
very small) on the basis of, really, nothing at all. AFAICS this
proposal just reintroduces unwarranted assumptions, and therefore will
probably produce as many worse results as better ones.
Also, why the asymmetry in null handling? And why did you only touch
one of the two code paths in eqjoinsel_semi? They have both got this
issue of how to estimate with inadequate stats.
regards, tom lane
In response to
pgsql-bugs by date
|Next:||From: Andres Freund||Date: 2012-01-12 00:40:34|
|Subject: Re: Botched estimation in eqjoinsel_semi for cases without reliable ndistinct|
|Previous:||From: Tom Lane||Date: 2012-01-11 23:24:05|
|Subject: Re: Weird message when creating PK constraint named like table |