Re: BUG #18902: TRAP:: failed Assert("!is_sorted") in File: "createplan.c"
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Tender Wang <tndrwang@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>, n.kalinin@postgrespro.ru, pgsql-bugs@lists.postgresql.org
Date: 2025-05-08T10:26:30Z
Lists: pgsql-bugs
On Sat, May 3, 2025 at 10:50 AM Tender Wang <tndrwang@gmail.com> wrote: > Richard Guo <guofenglinux@gmail.com> 于2025年5月2日周五 15:03写道: >> Fair point. Here is the patchset doing that. 0001 fixes this bug by >> setting outersortkeys/innersortkeys to NIL in GetExistingLocalJoinPath >> if we detect that the new outer/inner path of the MergePath is already >> sorted properly. > The 0001 fixing this bug looks good to me. I've pushed this fix to master. I'm not quite sure whether it should be backpatched. In the back branches, the issue leads to the addition of a redundant Sort node in the plan that is only used for EPQ checks. Since usually the efficiency of the EPQ plan is not a concern, this doesn't seem like a big issue. Besides, this issue has existed in back branches for a long time but we haven't received any field reports. That said, if anyone thinks there's a good reason to backpatch it, I'm happy to do so. Thanks Richard
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Track the number of presorted outer pathkeys in MergePath
- c06e909c26f0 18.0 landed
-
Suppress unnecessary explicit sorting for EPQ mergejoin path
- 773db22269d4 18.0 landed
-
Re-enable SSL connect_fails tests, and fix related race conditions.
- e0f373ee42a4 18.0 cited
-
Consider explicit incremental sort for mergejoins
- 828e94c9d2fd 18.0 cited