Re: max/min and index usage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: max/min and index usage
Дата
Msg-id 17474.1165375793@sss.pgh.pa.us
обсуждение исходный текст
Ответ на max/min and index usage  (Tobias Brox <tobias@nordicbet.com>)
Ответы Re: max/min and index usage  (Tobias Brox <tobias@nordicbet.com>)
Список pgsql-performance
Tobias Brox <tobias@nordicbet.com> writes:
> We're using 8.1 - I thought such a construct was safe in pg 8.1:
>  select max(indexed_value) from huge_table;
> while earlier we had to use:
>  select indexed_value from huge_table order by indexed_value desc limit 1;

These are not actually exactly the same thing.  In particular, I suppose
your table contains a lot of nulls?

            regards, tom lane

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

Предыдущее
От: Tobias Brox
Дата:
Сообщение: Re: max/min and index usage
Следующее
От: Tobias Brox
Дата:
Сообщение: Re: max/min and index usage