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-02-13 03:25:17
Message-ID: tencent_0A6A072C7636A1238520B50E29D332627808@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi John,

One additional comment:

```
/* presorted check */
for (SortTuple *st = data + 1; st < data + n; st++)
{
CHECK_FOR_INTERRUPTS();

if (COMPARETUP(state, st - 1, st) > 0)
{
presorted = false;
break;
}
}
if (presorted)
return;
```

I think we need to add a comment to explain why we do the
check. The cost of this check is not small.

--
Regards,
ChangAo Chen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-02-13 04:07:00 Re: Our ABI diff infrastructure ignores enum SysCacheIdentifier
Previous Message Michael Paquier 2026-02-13 03:18:32 Re: Fix wrong log in pgstat_report_checksum_failures_in_db()