Seqscan in MAX(index_column)

Поиск
Список
Период
Сортировка
От Paulo Scardine
Тема Seqscan in MAX(index_column)
Дата
Msg-id 008a01c372f1$55f65e40$6301a8c0@Administrador
обсуждение исходный текст
Ответ на database corruption  (Joe Conway <mail@joeconway.com>)
Ответы Re: Seqscan in MAX(index_column)  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Список pgsql-hackers
(Perhaps a newbie question, but I tried to google this out without success).

Why postgres does an expensive seqscan to find the max(value) for an indexed
column? I think MAX() does not know or cares if a column is indexed, but...
Should not it? BTW, is there some smarter trick to do that?

I know I can just do a very fast (SELECT pk FROM foo ORDER BY pk DESC LIMIT
1) instead, but my coleagues are arguing that MAX(indexed_column) seems to
be a lot
more smarter in MS-SQLServer and I end up without a good response.

Thank you,
--
Paulo Scardine
Brazil




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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Potential bug in ALTER TABLE?
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: Seqscan in MAX(index_column)