]> 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:41 +0000 (14:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 25 May 2012 18:35:41 +0000 (14:35 -0400)
commit1a93588ffcad3e4876c9610c0a35d79c7fcdeffe
tree839e744d925a458f14331eea9d145369267e2fce
parent4615d2ca28fe9dff6e5ebaebd6caf190a0c78ba5
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