Re: Improve selectivity estimate for range queries - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Improve selectivity estimate for range queries
Date
Msg-id CA+Tgmoa7RBEsfv+n+tm6CpKU365Bv1=a_Z+W6VvCo6jdt-oJrA@mail.gmail.com
Whole thread Raw
In response to Re: Improve selectivity estimate for range queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Improve selectivity estimate for range queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Dec 21, 2018 at 11:50 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> A smaller-footprint way to fix the immediate problem might be to
> change the values of DEFAULT_INEQ_SEL and friends so that they're
> even less likely to be matched by accident.  That is, instead of
> 0.3333333333333333, use 0.333333333333342 or some such.  It might
> seem that that's just moving the problem around, but I think it
> might be possible to show that such a value couldn't be computed
> by scalarltsel given a histogram with no more than 10000 members.
> (I haven't tried to actually prove that, but it seems intuitive
> that the set of possible results would be quantized with no more
> than about 5 digits precision.

That's not a dumb idea, but it seems pretty unprincipled to me, and to
be honest I'm kind of surprised that you're not proposing something
cleaner.  If you admit the need to distinguish between real estimates
and last-ditch ones, why shouldn't we have an explicit representation
of that rather than trying to pick a last-ditch value that is unlikely
to be confused with a real one?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Commitfest delayed: extend it?
Next
From: Robert Haas
Date:
Subject: Re: add_partial_path() may remove dominated path but still in use