public inbox for [email protected]
help / color / mirror / Atom feedFrom: =?utf-8?B?Y2NhNTUwNw==?= <[email protected]>
To: =?utf-8?B?SGVpa2tpIExpbm5ha2FuZ2Fz?= <[email protected]>
To: =?utf-8?B?cGdzcWwtaGFja2Vycw==?= <[email protected]>
Subject: Re: Support loser tree for k-way merge
Date: Wed, 3 Dec 2025 20:59:13 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
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
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Support loser tree for k-way merge
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox