Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics - Mailing list pgsql-hackers

From Nathan Boley
Subject Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics
Date
Msg-id 6fa3b6e20806101146m7c699be8qab6d74011435d051@mail.gmail.com
Whole thread Raw
In response to Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>> >> > One more problem with low ndistinct values is that the condition might very well
>> >> > hit no rows at all. But Idea 1 will largely overestimate the number of hits.
>>
>> Thats a good point, but I don't see a clear solution. Maybe we could
>
> I think that MCVs are the solution, right?

Only if they cover the entire range of values in the table.

> A low ndistinct means that those values will likely be MCVs.

Yes, but I don't think thats the point.

If we query on values that aren't in the table, the planner will
always overestimate the expected number of returned rows because it (
implicitly ) assumes that every query will return at least 1 record.


pgsql-hackers by date:

Previous
From: Ron Mayer
Date:
Subject: Re: Overhauling GUCS
Next
From: Tom Lane
Date:
Subject: Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics