Re: Support loser tree for k-way merge

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: cca5507 <cca5507(at)qq(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support loser tree for k-way merge
Date: 2025-12-03 12:23:53
Message-ID: 28f47336-84e2-445e-8216-d1ce7d3ddc3e@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/12/2025 13:48, cca5507 wrote:
> With the WIP patch(v1-0001), I got a 3% ~ 13%(different work_mem) speed up in the following test case:

Nice speedup!

> 1) Now I add a GUC 'enable_loser_tree' to control the use of loser tree, maybe we should
> decide whether to use the 'loser tree' based on the value of 'k', the complexity of tuple
> comparators or just always use the 'loser tree'?

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

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-12-03 12:27:06 RE: Using MyDatabaseId in SET_LOCKTAG_APPLY_TRANSACTION
Previous Message Heikki Linnakangas 2025-12-03 12:04:11 Re: POC: make mxidoff 64 bits