public inbox for [email protected]  
help / color / mirror / Atom feed
From: =?utf-8?B?Y2NhNTUwNw==?= <[email protected]>
To: =?utf-8?B?Sm9obiBOYXlsb3I=?= <[email protected]>
Cc: =?utf-8?B?emVuZ21hbg==?= <[email protected]>
Cc: =?utf-8?B?cGdzcWwtaGFja2Vycw==?= <[email protected]>
Subject: Re: tuple radix sort
Date: Wed, 1 Apr 2026 17:27:13 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANWCAZacXFMeG=afHF+3rxuyr3=0UcdNgxO8wTZ58fOzvyhwNw@mail.gmail.com>
References: <CANWCAZYzx7a7E9AY16Jt_U3+GVKDADfgApZ-42SYNiig8dTnFA@mail.gmail.com>
	<CANWCAZbsx5VY-F5RVvZ5H1abBWcinMY90gNra6EbdGS1CTx=7g@mail.gmail.com>
	<CANWCAZaN8kW6o7Ymc_jzPO_Z5SqekQTTNra3xTGYTH+cjrVp8g@mail.gmail.com>
	<[email protected]>
	<CANWCAZZiMGj6QuHfyBPv9at7xn23NPAz4nit=G6fr26V+h8MKg@mail.gmail.com>
	<[email protected]>
	<CANWCAZaKRzsYPn9YWRR8g5dkX-ep_jgyUb4r3KFekK5ZTNo7ew@mail.gmail.com>
	<[email protected]>
	<CANWCAZaBeDPfF0sCdSssRXv6nBZeRP8Z=OO1731zsoUC58U5_Q@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CANWCAZZo5rgE4+NYYES1hLN9PvonXMH=K3Z7b0TKcCBNOAjaag@mail.gmail.com>
	<[email protected]>
	<CANWCAZYur4VDbx9zkpFM3mM4-Hj4_Vt1t=Z4TPhK7+3=T6BMOA@mail.gmail.com>
	<[email protected]>
	<CANWCAZYBgHCpS-w5E8+wJpfhwLK88Kys-5ukSta2gj4BRPiTSg@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CANWCAZZA_AqWy7xw20O=jWG+t0Cy4rUnvs1RaAABvSp3iLnGhg@mail.gmail.com>
	<[email protected]>
	<CANWCAZaWV09=HdiF9mm7CBggFvxGkkHhhkSqyFoochQzW=RxAA@mail.gmail.com>
	<CANWCAZZuQPMAPoCUQo7E2v2Zk5z9T=8bE=VGpC8_TYG3aomGyQ@mail.gmail.com>
	<[email protected]>
	<CANWCAZacXFMeG=afHF+3rxuyr3=0UcdNgxO8wTZ58fOzvyhwNw@mail.gmail.com>

Hi John,

How about adding an assertion here:

```
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 72c2c2995d8..bcc534136d7 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2783,6 +2783,8 @@ radix_sort_recursive(SortTuple *begin, size_t n_elems, int level, Tuplesortstate
        else
                next_level = level + 1;
 
+       Assert(next_level > level);
+
        for (uint8 *rp = remaining_partitions;
                 rp < remaining_partitions + num_partitions;
                 rp++)
```

It can help us catch some unexpected behaviors.

--
Regards,
ChangAo Chen


view thread (47+ messages)  latest in thread

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], [email protected]
  Subject: Re: tuple radix sort
  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