Reducing connection overhead in pg_upgrade compat check phase

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Reducing connection overhead in pg_upgrade compat check phase
Дата
Msg-id BBB4C76F-D416-4F9F-949E-DBE950D37787@yesql.se
обсуждение исходный текст
Ответы Re: Reducing connection overhead in pg_upgrade compat check phase  (Nathan Bossart <nathandbossart@gmail.com>)
Re: Reducing connection overhead in pg_upgrade compat check phase  (Nathan Bossart <nathandbossart@gmail.com>)
Re: Reducing connection overhead in pg_upgrade compat check phase  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
When adding a check to pg_upgrade a while back I noticed in a profile that the
cluster compatibility check phase spend a lot of time in connectToServer.  Some
of this can be attributed to data type checks which each run serially in turn
connecting to each database to run the check, and this seemed like a place
where we can do better.

The attached patch moves the checks from individual functions, which each loops
over all databases, into a struct which is consumed by a single umbrella check
where all data type queries are executed against a database using the same
connection.  This way we can amortize the connectToServer overhead across more
accesses to the database.

In the trivial case, a single database, I don't see a reduction of performance
over the current approach.  In a cluster with 100 (empty) databases there is a
~15% reduction in time to run a --check pass.  While it won't move the earth in
terms of wallclock time, consuming less resources on the old cluster allowing
--check to be cheaper might be the bigger win.

--
Daniel Gustafsson


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Move defaults toward ICU in 16?
Следующее
От: Nathan Bossart
Дата:
Сообщение: archive modules loose ends