Re: CLUSTER sort on abbreviated expressions is broken
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: Thomas Munro <thomas.munro@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-04-03T23:11:51Z
Lists: 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
Commits
-
Fix CLUSTER tuplesorts on abbreviated expressions.
- 8ab0ebb9a842 15.0 landed
- e4521841a1ee 14.3 landed
- 1272630a2497 13.7 landed
- 5487585e376d 12.11 landed
- adb2d84fc2d6 11.16 landed
- a903895b3fe4 10.21 landed
-
Fix tuplesort optimization for CLUSTER-on-expression.
- cc58eecc5d75 15.0 cited