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.96) (envelope-from ) id 1wuQVP-000htp-1j for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2026 08:09:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wuQVL-00Bsw4-1p for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2026 08:09:36 +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.96) (envelope-from ) id 1wuQVL-00Bsvv-0r for pgsql-hackers@lists.postgresql.org; Thu, 13 Aug 2026 08:09:36 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wuQVJ-00000000UqF-2Hoa for pgsql-hackers@lists.postgresql.org; Thu, 13 Aug 2026 08:09:36 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-47fd4531020so209093f8f.3 for ; Thu, 13 Aug 2026 01:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786608568; x=1787213368; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=wE5R1fjVTwJ7UE/foXRM41OKO/+J3EZBqWA2QqEimWY=; b=E+u6j4/UEsNFRdG8XVd9Dbe/QYPb+3Kkx6ztzk5YcOiZFzs0rswZCoylEVC272HHYw nsCXvAiSvB8R59/2U9KcvXHjhmbCoJdMGkNU9j1SbdRBk99Ig+cnawHjAsS6y966kGCv 5LR34VdO1xgUDF8aW1MP1rvTEg+wslL0I+ZJEi+qcUn2thjPrpYqp2mPv2r3KdY9kNVY TLLpzjqFKcxvaCyrsoOaPUo7cF68RfnEpX48BDcxLQ8mjpV0ZXRpPvBl0zCg++phMs5z aIT0IOm3gGCHoWjffBR4z4IxSGHudUUEOr6f/1S7RsFBpak/oJZyQoueMvNTyYhQ1ufX 2pFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786608568; x=1787213368; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=wE5R1fjVTwJ7UE/foXRM41OKO/+J3EZBqWA2QqEimWY=; b=d8m4ZkjNmvAJuFbz45pWDiBBzSGpGR54f+OxLbRc/KNiBmwQLjXlAKjDn7dP83ry+G KaKwbaPmC5rK2cK7sGvFbXXyhnabbGBN46lnX7kTjIsrisXsbzyVGSz5DiPcCFbbaTwu iG+XHBpD0YQBMIgp6phKycCikVOy3aHcyz/KilZOTOaclU0pK8YYAqgq8uOEOXZjN/t8 K676+g8gH6+bSHm4Ofo6gSODVCuAw7ol23H16lR0C8wuMtxp5hFfj28nkFfXoWB+UpxX Wg2O9VsvCZhdl5/frcROPN0PFDkMAIqHZoaY8J9QRU/AqB+G2Q7QkKcyRmB2+y3imTPH CbRw== X-Forwarded-Encrypted: i=1; AHgh+Rr+MJwe04gS+WkNDKOspjjiRJtk2WBNlToO3ugWQxQEJq+cQOfPbMyUdkc+zPzcfH7HTG7wT3zkW4O37mUH@lists.postgresql.org X-Gm-Message-State: AOJu0Yy5qizkUss3kCizaX1heanUMSiiKMEuSrfcltBlHNsbIagjDTQx pl4MdMp0TGXg3ips0dzwiPOqIwmllR6+oAmEuZ7zZCI8hQZeouU9IzhY X-Gm-Gg: AR+sD135PSn/kNBrLInDQHQgPd71+7tg0CoXSZrj653kfqYQERnafCo8pHXBvhqtzAM Uu2rEeu7n/yDpflmpY2sH0TQFeJ3KErC0BqGm4h2tJiHoaVuZ9Ua0QW+ci4oaVro/U/t/kre5pn FESg+4HcqKzDV8IH6myBVtt/I0aNmj4B+ZVISB4uLRrA/wvO/nGqI416o+hWqbKFxX+TInUUtpC UnJ4KEZL6jLHI4y5O8KQcSPCv4IYEAvcHWDJn3T/f71T3Ev+iDpxSYZ2UrPTSl/qf66V+dk6//0 ykqhlTUx3H220y4QniIbq3vgaf43B2jKnQpT/2GRJyLzX+qhkcYq1hYAYNbhjgHXcFlqi7MFgGU q7YL1UBhGYXefk9I3kB/I63KCdjOBUvyVOTii67MvMGYiy8/jfjeVQuw7/pgnr4Y06mwiM964Bm qjq9yiQV51Wc355X9/iH7bKrCzEIkCx+3K2EvxWt1W9bajpyGF53mZZrYKW/4j0VVvIj8qygZhF w8PuwgXEJxNLRyRF4FMbkwsS/aCl4X2S0ND60BRHMJFX7TWbzh3yzGpRik= X-Received: by 2002:a05:6000:4108:b0:47f:97a4:f121 with SMTP id ffacd0b85a97d-4815a065ca8mr4830887f8f.30.1786608567626; Thu, 13 Aug 2026 01:09:27 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a56123asm4929672f8f.8.2026.08.13.01.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 01:09:27 -0700 (PDT) Date: Thu, 13 Aug 2026 08:09:25 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Andres Freund , Kirill Reshke , Robert Haas , pgsql-hackers@lists.postgresql.org Subject: Re: relfilenode statistics Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Jul 10, 2026 at 03:05:35PM +0900, Michael Paquier wrote: > - 0003 Thanks for sharing this! Now that the table/index split is (almost) in, let's focus again on the relfilenode statistics. > property that I do not wish to keep around is the aggregation of > counters across rewrites, as the new counters don't make sense once we > switch to a new relfilenode. I think we should first agree on this point before looking further at 0003. As written, the existing pg_stat_all_tables tuple related counters would be reset by a rewrite. The concern I see is how these statistics are currently used: relation_needs_vacanalyze() uses dead_tuples, ins_since_vacuum, and mod_since_analyze for its three tuple based vacuum or analyze decisions. For example, a SET TABLESPACE move allocates a new relfilenumber but only copies the relation’s storage. The previous counters are not transferred, so they are read as zero for the new relfilenumber. A table that was eligible for vacuum or analyze before the move may therefore no longer be eligible. Do you agree that rewrites should not reset these counters? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com