pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix tuplesort optimization for CLUSTER-on-expression.
Date: Sun, 03 Apr 2022 22:58:39 +0000
Message-ID: <E1nb9B8-000CIi-F1@gemulon.postgresql.org> (raw)

Fix tuplesort optimization for CLUSTER-on-expression.

When dispatching sort operations to specialized variants, commit
69749243 failed to handle the case where CLUSTER-sort decides not to
initialize datum1 and isnull1.  Fix by hoisting that decision up a level
and advertising whether datum1 can be relied on, in the Tuplesortstate
object.

Per reports from UBsan and Valgrind build farm animals, while running
the cluster.sql test.

Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAFBsxsF1TeK5Fic0M%2BTSJXzbKsY6aBqJGNj6ptURuB09ZF6k_w%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cc58eecc5d75a9329a6d49a25a6499aea7ee6fd6

Modified Files
--------------
src/backend/utils/sort/tuplesort.c | 78 +++++++++++++++++++++++++++-----------
1 file changed, 56 insertions(+), 22 deletions(-)



Message-ID: <E1nb9B8-000CIi-F1@gemulon.postgresql.org>
Permalink:  ../E1nb9B8-000CIi-F1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nb9B8-000CIi-F1@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: tmunro@postgresql.org
  Subject: Re: pgsql: Fix tuplesort optimization for CLUSTER-on-expression.
  In-Reply-To: <E1nb9B8-000CIi-F1@gemulon.postgresql.org>
  References: <E1nb9B8-000CIi-F1@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