Slow performance on MAX(primary_key)

Поиск
Список
Период
Сортировка
От Keith Gray
Тема Slow performance on MAX(primary_key)
Дата
Msg-id 3DABA146.7010902@heart.com.au
обсуждение исходный текст
Ответы Re: Slow performance on MAX(primary_key)  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Список pgsql-sql
Help,

I have just been comparing some large table performance
under 7.1 using the
select max(primary key)from table;

We are using this for various functions including sequence.


It is taking 9 seconds to return this from around 1 million records.
Shouldn't this be an instantaneous lookup?

-- 

Keith Gray
Technical Services Manager
Heart Consulting Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Stored procedure returning row or resultset
Следующее
От: Brian Blaha
Дата:
Сообщение: SQL function triggers