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 1hKvZo-00052A-FZ for pgsql-general@arkaria.postgresql.org; Mon, 29 Apr 2019 01:59: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 1hKvZl-0007WP-HP for pgsql-general@arkaria.postgresql.org; Mon, 29 Apr 2019 01:59:25 +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 1hKvZk-0007WI-I5 for pgsql-general@lists.postgresql.org; Mon, 29 Apr 2019 01:59:25 +0000 Received: from mail-oln040092003021.outbound.protection.outlook.com ([40.92.3.21] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKvZb-0003e2-0o for pgsql-general@lists.postgresql.org; Mon, 29 Apr 2019 01:59:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lJymdsszphAdKZI/6th7R/Owb7lBEel4OnHPz2/Z4HA=; b=H1KzH5LetOVVQlC+NMmhSaH+szlbBKDL0DHL6Z+mSmhqnTWBN16JTxdOV7Yzkk+l9lTDHvon1dG3IyrKhZ7dsiRe5H9SFP4K9RSxzmUloPztdY9tYJOclJGYeBRv27Ipbihj8Wbz9C1ezhkxthVJbdwyIyA+rjb4NMMFoNfR5YOZgJAj/YetOWPBJJu6yMp2vlmjQf7nFvU5Ov5Xii7V2syMj8t1fkstJnR/gcfZlOQo5yyfUrZrQTFx16pEey1YklJhWDlXz8tiIfBxVmriwxyiaYqg0lBxS/gZ3iEHKFY7VGH1gM9Md9AJ/A1ZvZwinCkrLHwvWLUETzdTEchWLw== Received: from BL2NAM02FT054.eop-nam02.prod.protection.outlook.com (10.152.76.57) by BL2NAM02HT040.eop-nam02.prod.protection.outlook.com (10.152.77.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 01:59:13 +0000 Received: from BYAPR01MB3701.prod.exchangelabs.com (10.152.76.60) by BL2NAM02FT054.mail.protection.outlook.com (10.152.77.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1835.13 via Frontend Transport; Mon, 29 Apr 2019 01:59:13 +0000 Received: from BYAPR01MB3701.prod.exchangelabs.com ([fe80::3c48:513d:60f7:6afc]) by BYAPR01MB3701.prod.exchangelabs.com ([fe80::3c48:513d:60f7:6afc%2]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 01:59:12 +0000 From: senor To: "pgsql-general@lists.postgresql.org" Subject: Re: Optimize pg_dump schema-only Thread-Topic: Optimize pg_dump schema-only Thread-Index: AQHU/f/97+Bzdy7KKkSOtxg5x7S0Y6ZSERyAgAAuSYCAABfIAIAACxeA Date: Mon, 29 Apr 2019 01:59:12 +0000 Message-ID: References: <17505fec-be0a-526a-9ee5-18bb0408a62a@gmail.com> <23800.1556500768@sss.pgh.pa.us> In-Reply-To: <23800.1556500768@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0021.namprd03.prod.outlook.com (2603:10b6:a02:a8::34) To BYAPR01MB3701.prod.exchangelabs.com (2603:10b6:a02:88::28) x-incomingtopheadermarker: OriginalChecksum:9F7405A6578B0A790EC0283ECA1C99C09D8AB272B5B808CFCEA0C0606ED7E523;UpperCasedChecksum:E1EB77FCB7104C4A2D86B783B940D21C9294D668AA9C7E16920677FA985E3D04;SizeAsReceived:7509;Count:48 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [Sl0UjIxrauJtcSMO2UA66EnydyAWmAqt] x-microsoft-original-message-id: x-ms-publictraffictype: Email x-incomingheadercount: 48 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:BL2NAM02HT040; x-ms-traffictypediagnostic: BL2NAM02HT040: x-microsoft-antispam-message-info: Oz/mW/gToixXu4AjXCKK56VikewO+89OuEtfjg6lN5cs4StVc8Zfiuw8Mskw1XRXzr9kV0DAcQv8QTVZgq65mMDHhwhRe3Q8IED/BBAcIYgXQfSx2NgJzwyBBa5nuDhJ5b2f+vNBVChjbPYEoevt3GQDyldxBMqWpe7YtPLmnXYsGcev3ijf3Ur7RsrBtdAi Content-Type: text/plain; charset="Windows-1252" Content-ID: <465A0654A197484D83FA0156B1B87BAF@prod.exchangelabs.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 06de7781-bc7f-40f4-9cfd-08d6cc4646bf X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 01:59:12.8825 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT040 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I'm afraid it is 9.2.4. I'm using pg_upgrade from 9.6 and that is using=20 pg_dump from 9.6. I noticed on 2 installations with similar table numbers (~200,000),=20 schema and hardware that one was done in hours and the other didn't=20 finish over the weekend. Keeping tabs on pg_stat_activity indicated=20 pg_dump was still processing and nothing else running. Would you say that updating to 9.2.24 would be beneficial before=20 upgrading to 9.6? An update is pretty quick and could be worth the time=20 if there aren't additional requirements prior to starting the upgrade. Thank you. Senor On 4/28/2019 18:19, Tom Lane wrote: > 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 --lin= k option is very fast except for the pg_dump portion of the upgrade which t= akes 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 destinatio= n > release series. > > regards, tom lane