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 1hkuqH-0002uq-Vw for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 18:27:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkuqG-0001k8-OL for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 18:27:52 +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 1hkuqG-0001fR-Cn for pgsql-general@lists.postgresql.org; Tue, 09 Jul 2019 18:27:52 +0000 Received: from mail-oln040092009094.outbound.protection.outlook.com ([40.92.9.94] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkuqE-0001aV-7A for pgsql-general@postgresql.org; Tue, 09 Jul 2019 18:27:51 +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=0SRGHk3VM3z4jRJWZznhOoN+IugJaxIDoZCbvCsYYXg=; b=F8VHkPKFMO+tEszhbQ1Aah5Q3QkZbyjG1ZU2VzZQAMf3rdMqaRVAJYJghrO6s8Q+uuAYDcikqBatPuESiBsqf5mvRoF8JZ+7p7fFtveUSATy0KwYQZGxex5hXFWm1zLS+pq7l8nZTyGEQOs/plMsbLfV9mk/D2avlVVY4d0oJKmp6s6AHnw3GTllMnPAB0UaaEqGfVzrfTvwck3TQB1lMREjablgFG3An24Hynp4jeeIMEdgwWKaU26X0xeyJmhZjky6lPuWoAmLTADa6rMxOHMQZgukPRvtwCGv6r9WNG9pwp6ZnjIo+wANcueQ9ZBF5RQTndNAiZXWgiTUvRN0LQ== Received: from SN1NAM04FT029.eop-NAM04.prod.protection.outlook.com (10.152.88.54) by SN1NAM04HT047.eop-NAM04.prod.protection.outlook.com (10.152.89.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18; Tue, 9 Jul 2019 18:27:47 +0000 Received: from BYAPR06MB5559.namprd06.prod.outlook.com (10.152.88.56) by SN1NAM04FT029.mail.protection.outlook.com (10.152.88.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Tue, 9 Jul 2019 18:27:47 +0000 Received: from BYAPR06MB5559.namprd06.prod.outlook.com ([fe80::9414:d29e:55b8:ab12]) by BYAPR06MB5559.namprd06.prod.outlook.com ([fe80::9414:d29e:55b8:ab12%7]) with mapi id 15.20.2052.020; Tue, 9 Jul 2019 18:27:47 +0000 From: John Lumby To: Peter Geoghegan CC: pgsql general , Tom Lane Subject: Re: REINDEX : new parameter to preserve current average leaf density as new implicit FILLFACTOR Thread-Topic: REINDEX : new parameter to preserve current average leaf density as new implicit FILLFACTOR Thread-Index: AQHVK5ybyheYeBn/pEeqHQr9ZtxX26as7wUAgAEPpomAAB0TAIAS1H/xgAAg04CAAY2XlYAABtyAgAAHGrOAAAODgw== Date: Tue, 9 Jul 2019 18:27:47 +0000 Message-ID: References: ,, In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:C4B4743F90FF4AE09007532BBBBC2EC8AF62EC73761DF57B4C525FF4F8FB9A0C;UpperCasedChecksum:6907A81A727735C938EC74D44ABD6D36E7EFB536301C83D12C2DC401CA445498;SizeAsReceived:7628;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [tetF5QszJkeJpDvn6/lj26ZNPpkHj+bE] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:SN1NAM04HT047; x-ms-traffictypediagnostic: SN1NAM04HT047: x-microsoft-antispam-message-info: egC3z3VEPP47OR2LOtCGYRaqb4H6hF3swz5FvvwH/jtFpPibuFhBMMQ4eqyHWwbO7ikE27FH765t9hfg7FQyiGaZxWT8Am4kdVXBcjFlcZfJJ4jlCCsicBC2jBAFE8YlcaJXZsFX2q8mf6/5WZAn5P+9cgp+qLio44bLeBrW81z1G8wdOVGKrKRLZK5ykj+X 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: a4c64e89-c380-4207-8ec2-08d7049b2452 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2019 18:27:47.1197 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM04HT047 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk And the point of the REINDEX at that point (below) is to remove dead tuple = keys-tids=0A= and reorganize those split pages back into physical order without losing t= he freespace.=0A= =0A= > From: Peter Geoghegan =0A= > Sent: July 9, 2019 1:47 PM=0A= > Subject: Re: REINDEX : new parameter to preserve current average leaf den= sity as new implicit FILLFACTOR=0A= > =0A= > On Tue, Jul 9, 2019 at 10:31 AM John Lumby wrote:= =0A= > > Yes, I see that. But surely "making splits occur less often" is a= desirable=0A= > > objective in itself, is it not? And I believe that a parameter to p= reserve the "steady-state"=0A= > > density in high-traffic indexes would help achieve that goal, wouldn'= t you agree?=0A= > =0A= > Anything that reliably reduces page splits without hurting space=0A= > utilization is well worthwhile. I can't see how what you describe=0A= > could have that effect, though. If you expect the leaf density to be=0A= > the same after a REINDEX, then why bother at all? There is no reason=0A= > to think that that will be more effective than simple vacuuming.=0A= > =0A= Ah, I did not explain the idea welll enough.=0A= The scenario (simplified) is this:=0A= Time 0 FILLFACTORs all set to default 90%=0A= because we do not yet know what the steady-state density=0A= will turn out to be.=0A= { workload runs for a few weeks }=0A= Time N gather table and index stats, discover growth and learn densi= ty.=0A= growth is more than autovacuum could control so=0A= { ALTER INDEX ??? SET (fillfactor =3D AUTO); }=0A= { REINDEX, desiring to preserve current density whatever this is= }=0A= { workload runs for a few more weeks }=0A= Time 2*N gather table and index stats, discover little or no growth si= nce time N.=0A= we have achieved steady-state in total number of pages.=0A= =0A= Would this not work?=0A= =0A= Cheers, John=