Re: Collation & ctype method table, and extension hooks
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Andreas Karlsson <andreas@proxel.se>, pgsql-hackers@postgresql.org
Date: 2024-11-01T18:17:09Z
Lists: pgsql-hackers
On Fri, 2024-11-01 at 14:08 +0100, Andreas Karlsson wrote: > > Agreed -- a lot of work has gone into optimizing the regex code, > > and we > > don't want a perf regression there. But I'm also not sure exactly > > which > > kinds of tests I should be running for that. > > I think we should at least try to find the worst case to see how big > the > performance hit for that is. And then after that try to figure out a > more typical case benchmark. What I had in mind was: * a large table with a single ~100KiB text field * a scan with a case insensitive regex that uses some character classes Does that sound like a worst case? > The painful part was mostly just a reference to that without a > catalog > table where new providers can be added we would need to add > collations > for our new custom provider on some already existing provider and > then > do for example some pattern matching on the name of the new > collation. > Really ugly but works. To add a catalog table for the locale providers, the main challenge is around the database default collation and, relatedly, initdb. Do you have some ideas around that? Regards, Jeff Davis
Commits
-
Remove provider field from pg_locale_t.
- 8af0d0ab01b4 19 (unreleased) landed
-
Control ctype behavior internally with a method table.
- 5a38104b3642 19 (unreleased) landed
-
Control collation behavior with a method table.
- a2f17f004d22 18.0 landed
-
Move code for collation version into provider-specific files.
- 4f5cef2607c1 18.0 landed
-
Refactor string case conversion into provider-specific files.
- 86a5d6006aff 18.0 landed
-
Move check for ucol_strcollUTF8 to pg_locale_icu.c
- 7167e05fc7d1 18.0 landed
-
Perform provider-specific initialization in new functions.
- 1ba0782ce90c 18.0 landed
-
Refactor the code to create a pg_locale_t into new function.
- 3aa2373c1141 18.0 landed