Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgdND-0006fQ-2d for pgsql-general@arkaria.postgresql.org; Thu, 04 Jun 2020 00:04:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgdN9-0004lp-2E for pgsql-general@arkaria.postgresql.org; Thu, 04 Jun 2020 00:04:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgdLL-0000iW-Sb for pgsql-general@lists.postgresql.org; Thu, 04 Jun 2020 00:02:47 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jgdLJ-00016H-Od for pgsql-general@lists.postgresql.org; Thu, 04 Jun 2020 00:02:46 +0000 Received: by mail-qt1-x841.google.com with SMTP id y1so3738900qtv.12 for ; Wed, 03 Jun 2020 17:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=yPApSgx7F4+4bdY5yQmHB/xhXjk0ZaOQer9YLvBBmQA=; b=cxHPp6U5v5iztbeU1w6sQcoNz8rEh3Eg6zDlW35jqc1aFxRsabICAHjHNSF+QjiVBH JbZPmaBh7tq7hqp5ciZNPAekMBnADDljJiu5bLUsD0p87kG73EFg7VTVFUStbVf4T/7G YJg8IEefnabIYx/oN3oGde1CTBcTs/FR1g5/jCskB9UkHQ8tnM5ATEYXfD67sqASYCcU eW8rDv9vwhB5gsx4LO2JJBHfPG2krWnQmLPybgmLqDsZQL6G5I6v062UR5luX/mw3Ryn CaGPAa23zOIutiuwl9KNaGgGkzsTVS3qwMZFxtAY3E9AwJ35uniRdS9hpl5MiJYChKiJ wcqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=yPApSgx7F4+4bdY5yQmHB/xhXjk0ZaOQer9YLvBBmQA=; b=J++R71JspoVI+qHFv2OopaZo7v2IqeMcZIWaIgYZvuTVbMO8LIu26hbiVBIftJ/0tB 4XCd7quzoJvP4wb3Bs7eMiZcyZLktcdUdyCqfaK+gpWOzRqCWWkUv6XSggeKeVruOjZg pIgXBFUIOYskdAM+BWx/4ERz35xpt87szSAcEbxx9bqju3UVW50I93/b6DRIYb0dF1xq N9cWIZ4D1R1hgy3t37y4Cf+Q5+80vVUmBit0n/6Y3P4pSgM4qvmYOQGKMed7vtXM6NQN Vt2fwytssdd8jscA2nHY7CZwB+sCVTHq9EPJ2cQ2I8vsXxp2Z5vIIx/YbUUw35MnpfcC MauA== X-Gm-Message-State: AOAM533bqCvqnp2ZuAEogkG6wAe/sV2RPk2sAHoRN57LY4iiTr66LCHM OY7jS1ujjMIoCcbE21V0GVpiadfZ0z4nI0hr X-Google-Smtp-Source: ABdhPJyRgpF7VR0h5kl0CHIpTg1aP7e/7KDzLNZIRcBmNBdLWkmwsVmB/0uI2yuC3iONmJaqDt/4Vg== X-Received: by 2002:ac8:19cb:: with SMTP id s11mr1953535qtk.105.1591228965018; Wed, 03 Jun 2020 17:02:45 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id b53sm3444803qtc.65.2020.06.03.17.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 17:02:42 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 62580300801; Wed, 3 Jun 2020 16:10:55 -0400 (-04) Date: Wed, 3 Jun 2020 16:10:55 -0400 From: Alvaro Herrera To: tony@exquisiteimages.com Cc: pgsql-general@lists.postgresql.org Subject: Re: pg_dump of database with numerous objects Message-ID: <20200603201055.GA30037@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6ef5dbeb1a02e0d01c5f085e4e49e496@exquisiteimages.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-May-31, tony@exquisiteimages.com wrote: > I am now needing to upgrade to a new version of PostgreSQL and I am running > into problems when pg_upgrade calls pg_dump. pg_dump stalled at: "pg_dump: > saving database definition" for 24 hours before I killed the process. > > My pg_class table contains 9,000,000 entries and I have 9004 schema. We've made a number of performance improvements to pg_dump so that it can dump databases that are "large" in several different dimensions, but evidently from your report it is not yet good enough when it comes to dumping millions of tables in thousands of schemas. It will probably take some profiling of pg_dump to figure out where the bottleneck is, and some careful optimization work in order to make it faster. Not a weekend job, I'm afraid :-( -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services