Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4C06A1B9E60B; Thu, 31 May 2012 00:54:46 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SZwTD-0005Is-IQ; Thu, 31 May 2012 03:54:45 +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 q4V3sUOG026387; Wed, 30 May 2012 23:54:31 -0400 (EDT) To: Tatsuo Ishii cc: pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: pg_dump and thousands of schemas In-reply-to: <20120531.092043.1953698679173443322.t-ishii@sraoss.co.jp> References: <20120529.185149.1127748531209576379.t-ishii@sraoss.co.jp> <12147.1338306742@sss.pgh.pa.us> <20120530.180620.600165924826262795.t-ishii@sraoss.co.jp> <20120531.092043.1953698679173443322.t-ishii@sraoss.co.jp> Comments: In-reply-to Tatsuo Ishii message dated "Thu, 31 May 2012 09:20:43 +0900" Date: Wed, 30 May 2012 23:54:30 -0400 Message-ID: <26386.1338436470@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/178 X-Sequence-Number: 47002 Tatsuo Ishii writes: >> Ok, I modified the part of pg_dump where tremendous number of LOCK >> TABLE are issued. I replace them with single LOCK TABLE with multiple >> tables. With 100k tables LOCK statements took 13 minutes in total, now >> it only takes 3 seconds. Comments? > Shall I commit to master and all supported branches? I'm not excited by this patch. It dodges the O(N^2) lock behavior for the initial phase of acquiring the locks, but it does nothing for the lock-related slowdown occurring in all pg_dump's subsequent commands. I think we really need to get in the server-side fix that Jeff Janes is working on, and then re-measure to see if something like this is still worth the trouble. I am also a tad concerned about whether we might not have problems with parsing memory usage, or some such, with thousands of tables being listed in a single command. regards, tom lane