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 1m0k9C-0001TN-5H for pgsql-general@arkaria.postgresql.org; Tue, 06 Jul 2021 12:25:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m0k9B-0000mk-0H for pgsql-general@arkaria.postgresql.org; Tue, 06 Jul 2021 12:25:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0k9A-0000mb-6V for pgsql-general@lists.postgresql.org; Tue, 06 Jul 2021 12:25:52 +0000 Received: from wforward2-smtp.messagingengine.com ([64.147.123.31]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0k94-0006Ij-MM for pgsql-general@lists.postgresql.org; Tue, 06 Jul 2021 12:25:51 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id E47381AC02B3; Tue, 6 Jul 2021 08:25:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 06 Jul 2021 08:25:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=yEzSY/QnLAygwPQs5Q6UCRIGI7/8goB8Qz6etsQR0 UA=; b=aJUGCmWbbWIgfs0X/4BDownZa5ZgReNnMdFlS9KgPZyXF3NG/1S8znDD7 NKHo9ObIKaRj1vb9VCUk6NIDhnsUldqjogb4wgPa5GUSGvUIHGZTcBKZovODycxo 6Le9vq0J1SFxxB+85q0kaRb2w+PWehjCmHLN7Pi1NOO67zxopsCkVR42EFAHWtSb xJGr15VkD1wKo1xblORl/G1KEdgBU/J5XdHfleYbC13wLtBXlLUPW4aO9q7ZWrm5 nr2OZoWmOhHXbcbjYEi25sjOqk6cLzbShsxTFn0539E7v5WcATw/jzKIlwLUK5hd ybwQjK1laREd3v7RqyK/VzFsXCQiw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrtddtgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpedtvdevtdfglefftdettefg hfeitdekueekhfehueegieelgeekfeetueelieelheenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusg drtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Jul 2021 08:25:41 -0400 (EDT) Subject: Re: When to REINDEX a serial key? To: Ron , PostgreSQL General References: <7e6be66c-7bb7-58ff-a490-0837dd73424a@gmail.com> <4cc31261-a074-f756-9739-c53400dd298b@gmail.com> From: Peter Eisentraut Message-ID: <24a46851-843e-ce3b-1c63-bffdf72eb429@enterprisedb.com> Date: Tue, 6 Jul 2021 14:25:39 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <4cc31261-a074-f756-9739-c53400dd298b@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06.07.21 14:19, Ron wrote: > On 7/6/21 4:52 AM, David Rowley wrote: >> On Tue, 6 Jul 2021 at 21:35, Ron wrote: >>> The legacy RDBMS which I used to manage has a tool for analyzing (not >>> in the Postgresql meaning of the word) an index, and displaying a >>> histogram of how many layers deep various parts of an index are. >>> Using that histogram, you can tell whether or not an index needs to >>> be rebuilt. >>> >>> How does one get the same effect in Postgresql? >> There are a few suggestions in >> https://wiki.postgresql.org/wiki/Show_database_bloat > > How does bloat relate to a lopsided b-tree? There is no such thing as a lopsided B-tree, because a B-tree is by definition self-balancing. Perhaps that answers your original question. Bloat is generally something people are concerned about when they think about reindexing their indexes. But append-only workloads, such as what you describe, normally don't generate bloat.