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 6fa3b6e20806100851o5ebcbb3cice2e11d4dde5cd9d@mail.gmail.com
Whole thread Raw
In response to Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics  (Zeugswetter Andreas OSB sIT <Andreas.Zeugswetter@s-itsolutions.at>)
Responses Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics  (Jeff Davis <pgsql@j-davis.com>)
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
look at past queries
and keep track of how often they return empty result sets?

It seems that, in some ways, we care about the distribution of the
query values in addition to the column values...

>> > I think for low ndistinct values we will want to know the exact
>> > value + counts and not a bin. So I think we will want additional stats rows
>> > that represent "value 'a1' stats".
>>
>> Isn't that what our most frequent values list does?
>
> Maybe ? Do we have the relevant stats for each ?
> But the trick is to then exclude those values from the histogram bins.

Currently, the histogram is only made up of non-mcv values.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Timezone abbreviations - out but not in?
Next
From: Alvaro Herrera
Date:
Subject: Re: Timezone abbreviations - out but not in?