Re: tuple radix sort

zengman <zengman@halodbtech.com>

From: zengman <zengman@halodbtech.com>
To: John Naylor <johncnaylorls@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-11T10:25:07Z
Lists: pgsql-hackers
>I did some more self-review after a couple weeks and made some more
>minor cosmetic adjustments for v7. I will commit 0001 and 0002 in a
>few days unless there are objections.

Hi John,

I'm wondering if we should replace `state->memtuples` with `data` in the `sort_byvalue_datum()` function here.
```
	if (nulls_first)
	{
		null_start = state->memtuples;
		null_count = d1;
		not_null_start = state->memtuples + d1;
		not_null_count = d2;
	}
	else
	{
		not_null_start = state->memtuples;
		not_null_count = d1;
		null_start = state->memtuples + d1;
		null_count = d2;
	}
```
If my understanding is wrong, please ignore this.

--
regards,
Man Zeng

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Cosmetic fixes for radix sort

  2. Skip common prefixes during radix sort

  3. Perform radix sort on SortTuples with pass-by-value Datums

  4. Grab the low-hanging fruit from forcing sizeof(Datum) to 8.

  5. Add missing Datum conversions