pgsql: Use a hash table to de-duplicate column names in ruleutils.c.
От | Tom Lane |
---|---|
Тема | pgsql: Use a hash table to de-duplicate column names in ruleutils.c. |
Дата | |
Msg-id | E1so7nV-000UaJ-8F@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
Use a hash table to de-duplicate column names in ruleutils.c. Commit 8004953b5 added a hash table to avoid O(N^2) cost in choosing unique relation aliases while deparsing a view or rule. It did nothing about the similar O(N^2) (maybe worse) costs of choosing unique column aliases within each RTE. However, that's now demonstrably a bottleneck when deparsing CHECK constraints for wide tables, so let's use a similar hash table to handle those. The extra cost of setting up the hash table will not be repaid unless the table has many columns. I've set this up so that we use the brute force method if there are less than 32 columns. The exact cutoff is not too critical, but this value seems good because it results in both code paths getting exercised by existing regression-test cases. Patch by me; thanks to David Rowley for review. Discussion: https://postgr.es/m/2885468.1722291250@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/52c707483ce4d0161127e4958d981d1b5655865e Modified Files -------------- src/backend/utils/adt/ruleutils.c | 188 +++++++++++++++++++++++++++++++++----- 1 file changed, 165 insertions(+), 23 deletions(-)
В списке pgsql-committers по дате отправления: