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 1shXVX-003bis-NI for pgsql-general@arkaria.postgresql.org; Fri, 23 Aug 2024 16:51:27 +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 1shXVU-00F7aJ-EB for pgsql-general@arkaria.postgresql.org; Fri, 23 Aug 2024 16:51:24 +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 1shXVU-00F7aB-38 for pgsql-general@lists.postgresql.org; Fri, 23 Aug 2024 16:51:24 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shXVP-0018qA-H9 for pgsql-general@lists.postgresql.org; Fri, 23 Aug 2024 16:51:24 +0000 Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 4B8CC1151B2A; Fri, 23 Aug 2024 12:51:19 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Fri, 23 Aug 2024 12:51:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc: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=fm3; t=1724431879; x=1724518279; bh=vXdi2lpKSYLjpa/vs/gxqUxvvvzjRfuq6CpI7nKlfUM=; b= JbV7y+FQ7DSnJEsAny+6crvkhT9qLfWPFNgsL1fJayHOl/t2r/AqDaSClDqEPvwx T8vTmCNclmisEa+adttIGsTE5dDrOqH2AujhaP66/pkRWXqqBki7IkDLiuaUFcOE BsVP0uRJWzKnp3ooLktGOydhlGLdDCh8V5RjK5ScqfiA/pCdCnJEicGCJGMn8zrj KhA3UM0vIByxvMk/qSnNCgZnLXjypoeK74QxScrpbt/4uvMF4fCYJQ+qzrTgitwD xE1J2gJ3UUG5IeCb5ZP2M2bjmQkjQfORSDoh5zX00fhnS07utsyRA+thh7mrnifo A6Y+FWY+JA0odI9jXaEanw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; t=1724431879; x= 1724518279; bh=vXdi2lpKSYLjpa/vs/gxqUxvvvzjRfuq6CpI7nKlfUM=; b=n FjwvfVTI/nIKjl58mzdrXtVvpryHfk4MsFU17B7Jbol3cTZRqckeDgKnuH83tA7E RnodjiAmovV9Mp/BaUdkJYr49n0mfVoU1O5QJO7GGzzB7Kf/A1pXy36nD7eleeec J+BFS3gfbdWndn3+8y2sreONgQJcdk07cPqbxmAk0z2LcZwkpK0gXLlnOPLanjIa CsmBshPpTzUKOGJ0gKaqK93H3aYFUsE5MFZNix8mEw5O325ZJWFv0FbjzdNW5yKi snfekWB1tHRDIWfypdsibDjzjxbdnaVon1KzLrM9fUYYu2OdUuVErV06F6iYcYnZ n7eMblLejg7r13ijFiv9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvvddguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpefgudefkefhveefleev ieeuveehvdduudekuddvvdelhfeuueeijedtuedvvedvueenucffohhmrghinhepphhosh htghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnh gspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepmhhjthhi tggvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslh hishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 23 Aug 2024 12:51:18 -0400 (EDT) Message-ID: <5f0601fd-7ab9-4b40-9356-43c463223bed@aklaver.com> Date: Fri, 23 Aug 2024 09:51:17 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables To: Matthew Tice Cc: pgsql-general@lists.postgresql.org References: <19c4824f-24b8-4561-81c3-a2f4a7949803@aklaver.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 8/23/24 09:33, Matthew Tice wrote: > > > On Fri, Aug 23, 2024 at 10:26 AM Adrian Klaver > > wrote: > https://www.postgresql.org/docs/current/pgstattuple.html > > > pgstattuple_approx(regclass) returns record > >      pgstattuple_approx is a faster alternative to pgstattuple that > returns approximate results. > > Not sure how you get exact count out of that? > > > Maybe the wording is a little confusing to me. Under the section > for pgstattuple_approx: > "pgstattuple_approx tries to avoid the full-table scan and returns exact > dead tuple statistics along with an approximation of the number and size > of live tuples and free space." Yeah, see what you mean. The part that bears more investigating for this case is: "It does this by skipping pages that have only visible tuples according to the visibility map (if a page has the corresponding VM bit set, then it is assumed to contain no dead tuples). Wondering if PostgreSQl-compatible covers this? -- Adrian Klaver adrian.klaver@aklaver.com