pgsql: Eliminate some more O(N^2) behaviors in pg_dump/pg_restore.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Eliminate some more O(N^2) behaviors in pg_dump/pg_restore.
Дата
Msg-id E1SZASZ-0001Jp-OS@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Eliminate some more O(N^2) behaviors in pg_dump/pg_restore.  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-committers
Eliminate some more O(N^2) behaviors in pg_dump/pg_restore.

This patch fixes three places (which AFAICT is all of them) where runtime
was O(N^2) in the number of TOC entries, by using an index array to replace
linear searches of the TOC list.  This performance issue is a bit less bad
than those recently fixed, because it depends on the number of items dumped
not the number in the source database, so the problem can be dodged by
doing partial dumps.

The previous coding already had an instance of one of the two index arrays
needed, but it was only calculated in parallel-restore cases; now we need
it all the time.  I also chose to move the arrays into the ArchiveHandle
data structure, to make this code a bit more ready for the day that we
try to sling multiple ArchiveHandles around in pg_dump or pg_restore.

Since we still need some server-side work before pg_dump can really cope
nicely with tens of thousands of tables, there's probably little point in
back-patching.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c89bdf769065981e6948c94da8c0b96737bb8462

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c |  189 +++++++++++++++++-----------------
src/bin/pg_dump/pg_backup_archiver.h |    6 +-
2 files changed, 101 insertions(+), 94 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: libpq: URI parsing fixes
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Teach AbortOutOfAnyTransaction to clean up partially-started tra