pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix YA incremental sort bug.
Date: Fri, 05 Feb 2021 00:12:29 +0000
Message-ID: <E1l7ojd-0002cw-JA@gemulon.postgresql.org> (raw)

Fix YA incremental sort bug.

switchToPresortedPrefixMode() did the wrong thing if it detected
a batch boundary just at the last tuple of a fullsort group.

The initially-reported symptom was a "retrieved too many tuples in a
bounded sort" error, but the test case added here just silently gives
the wrong answer without this patch.

I (tgl) am not really happy about committing this patch without review
from the incremental-sort authors, but they seem AWOL and we are hard
against a release deadline.  This does demonstrably make some cases
better, anyway.

Per bug #16846 from Yoran Heling.  Back-patch to v13 where incremental
sort was introduced.

Neil Chen

Discussion: https://postgr.es/m/16846-ae49f51ac379a4cb@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/82e0e29308dedbc6000e73329beb112ae7e1ad39

Modified Files
--------------
src/backend/executor/nodeIncrementalSort.c     |  7 +++++++
src/test/regress/expected/incremental_sort.out | 11 +++++++++++
src/test/regress/sql/incremental_sort.sql      |  3 +++
3 files changed, 21 insertions(+)



view thread (2+ messages)

Message-ID: <E1l7ojd-0002cw-JA@gemulon.postgresql.org>
Permalink:  ../E1l7ojd-0002cw-JA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l7ojd-0002cw-JA@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix YA incremental sort bug.
  In-Reply-To: <E1l7ojd-0002cw-JA@gemulon.postgresql.org>
  References: <E1l7ojd-0002cw-JA@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox