Re: PoC: Partial sort

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Re: PoC: Partial sort
Дата
Msg-id 52B24808.6090704@proxel.se
обсуждение исходный текст
Ответ на Re: PoC: Partial sort  (Alexander Korotkov <aekorotkov@gmail.com>)
Список pgsql-hackers
On 12/18/2013 01:02 PM, Alexander Korotkov wrote:
>     My idea for a solution was to modify tuplesort to allow storing the
>     already sorted keys in either memtuples or the sort result file, but
>     setting a field so it does not sort thee already sorted tuples
>     again. This would allow the rescan to work as it used to, but I am
>     unsure how clean or ugly this code would be. Was this something you
>     considered?
>
>
> I'm not sure. I believe that best answer depends on particular
> parameter: how much memory we've for sort, how expensive is underlying
> node and how it performs rescan, how big are groups in partial sort.

Yes, if one does not need a rescan your solution will use less memory 
and about the same amount of CPU (if the tuplesort does not spill to 
disk). While if we keep all the already sorted tuples in the tuplesort 
rescans will be cheap but more memory will be used with an increased 
chance of spilling to disk.

-- 
Andreas Karlsson



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

Предыдущее
От: Cédric Villemain
Дата:
Сообщение: Re: pg_rewarm status
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_rewarm status