Re: How to speed up min/max(id) in 50M rows table?

Поиск
Список
Период
Сортировка
От henk de wit
Тема Re: How to speed up min/max(id) in 50M rows table?
Дата
Msg-id BAY124-W50228E83905C05AA18AF57F5A00@phx.gbl
обсуждение исходный текст
Ответ на How to speed up min/max(id) in 50M rows table?  (henk de wit <henk53602@hotmail.com>)
Ответы Re: How to speed up min/max(id) in 50M rows table?  (Alan Hodgson <ahodgson@simkin.ca>)
Список pgsql-performance
> select payment_id from transactions order by payment_id desc limit 1;

This one is indeed instant! Less than 50ms. In my case I can't use it for max though because of the fact that payment_id can be null (which is an unfortunate design choice). The other variant however didn't become instant. I.e. I tried:

select time from transactions where payment_id = 67 order by time asc limit 1;

But this one is still really slow.

Regards





Express yourself instantly with MSN Messenger! MSN Messenger

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

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: Huge amount of memory consumed during transaction
Следующее
От: henk de wit
Дата:
Сообщение: Re: Huge amount of memory consumed during transaction