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 1hDD6v-0008Vf-MU for pgsql-general@arkaria.postgresql.org; Sun, 07 Apr 2019 19:05:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hDD6u-0001c1-71 for pgsql-general@arkaria.postgresql.org; Sun, 07 Apr 2019 19:05:44 +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 1hDD6t-0001bH-DK for pgsql-general@lists.postgresql.org; Sun, 07 Apr 2019 19:05:43 +0000 Received: from mail-oln040092013040.outbound.protection.outlook.com ([40.92.13.40] helo=NAM05-CO1-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 1hDD6p-0006ac-KV for pgsql-general@lists.postgresql.org; Sun, 07 Apr 2019 19:05:41 +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=BRMXJuA3A1IIxK7E5RpJ8EcF1Ai5J1mQWi9St+E/ygI=; b=tBujjt9J1A7nCIPofRquG3o4hUZP9LzA783HnZXRS5s3mp2vly0YvvSeuUnNmaDThkQO4zrZ/fL1YGH7TZVFBoL8k7CVJjx38rk//bpXIav+GZYgj6YU05BZFI/SSud/EA5ktehU1hu5lk/B48IV80eQFBkNe5vqHTcXDWAEJaLsDcbwiVJ3tqsS04JZmYotycTbefPEsXIoH9M9rjmLVY/wZd3Kir7RcKUW89+dT9+0KXs92fpjtcfsL4ToHp5srmTiWoIbJM17yBhXjmCI5rpdi5TxVbWCls3QruDOD3mfftELu1Xm78jHTuZZ/BwOkKQlBdejMdco35qZBcfFqQ== Received: from DM3NAM05FT035.eop-nam05.prod.protection.outlook.com (10.152.98.55) by DM3NAM05HT198.eop-nam05.prod.protection.outlook.com (10.152.99.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.7; Sun, 7 Apr 2019 19:05:37 +0000 Received: from BYAPR01MB3701.prod.exchangelabs.com (10.152.98.58) by DM3NAM05FT035.mail.protection.outlook.com (10.152.98.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.7 via Frontend Transport; Sun, 7 Apr 2019 19:05:37 +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.1771.021; Sun, 7 Apr 2019 19:05:37 +0000 From: senor To: "pgsql-general@lists.postgresql.org" Subject: Re: pg_upgrade --jobs Thread-Topic: pg_upgrade --jobs Thread-Index: AQHU7KUEoYaMmqXr9EqkQgpkSWov1KYvnAIAgAAGP06AAA0ygIAAC4Y+gAAS5gCAAAHVgIAABCYHgAD9a4CAADDVGQ== Date: Sun, 7 Apr 2019 19:05:37 +0000 Message-ID: References: <1c0469fb-1878-35ac-8468-78ce47299638@aklaver.com> <16144.1554588125@sss.pgh.pa.us> <20138.1554594658@sss.pgh.pa.us> <41c4d2a3-0a0a-bec3-7609-ec232b95f27b@gmail.com> ,<9465052c-66c8-d425-135e-94465b5b3114@aklaver.com> In-Reply-To: <9465052c-66c8-d425-135e-94465b5b3114@aklaver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:65C834C5DD0EC42C27397500048BBD95E329EBADBADF2BF7AA93A73AED2CE627;UpperCasedChecksum:CD5E7BA19CC089F4C893625398279499102F68B03815695C83D4E646F768311D;SizeAsReceived:7276;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [g1kQB2YVjTaecJkJFnF6vI9PvD1xbK4I] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:DM3NAM05HT198; x-ms-traffictypediagnostic: DM3NAM05HT198: x-microsoft-antispam-message-info: gO2RYS6aKgFABIXZb4h3NLBx1A/Y6EDpHOfA/5Q0mqysM+gPWAogFPxKYYRyUdyH Content-Type: text/plain; charset="iso-8859-1" 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: 37163537-687f-4538-c894-08d6bb8c0513 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2019 19:05:37.4061 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3NAM05HT198 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you Adrian. I'm not sure if I can provide as much as you'd need for a= definite answer but I'll give you what I have.=0A= =0A= The original scheduled downtime for one installation was 24 hours. By 21 ho= urs it had not completed the pg_dump schema-only so it was returned to oper= ation.=0A= The amount of data per table is widely varied. Some daily tables are 100-20= 0GB and thousands of reports tables with stats are much smaller. I'm not co= nnected to check now but I'd guess 1GB max. We chose to use the --link opti= on partly because some servers do not have the disk space to copy. The time= necessary to copy 1-2TB was also going to be an issue.=0A= The vast majority of activity is on current day inserts and stats reports o= f that data. All previous days and existing reports are read only.=0A= As is all too common, the DB usage grew with no redesign so it is a single = database on a single machine with a single schema.=0A= I get the impression there may be an option of getting the schema dump whil= e in service but possibly not in this scenario. Plan B is to drop a lot of = tables and deal with imports later.=0A= =0A= I appreciate the help. =0A= =0A= ________________________________________=0A= From: Adrian Klaver =0A= Sent: Sunday, April 7, 2019 8:19 AM=0A= To: senor; pgsql-general@lists.postgresql.org=0A= Subject: Re: pg_upgrade --jobs=0A= =0A= On 4/6/19 5:47 PM, senor wrote:=0A= > Thanks Tom for the explanation. I assumed it was my ignorance of how the = schema was handled that was making this look like a problem that had alread= y been solved and I was missing something.=0A= >=0A= > I fully expected the "You're Doing It Wrong" part. That is out of my cont= rol but not beyond my influence.=0A= >=0A= > I suspect I know the answer to this but have to ask. Using a simplified e= xample where there are 100K sets of 4 tables, each representing the output = of a single job, are there any shortcuts to upgrading that would circumvent= exporting the entire schema? I'm sure a different DB design would be bette= r but that's not what I'm working with.=0A= =0A= An answer is going to depend on more information:=0A= =0A= 1) What is the time frame for moving from one version to another?=0A= Both the setup and the actual downtime.=0A= =0A= 2) There are 500,000+ tables, but what is the amount of data involved?=0A= =0A= 3) Are all the tables active?=0A= =0A= 4) How are the tables distributed across databases in the cluster and=0A= schemas in each database?=0A= =0A= =0A= >=0A= > Thanks=0A= >=0A= > ________________________________________=0A= > From: Ron =0A= > Sent: Saturday, April 6, 2019 4:57 PM=0A= > To: pgsql-general@lists.postgresql.org=0A= > Subject: Re: pg_upgrade --jobs=0A= >=0A= > On 4/6/19 6:50 PM, Tom Lane wrote:=0A= >=0A= > senor writes:= =0A= >=0A= >=0A= > [snip]=0A= >=0A= > The --link option to pg_upgrade would be so much more useful if it=0A= > weren't still bound to serially dumping the schemas of half a million=0A= > tables.=0A= >=0A= >=0A= >=0A= > To be perfectly blunt, if you've got a database with half a million=0A= > tables, You're Doing It Wrong.=0A= >=0A= > Heavy (really heavy) partitioning?=0A= >=0A= > --=0A= > Angular momentum makes the world go 'round.=0A= >=0A= >=0A= >=0A= =0A= =0A= --=0A= Adrian Klaver=0A= adrian.klaver@aklaver.com=0A=