Re: Speeding up ruleutils' name de-duplication code, redux

2024-09-10 Thread Tom Lane
David Rowley writes: > On Wed, 11 Sept 2024 at 03:06, Tom Lane wrote: >> We could accomplish what you suggest by re-ordering the calls so that >> we build the hash table before enlarging the array. 0001 attached >> is the same as before (modulo line number changes from being rebased >> up to HEA

Re: Speeding up ruleutils' name de-duplication code, redux

2024-09-10 Thread David Rowley
On Wed, 11 Sept 2024 at 03:06, Tom Lane wrote: > We could accomplish what you suggest by re-ordering the calls so that > we build the hash table before enlarging the array. 0001 attached > is the same as before (modulo line number changes from being rebased > up to HEAD) and then 0002 implements

Re: Speeding up ruleutils' name de-duplication code, redux

2024-09-10 Thread Tom Lane
David Rowley writes: > On Tue, 30 Jul 2024 at 10:14, Tom Lane wrote: >> On my development machine, it takes over 14 minutes to pg_upgrade >> this, and it turns out that that time is largely spent in column >> name de-duplication while deparsing the CHECK constraints. The >> attached patch reduce

Re: Speeding up ruleutils' name de-duplication code, redux

2024-09-10 Thread David Rowley
On Tue, 30 Jul 2024 at 10:14, Tom Lane wrote: > - > for (my $i = 0; $i < 100; $i++) > { > print "CREATE TABLE test_inh_check$i (\n"; > for (my $j = 0; $j < 1000; $j++) > { > print "a$j float check (a$j > 10.2),\n"; > } > print "b float);\

Speeding up ruleutils' name de-duplication code, redux

2024-07-29 Thread Tom Lane
When deparsing queries or expressions, ruleutils.c has to generate unique names for RTEs and columns of RTEs. (Often, they're unique already, but this isn't reliably true.) The original logic for that involved just strcmp'ing a proposed name against all the ones already assigned, which obviously