Re: Limit + group + join

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Limit + group + join
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3417DD1F1@Herge.rcsinc.local
обсуждение исходный текст
Ответ на Limit + group + join  (Tobias Brox <tobias@nordicbet.com>)
Список pgsql-performance
Mark Kirkwood
> > The 'desc' seems to be the guy triggering the sort, e.g:
>
> Oh; really an accident that I didn't notice myself, I was actually
going
> to
> remove all instances of "desc" in my simplification, but seems like I
> forgot.

If desc is the problem you can push the query into a subquery without
sorting and sort the result.  This is called an inline view.  Sometimes
you can pull a couple of tricks to force the view to materialize before
it is sorted.

aka
select q.*
from
(
   some_complex_query
) q order by ...;

Merlin

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

Предыдущее
От: Alan Stange
Дата:
Сообщение: difference in plan between 8.0 and 8.1?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: difference in plan between 8.0 and 8.1?