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 1hKrkj-0001oi-Il for pgsql-general@arkaria.postgresql.org; Sun, 28 Apr 2019 21:54:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hKrki-0004KK-A4 for pgsql-general@arkaria.postgresql.org; Sun, 28 Apr 2019 21:54:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKrkh-0004GI-Uk for pgsql-general@lists.postgresql.org; Sun, 28 Apr 2019 21:54:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKrkf-0003IX-Fx for pgsql-general@lists.postgresql.org; Sun, 28 Apr 2019 21:54:27 +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 x3SLsJv3006789; Sun, 28 Apr 2019 17:54:19 -0400 From: Tom Lane To: Ron cc: pgsql-general@lists.postgresql.org Subject: Re: Optimize pg_dump schema-only In-reply-to: <17505fec-be0a-526a-9ee5-18bb0408a62a@gmail.com> References: <17505fec-be0a-526a-9ee5-18bb0408a62a@gmail.com> Comments: In-reply-to Ron message dated "Sun, 28 Apr 2019 16:08:41 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6787.1556488459.1@sss.pgh.pa.us> Date: Sun, 28 Apr 2019 17:54:19 -0400 Message-ID: <6788.1556488459@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ron writes: > On 4/28/19 3:21 PM, senor wrote: >> I see only one CPU of 32 doing anything and it's often at 100%. Disk IO >> is minimal. Memory use varies but always plenty to spare. > "pg_dump --schema-only" is single-threaded. Yup. But ... pg_upgrade does have a --jobs option, since 9.5 or so. What it does is to run the dump and restore tasks for different databases of the cluster in parallel. So it won't help much if you've just got one DB with a lotta objects, but I thought it was worth mentioning. regards, tom lane