Re: A qsort template
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: John Naylor <john.naylor@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-08-05T23:18:41Z
Lists: pgsql-hackers
On Sun, Aug 1, 2021 at 5:41 PM Thomas Munro <thomas.munro@gmail.com> wrote: > On Fri, Jul 30, 2021 at 12:34 PM John Naylor > <john.naylor@enterprisedb.com> wrote: > > I got around to getting a benchmark together to serve as a starting point. I based it off something I got from the archives, but don't remember where (I seem to remember Tomas Vondra wrote the original, but not sure). To start I just used types that were there already -- int, text, numeric. The latter two won't be helped by this patch, but I wanted to keep something like that so we can see what kind of noise variation there is. I'll probably cut text out in the future and just keep numeric for that purpose. > > Thanks, that's very useful. If somebody wants to get a sense of what the size hit is from all of these specializations, I can recommend the diff feature of bloaty: https://github.com/google/bloaty/blob/master/doc/using.md#size-diffs Obviously you'd approach this by building postgres without the patch, and diffing that baseline to postgres with the patch. And possibly variations of the patch, with less or more sort specializations. -- Peter Geoghegan
Commits
-
Remove debug messages from tuplesort_sort_memtuples()
- 6e647ef0e750 15.0 landed
-
Fix performance regression in tuplesort specializations
- 99c754129d78 15.0 landed
-
Fix tuplesort optimization for CLUSTER-on-expression.
- cc58eecc5d75 15.0 landed
-
Initial pgindent and pgperltidy run for v14.
- def5b065ff22 14.0 cited
-
Specialize checkpointer sort functions.
- 1b88b8908e75 14.0 landed
-
Use sort_template.h for qsort() and qsort_arg().
- f374f4d66425 14.0 landed
-
Use sort_template.h for qsort_tuple() and qsort_ssup().
- 8eda3eba3063 14.0 landed
-
Add sort_template.h for making sort functions.
- 0a1f1d3cac6b 14.0 landed
-
Use abbreviated keys for faster sorting of text datums.
- 4ea51cdfe85c 9.5.0 cited