From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@postgresql.org
Cc: casey.shobe@messagesystems.com
Subject: Re: Botched estimation in eqjoinsel_semi for cases without reliable ndistinct
Date: Wed, 11 Jan 2012 19:01:01 -0500
Message-ID: <29570.1326326461@sss.pgh.pa.us> (raw)
In-Reply-To: <201201112110.40403.andres@anarazel.de>
References: <201201112110.40403.andres@anarazel.de>
Andres Freund <andres@anarazel.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, casey.shobe@messagesystems.com
Subject: Re: Botched estimation in eqjoinsel_semi for cases without reliable ndistinct
In-Reply-To: <29570.1326326461@sss.pgh.pa.us>
References: <201201112110.40403.andres@anarazel.de> <29570.1326326461@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox