Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL
Дата
Msg-id 3947.1300729241@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> So it's a clever hack that we used to allow the partial indexes to be
> used. It relied on the implicit assumption that min(x) and max(x)
> where the only values of x where NULL were both NULL.

> It would be nice if we were clever enough to support *any* strict
> aggregate using partial indexes on WHERE NOT NULL since they'll all
> have that property.

Huh?  The point of the min/max optimization is to not scan the whole
index but just fetch the endpoint value.  For general aggregates, you
have to scan the table anyway.  If an index is useful for that, it'll
get picked up in the normal planning process.
        regards, tom lane


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL
Следующее
От: Bernd Helmle
Дата:
Сообщение: psql \dt and table size