Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id B30871C88E8F; Thu, 31 May 2012 01:02:08 -0300 (ADT) Received: from cl-174.chi-02.us.sixxs.net ([2001:4978:f:ad::2] helo=tamriel.snowman.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SZwaL-00013a-NX; Thu, 31 May 2012 04:02:07 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0010622A05; Thu, 31 May 2012 00:01:49 -0400 (EDT) Date: Thu, 31 May 2012 00:01:49 -0400 From: Stephen Frost To: Tom Lane Cc: Tatsuo Ishii , pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: pg_dump and thousands of schemas Message-ID: <20120531040149.GC1267@tamriel.snowman.net> 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> <26386.1338436470@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r1eEP9e4eXSJq+Un" Content-Disposition: inline In-Reply-To: <26386.1338436470@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.2.0-1-amd64 (x86_64) X-Uptime: 23:58:37 up 94 days, 10:04, 13 users, load average: 0.01, 0.03, 0.05 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/179 X-Sequence-Number: 47003 --r1eEP9e4eXSJq+Un Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Tatsuo Ishii writes: > > Shall I commit to master and all supported branches? >=20 > 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. I can't imagine a case where it's actually better to incur the latency penalty (which is apparently on the order of *minutes* of additional time here..) than to worry about the potential memory usage of having to parse such a command. If that's really a concern, where is that threshold, and could we simply cap pg_dump's operations based on it? Is 1000 alright? Doing a 'lock' w/ 1000 tables at a time is still going to be hugely better than doing them individually and the amount of gain between every-1000 and all-at-once is likely to be pretty minimal anyway... The current situation where the client-to-server latency accounts for multiple minutes of time is just ridiculous, however, so I feel we need some form of this patch, even if the server side is magically made much faster. The constant back-and-forth isn't cheap. Thanks, Stephen --r1eEP9e4eXSJq+Un Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk/G7S0ACgkQrzgMPqB3kijPVwCeONISIrrPXs+uxdrXqs3Vj3ne I5cAoIbYQSgewBeshkbNt6EwTQ3a0n8l =G4h+ -----END PGP SIGNATURE----- --r1eEP9e4eXSJq+Un--