Re: [PATCH] Use optimized single-datum tuplesort in ExecSort
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Ronan Dunklau <ronan.dunklau@aiven.io>
Cc: James Coleman <jtc331@gmail.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>,
Ranier Vilela <ranier.vf@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>
Date: 2021-07-14T10:13:45Z
Lists: pgsql-hackers
Attachments
- v8_poc_datum_tuple_sort.patch (application/octet-stream) patch v8
On Tue, 13 Jul 2021 at 15:15, David Rowley <dgrowleyml@gmail.com> wrote: > In theory, we likely could get rid of the small regression by having > two versions of ExecSort() and setting the correct one during > ExecInitSort() by setting the function pointer to the version we want > to use in sortstate->ss.ps.ExecProcNode. Just to see how it would perform, I tried what I mentioned above. I've included what I ended up with in the attached POC patch. I got the following results on my AMD hardware. Test master v8 patch comparison Test1 448.0 671.7 149.9% Test2 316.4 317.5 100.3% Test3 299.5 381.6 127.4% Test4 219.7 229.5 104.5% Test5 226.3 254.6 112.5% Test6 197.9 217.9 110.1% Test7 179.2 185.3 103.4% Test8 389.2 544.8 140.0% This time I saw no regression on tests 2, 4 and 7. I looked to see if there was anywhere else in the executor that conditionally uses a different exec function in this way and found nothing, so I'm not too sure if it's a good idea to start doing this. It would be good to get a 2nd opinion about this idea. Also, more benchmark results with v6 and v8 would be good too. David
Commits
-
Make nodeSort.c use Datum sorts for single column sorts
- 91e9e89dccdf 15.0 landed