Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 6FAAA5377D9; Tue, 29 May 2012 12:52:40 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SZOip-0000LW-MR; Tue, 29 May 2012 15:52:39 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q4TFqMUK012148; Tue, 29 May 2012 11:52:22 -0400 (EDT) To: Tatsuo Ishii cc: pgsql-performance@postgresql.org Subject: Re: pg_dump and thousands of schemas In-reply-to: <20120529.185149.1127748531209576379.t-ishii@sraoss.co.jp> References: <1337921645663-5709975.post@n5.nabble.com> <20887.1337956883@sss.pgh.pa.us> <20120526.101840.762942175522564494.t-ishii@sraoss.co.jp> <20120529.185149.1127748531209576379.t-ishii@sraoss.co.jp> Comments: In-reply-to Tatsuo Ishii message dated "Tue, 29 May 2012 18:51:49 +0900" Date: Tue, 29 May 2012 11:52:22 -0400 Message-ID: <12147.1338306742@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/166 X-Sequence-Number: 46990 Tatsuo Ishii writes: > So I did qucik test with old PostgreSQL 9.0.2 and current (as of > commit 2755abf386e6572bad15cb6a032e504ad32308cc). In a fresh initdb-ed > database I created 100,000 tables, and each has two integer > attributes, one of them is a primary key. Creating tables were > resonably fast as expected (18-20 minutes). This created a 1.4GB > database cluster. > pg_dump dbname >/dev/null took 188 minutes on 9.0.2, which was pretty > long time as the customer complained. Now what was current? Well it > took 125 minutes. Ps showed that most of time was spent in backend. Yeah, Jeff's experiments indicated that the remaining bottleneck is lock management in the server. What I fixed so far on the pg_dump side should be enough to let partial dumps run at reasonable speed even if the whole database contains many tables. But if psql is taking AccessShareLock on lots of tables, there's still a problem. regards, tom lane