]> granicus.if.org Git - postgresql/commit
Use binary search instead of brute-force scan in findNamespace().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 18:35:59 +0000 (14:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 18:35:59 +0000 (14:35 -0400)
commitbd43c50a5bd560224f996d6bd14e1e3cb5a5b06b
treed1a06f2ef920195c51dcefbd13f4bdd53a10545a
parentc994b9211fd0cf7a5b680ae115330117604b9f7c
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.
src/bin/pg_dump/common.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h