Re: select max(column) not using index

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB SD
Тема Re: select max(column) not using index
Дата
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961D7E@m0114.s-mxs.net
обсуждение исходный текст
Ответ на select max(column) not using index  (Thomas Zehetbauer <thomasz@hostmaster.org>)
Список pgsql-hackers
> select max(foo) from bar where x = 'y';
>
> How is the index used in this query?

Informix would use an index created on (x, foo) and I guess others too.

But I too usually find the "select first 1 * from y order by x desc" much more
useful than an optimized max, since it can also return other columns from that row
(And is more performant than an optimally optimized subselect for this).

Andreas


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] Bug #613: Sequence values fall back to previously chec kpointed
Следующее
От: mlw
Дата:
Сообщение: Re: Transaction on start of session ?