Re: Rework of collation code, extensibility
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-hackers@postgresql.org
Date: 2023-01-20T20:54:25Z
Lists: pgsql-hackers
Attachments
- v8-0002-Refactor-pg_locale_t-routines.patch (text/x-patch) patch v8-0002
- v8-0001-Add-pg_strcoll-pg_strxfrm-and-variants.patch (text/x-patch) patch v8-0001
On Tue, 2023-01-17 at 14:18 -0800, Peter Geoghegan wrote: > The second goal is a perfectly good enough goal on its own, and one > that I am totally supportive of. Making the code clearer is icing on > the cake. Attached v8, which is just a rebase. To reiterate: commitfest entry https://commitfest.postgresql.org/41/3956/ is dependent on these patches and is a big part of the motivation for refactoring. > > I don't know. Quite possibly not. It would be nice to have some data > on that, though. I tested with hash aggregation, which might be more dependent on pg_locale_deterministic() than sorting. I didn't see any significant difference between master and the refactoring branch, so I don't see a need to make that function "inline". I also re-tested sorting and found some interesting results for en-US- x-icu on a UTF-8 database (which is I suspect one of the most common configurations for ICU): * the refactoring branch is now more than 5% faster, whether using abbreviated keys or not * disabling abbreviated keys makes sorting 8-10% faster on both master and the refactoring branch Both of these are surprising, and I haven't investigated deeply yet. Maybe something about LTO, some intervening patch, or I just made some mistakes somewhere (I did this fairly quickly). But as of now, it doesn't look like the refactoring patch hurts anything. -- Jeff Davis PostgreSQL Contributor Team - AWS
Commits
-
Remove unnecessary #ifdef USE_ICU and branch.
- e0b3074e8944 16.0 landed
-
Refactor to introduce pg_locale_deterministic().
- 6974a8f7682b 16.0 landed
-
Refactor to add pg_strcoll(), pg_strxfrm(), and variants.
- d87d548cd030 16.0 landed
-
Fix MSVC build
- c971a5b27ac9 16.0 cited