From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Use binary search instead of brute-force scan in findNamespace() |
Date: | 2012-05-25 18:36:36 |
Message-ID: | E1SXzNM-0007Bl-Uu@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Use binary search instead of brute-force scan in findNamespace().
The previous coding presented a significant bottleneck when dumping
databases containing many thousands of schemas, since the total time
spent searching would increase roughly as O(N^2) in the number of objects.
Noted by Jeff Janes, though I rewrote his proposed patch to use the
existing findObjectByOid infrastructure.
Since this is a longstanding performance bug, backpatch to all supported
versions.
Branch
------
REL8_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/5e0f3c793a3767f38498d9cd54a3bfeeccdce6bf
Modified Files
--------------
src/bin/pg_dump/common.c | 19 ++++++++++++++++---
src/bin/pg_dump/pg_dump.c | 39 +++++++++++++++++----------------------
src/bin/pg_dump/pg_dump.h | 1 +
3 files changed, 34 insertions(+), 25 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-05-25 18:36:37 | pgsql: Use binary search instead of brute-force scan in findNamespace() |
Previous Message | Bruce Momjian | 2012-05-25 13:10:10 | pgsql: Have pg_upgrade only use one extra log file for Win32, not two. |