From 1a93588ffcad3e4876c9610c0a35d79c7fcdeffe Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 25 May 2012 14:35:41 -0400 Subject: 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/pg_dump.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/bin/pg_dump/pg_dump.h') diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 37b19d2f12e..21d42f8ea53 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -506,6 +506,7 @@ extern TypeInfo *findTypeByOid(Oid oid); extern FuncInfo *findFuncByOid(Oid oid); extern OprInfo *findOprByOid(Oid oid); extern CollInfo *findCollationByOid(Oid oid); +extern NamespaceInfo *findNamespaceByOid(Oid oid); extern void simple_oid_list_append(SimpleOidList *list, Oid val); extern void simple_string_list_append(SimpleStringList *list, const char *val); -- cgit v1.2.3