Re: "micro bucket sort" ...

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: "micro bucket sort" ...
Дата
Msg-id AANLkTik2=Uo5uL4pHmXC6rcsZgXOfZHqp7=OjEesgoFX@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "micro bucket sort" ...  (PostgreSQL - Hans-Jürgen Schönig<postgres@cybertec.at>)
Список pgsql-hackers
2010/8/12 PostgreSQL - Hans-Jürgen Schönig <postgres@cybertec.at>:
> as tom pointed out - this is not possible.
> there is no limit 20 in my case - i just used it to indicate that limiting does not make the index scan possible
whichit does in some other cases. 

I came up with this:

explain analyze select * from (select * from t_test order by x limit
all)s order by x, y limit 20;

which uses index scan for column x and top-N heapsort for outer ORDER
BY, though it's slower than "ORDER BY x LIMIT 20" case. If it chooses
external sort for "ORDER BY x, y" LIMIT ALL  likely wins while looses
if quicksort is chosen.


Regards,


--
Hitoshi Harada


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Develop item from TODO list
Следующее
От: Robert Haas
Дата:
Сообщение: Re: patch: General purpose utility functions used by the JSON data type