Re: Rework of collation code, extensibility

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rework of collation code, extensibility
Date: 2023-01-20 20:54:25
Message-ID: 45eb8e985d264bb7216b00d02eb28559d3d7b4bd.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v8-0002-Refactor-pg_locale_t-routines.patch text/x-patch 43.5 KB
v8-0001-Add-pg_strcoll-pg_strxfrm-and-variants.patch text/x-patch 43.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-01-20 20:54:28 Re: Collation version tracking for macOS
Previous Message Peter Geoghegan 2023-01-20 20:42:47 Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation