Re: "micro bucket sort" ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "micro bucket sort" ...
Дата
Msg-id 6261.1281540785@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "micro bucket sort" ...  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Hans-Jürgen Schönig's message of mié ago 11 08:21:10 -0400 2010:
>> test=# explain analyze select * from t_test order by x, y limit 20;

> But if you put the limit in a subquery which is ordered by the
> known-indexed condition, it is very fast:

> alvherre=# explain analyze select * from (select * from t_test order by x limit 20) f order by x, y;

That's not guaranteed to give you the right 20 rows, though.  Consider
the case where there are > 20 rows having the minimal x value.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: MERGE command for inheritance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Regression tests versus the buildfarm environment