Re: CLUSTER sort on abbreviated expressions is broken - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: CLUSTER sort on abbreviated expressions is broken
Date
Msg-id CAH2-Wzn22s42h4Lh6v96GsXSKGd=_6b76mjqip_WFCGnBmTJCw@mail.gmail.com
Whole thread Raw
In response to Re: CLUSTER sort on abbreviated expressions is broken  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: CLUSTER sort on abbreviated expressions is broken  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
On Sun, Apr 3, 2022 at 1:22 AM John Naylor <john.naylor@enterprisedb.com> wrote:
> I can confirm the problem on v10 as well.

We will need a backpatchable fix, since Thomas' recent fix (commit
cc58eecc5d75a9329a6d49a25a6499aea7ee6fd6) only targeted the master
branch.

If we really needed the performance advantage of abbreviated keys in
this case then it would have taken more than 7 years for this bug to
come to light. The backpatchable fix can be very simple. We can just
copy what tuplesort_set_bound() does with abbreviated keys in
tuplesort_begin_cluster(), to explicitly disable abbreviated keys
up-front for affected tuplesorts. (Just for CLUSTER tuplesorts on an
expression index.)


-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: A qsort template
Next
From: Thomas Munro
Date:
Subject: Re: CLUSTER sort on abbreviated expressions is broken