Re: Support loser tree for k-way merge

Поиск
Список
Период
Сортировка
От cca5507
Тема Re: Support loser tree for k-way merge
Дата
Msg-id tencent_DCD98184361486D41AA430C8B0E0691D740A@qq.com
обсуждение исходный текст
Ответ на Re: Support loser tree for k-way merge  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: Support loser tree for k-way merge
Список pgsql-hackers
Hi Heikki,

> What is the worst case scenario for the loser tree, where the heap is 
> faster? How big is the difference?

In tuplesort_heap_replace_top(), it has 2 comparisons each level, but it can early return
if the parent less than both child.

In tuplesort_loser_tree_adjust(), it has 1 comparison each level, but it can't early return.

So on specific data, the heap may be better than the loser tree. But I think the possibility
is very small.

--
Regards,
ChangAo Chen

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