Re: Inoptimal query plan for max() and multicolumn index

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: Inoptimal query plan for max() and multicolumn index
Дата
Msg-id 4E1FE8D9.7040509@gmail.com
обсуждение исходный текст
Ответ на Inoptimal query plan for max() and multicolumn index  (Vladimir Kulev <me@lightoze.net>)
Список pgsql-performance
On 20/06/2011 07:35, Vladimir Kulev wrote:

> But this does not work:
> # explain analyze select max(timestamp) from sms where number in
> ('5502712','5802693','5801981');

Try to rewrite that query this way:

explain analyze select timestamp from sms where number in
('5502712','5802693','5801981') order by timestamp desc limit 1;


Regards
Gaetano Mendola



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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Hardware advice for scalable warehouse db
Следующее
От: jesper@krogh.cc
Дата:
Сообщение: Re: Hardware advice for scalable warehouse db