Re: Cross-column statistics revisited

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cross-column statistics revisited
Дата
Msg-id 17221.1224177630@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Cross-column statistics revisited  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Cross-column statistics revisited  (Greg Stark <greg.stark@enterprisedb.com>)
Re: Cross-column statistics revisited  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> I think you need to go a step back: how are you going to use this data?

The fundamental issue as the planner sees it is not having to assume
independence of WHERE clauses.  For instance, given
WHERE a < 5 AND b > 10

our current approach is to estimate the fraction of rows with a < 5
(using stats for a), likewise estimate the fraction with b > 10
(using stats for b), and then multiply these fractions together.
This is correct if a and b are independent, but can be very bad if
they aren't.  So if we had joint statistics on a and b, we'd want to
somehow match that up to clauses for a and b and properly derive
the joint probability.

(I'm not certain of how to do that efficiently, even if we had the
right stats :-()
        regards, tom lane


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Cross-column statistics revisited
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Cross-column statistics revisited