On Fri, 16 Dec 2022 at 00:10, David Rowley <dgrowle...@gmail.com> wrote: > v3-0002 removes the 1.5 x cost pessimism from incremental sort and > also rewrites how we make incremental sort paths. I've now gone > through the remaining places where we create an incremental sort path > to give all those the same treatment that I'd added to > add_paths_to_grouping_rel(). There was a 1 or 2 plan changes in the > regression tests. One was the isolation test change, which I claim to > be a broken test and should be fixed another way. The other was > performing a Sort on the cheapest input path which had presorted keys. > That plan now uses an Incremental Sort to make use of the presorted > keys. I'm happy to see just how much redundant code this removes. > About 200 lines.
I've now pushed this patch. Thanks for the report and everyone for all the useful discussion. Also Richard for the review. > v3-0003 adds the enable_presorted_aggregate GUC. This I've moved off to [1]. We tend to have lengthy discussions about GUCs, what to name them and if we actually need them. I didn't want to bury that discussion in this old and already long thread. David [1] https://postgr.es/m/CAApHDvqzuHerD8zN1Qu=d66e3bp1=9ifn09ziq3zug_phi6...@mail.gmail.com