Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics
Дата
Msg-id 878wxc2wlv.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <stark@enterprisedb.com> writes:
>> It's possible that the second option I described -- teaching Append when to
>> use something other than sum() -- would only work in the cases where
>> constraint exclusion could be fixed though. In which case having fractional
>> row counts might actually be necessary. 
>
> The above is just armwaving.  IMHO, if you don't understand the
> structure of the table set then you're not going to be able to get the
> desired behavior via fractional rowcounts either.

That's only a specific subset of cases. You could just as easily have quals
which are only coincidentally related to the partition key or even not related
at all, just very selective and produce no records from some partitions.

The bottom line is that if you have a large table our statistics do a good job
estimating the selectivity of a where clause with the minimum clamped to 1. If
you partition it into 100 partitions then the minimum is clamped to 100.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production
Tuning


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: B-tree "finish incomplete split" bug
Следующее
От: "billy"
Дата:
Сообщение: why copy tuple in the end of trigger when nothing changed in NEW OLD record variable