Re: tuple radix sort

From: cca5507 <cca5507(at)qq(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: zengman <zengman(at)halodbtech(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: tuple radix sort
Date: 2026-03-31 04:36:32
Message-ID: tencent_9748E2B51D64D949856216A6D59EA6BCC80A@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi John,

> This turned out to be a loser, but in the course of trying it a better
> idea occurred to me. v8's prefix detection was really a special-case
> optimization where the sort key is all non-negative integers (or all
> negative, but that's not common). It's wasted work when the input is
> mixed in sign, and for abbreviated keys. It's not much of a waste, but
> we can do better.
>
> v9 computes the common prefix during every recursion at the same time
> we populate the SortTuple's current byte. That should be practically
> free given a modest amount of instruction-level parallelism.

+1 and v9-0001 LGTM.

--
Regards,
ChangAo Chen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2026-03-31 06:01:41 Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?
Previous Message Peter Smith 2026-03-31 04:22:40 Re: Skipping schema changes in publication