Re: Optimization for lower(), upper(), casefold() functions. - Mailing list pgsql-hackers

From Alexander Borisov
Subject Re: Optimization for lower(), upper(), casefold() functions.
Date
Msg-id 5b6a619b-58dc-4f55-8398-97595f559794@gmail.com
Whole thread Raw
In response to Re: Optimization for lower(), upper(), casefold() functions.  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
14.03.2025 06:43, Jeff Davis wrote:
> On Wed, 2025-03-12 at 23:39 +0300, Alexander Borisov wrote:
>> v5 attached.
> 
> Attached v6j.

I like the current changes.
Some comments:

[...]
> * modified perl code so that it produces code that's already pgindented
> * cleanup of perl code, removing unnecessary subroutines and variables

Does it make sense to arrange table creation in this way (lower, title,
upper, fold, special), don't you think it complicates code perception,
it turns out to be just copy-past.
Previously, the creation of these tables was done in a loop, which
required little code and understandable.

I tried adding a loop to create tables, and everything looks fine (v7).
Also removed unnecessary (hanging) global variables.

> * added a few comments
> * ran pgperltidy
> 
> Some of the perl code working with ranges still needs further cleanup
> and explanation, though.

It's all about not getting too carried away. In my vision these
subroutines (user-defined functions) will have to be moved to perl
module (.pm) in the future, after the patch is committed, so that the
code can be used for Normalization Forms.

So it seems that removing the branch_function() sub, or rather
simplifying it and writing it in place, was unnecessary.
But it is not terrible.

v7 attached.


Regards,
Alexander Borisov

Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
Next
From: Amit Langote
Date:
Subject: Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning