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>
Re: Inoptimal query plan for max() and multicolumn index "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: Inoptimal query plan for max() and multicolumn index Vladimir Kulev <me@lightoze.net>
Re: Inoptimal query plan for max() and multicolumn index "F. BROUARD / SQLpro" <sqlpro@club-internet.fr>
Re: Inoptimal query plan for max() and multicolumn index Gaetano Mendola <mendola@gmail.com>
Re: Inoptimal query plan for max() and multicolumn index Gaetano Mendola <mendola@gmail.com>
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
Дата:
От: jesper@krogh.cc
Дата:
FAQ