Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKl2a-00BuxH-Fx for pgsql-general@arkaria.postgresql.org; Fri, 21 Jun 2024 20:39:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sKl2Y-009Vvd-UG for pgsql-general@arkaria.postgresql.org; Fri, 21 Jun 2024 20:39:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKl2X-009Vte-Hh for pgsql-general@lists.postgresql.org; Fri, 21 Jun 2024 20:39:22 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKl2T-002sjV-Rn for pgsql-general@lists.postgresql.org; Fri, 21 Jun 2024 20:39:21 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 0506013802A6; Fri, 21 Jun 2024 16:39:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 21 Jun 2024 16:39:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1719002355; x=1719088755; bh=/6c7nxzhMM8z+RHHhQy3Q1ErJnIiqeM9vO2SUlw+0h4=; b= kLZYwfZbYkinEr1Oocl8jkf3j7gw4DrlK/liRxwLBVroCWIwyo902O6QgEITv29m jTVlGBGgbPEpdE84/gxXyyUBpTKesubOFn3CQKfaaVQTN3JDCaBKa2DXWFWa6C/+ CACMJlyPGHlgm0ZqZBIVLq0AtdwOwP0XvOqI+Qu397yeEu283Y4yv/raYuBT552i VUpR39dnYyOe1Lh00P3oEGs5TVbAAKtmSXfYS7JDoeqQk9yM/Bzizd0DTtomW2KQ sytJwdmL/KCmWaGYVw9xKnrOvuQYuHRsWGENFErENsgPdYuCbZr23qgZk94ll7F/ VizH/f6CQhde9fU7zKXSug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719002355; x= 1719088755; bh=/6c7nxzhMM8z+RHHhQy3Q1ErJnIiqeM9vO2SUlw+0h4=; b=K K2Rsrklmak8nkHnBPPT5p1CIjWlJor2boxkxqbvC8CIuPSCCuLq719AzpDtv1k9P EQbBRPlMVPF6X6YsbJWBKIczeD8WXH2dCyRrGskcjFy0j2q25GiJRGFHDu33nbc6 p43lxpCocwA91i2pSkLXUB9dQFAaxI5u8qF8eOZADfU2ZYb3zWNQ/2Lunn0PE0wO nPszjbs8xAdMj6JfjoPw6AOAuW11GzUp/l7KSFt8tvQIVFyjnRCx+fnKj5TYN/X/ ZrXdQVpaqq1FHlvJkeY2c94Y9LnG6kasaZyZtwSAsKuHQTLqI/pyyG7fdKk/eLJG mKvjJa7k7kUcOhVFjAKmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefgedgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepleegveekkeekueeigfdtveeileeuhfefudefteek jeffkeejueejheegheegkedtnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughr ihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Jun 2024 16:39:13 -0400 (EDT) Message-ID: <53da5a20-ca35-40fa-85a3-c59d4302a512@aklaver.com> Date: Fri, 21 Jun 2024 13:39:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Autovacuum, dead tuples and bloat To: "Shenavai, Manuel" , Achilleas Mantzios , "pgsql-general@lists.postgresql.org" References: <2f2aafe6-3e29-4305-a279-1b3d56e9389e@cloud.gatewaynet.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/21/24 12:31, Shenavai, Manuel wrote: > Hi, > > Thanks for the suggestions. I found the following details to our > autovacuum (see below). The related toast-table of my table shows some > logs related the vacuum. This toast seems to consume all the data > (27544451 pages * 8kb ≈ 210GB ) Those tuples(pages) are still live per the pg_stat entry in your second post: "n_dead_tup": 12, "n_live_tup": 819294 So they are needed. Now the question is why are they needed? 1) All transactions that touch that table are done and that is the data that is left. 2) There are open transactions that still need to 'see' that data and autovacuum cannot remove them yet. Take a look at: pg_stat_activity: https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW and pg_locks https://www.postgresql.org/docs/current/view-pg-locks.html to see if there is a process holding that data open. > > Any thoughts on this? > > Best regards, > Manuel > -- Adrian Klaver adrian.klaver@aklaver.com