Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKuxI-00034f-Ei for pgsql-general@arkaria.postgresql.org; Mon, 29 Apr 2019 01:19:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hKuxF-00048a-1u for pgsql-general@arkaria.postgresql.org; Mon, 29 Apr 2019 01:19:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKuxE-00048S-Kp for pgsql-general@lists.postgresql.org; Mon, 29 Apr 2019 01:19:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKux9-0002o3-SH for pgsql-general@lists.postgresql.org; Mon, 29 Apr 2019 01:19:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3T1JSQo023801; Sun, 28 Apr 2019 21:19:28 -0400 From: Tom Lane To: senor cc: "pgsql-general@lists.postgresql.org" Subject: Re: Optimize pg_dump schema-only In-reply-to: References: <17505fec-be0a-526a-9ee5-18bb0408a62a@gmail.com> Comments: In-reply-to senor message dated "Sun, 28 Apr 2019 23:54:37 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23799.1556500768.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 28 Apr 2019 21:19:28 -0400 Message-ID: <23800.1556500768@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk senor writes: > I know from a previous post to the community that pg_dump --schema-only = is single threaded and the --jobs option cannot benefit pg_dump in my case= (single DB, Single schema, 100000+ tables). Using pg_upgrade with the --l= ink option is very fast except for the pg_dump portion of the upgrade whic= h takes days. One simple question is whether the source server is the last available minor release (9.2.24 I believe). If not, you may be missing performance fixes that would help. pg_dump -s on 100K tables should not take "days", so I'm guessing you're hitting some O(N^2) behavior somewhere, and it might be something we fixed. Likewise make sure that pg_dump is the newest available in the destination release series. regards, tom lane