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 1vVSEM-003zWV-0J for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Dec 2025 10:24:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVSEK-005qpf-2L for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Dec 2025 10:24:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVSEK-005qpU-1O for pgsql-hackers@lists.postgresql.org; Tue, 16 Dec 2025 10:24:33 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVSEJ-000wpX-1u for pgsql-hackers@lists.postgresql.org; Tue, 16 Dec 2025 10:24:32 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-477632d9326so27120075e9.1 for ; Tue, 16 Dec 2025 02:24:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765880670; x=1766485470; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IMknjMq9RyPr6Z98pUj3Rf+K6cpftL2ciynugZgamzs=; b=CK1aO4czNoROh7Sd9c78tzutv92gvtTD9DtzPbolZXNnElq44wFS1l/M39qn4y8pkZ thQ649SdgzYe51LZgJeOeXjK/sgz+smFoxUvuYTqzl3Rp9zFPt63ShLUWPusBQeQuZ+r B+fMgbOEBl9/xd7dlt1I2ofieJ4I7bbzgtkD10geA2b/gsUxsFZFcn7AyQFP2HeTKCHr ZNV8WM7WUkYBSI5FnccSvLB0i9r/YlCudG3urIT0c1ePRTxrwXrxSuG2xxwStjO+8IXE 9S2p+o8l103RpMUMz7ChQ7FiBQG/0kqfVHQzG4r2dragpcnU0/Pm8u00rETiCTXaOpJm l3Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765880670; x=1766485470; h=in-reply-to:content-disposition: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; bh=IMknjMq9RyPr6Z98pUj3Rf+K6cpftL2ciynugZgamzs=; b=wHxGuvbX4Fyvvr6I2yn3rz/xecuXqrO7YC4UrMhGUfHkSTuQe3L82MX3vW+0HpLtq7 7ZEwsiwRDv2Bth+gYfcpAIx8zdl45vHHW5vLbvysnaGHe8oxOdsZJzTfn7skoPZVbXSw 4G3Dw38qFVHSZ4I0ow6cgNxtCxpZsHD7au1Tyc0BMGTnbmFkH34FTHqwlpiNlp4MXPbB K5GKib/y/0hdCCw+KLubeHwd9ZuCFyM8Ox1IGfu5xhssyFagi9YdWMVq6JIjiAk3Ooi/ PcQjQQH4etRnJIU1x73bvwk71a95cxr3+KlWwN2PlLVcEn933xnkJbznya8+h0H+Ze9I B+EQ== X-Forwarded-Encrypted: i=1; AJvYcCXGTCs4Q45ZF1e8+diKaAyexBNyalZ0Jals7MJa9qc18Ab7R06G48z7gWTAPDX5q6UcljJR31RgL7StEBAK@lists.postgresql.org X-Gm-Message-State: AOJu0Yx6du3NHV/pCObyNVPehB8iTVlP89NNh0L4cn2dpzptEuJDOPud jbc+4OfJxyMpk/EavLmum5zFx3w6ddNH2S8ziCNJQ7febQkqacg/QBEo X-Gm-Gg: AY/fxX4lbqnSYU2i1sKTRmlkeU1evscjWifUeHlKe6gz0IfLOtqBf4iZ8RlEx6ixZZz KiQwn699Wa7IJqEjc81JZkXGmE1vjvfWpxJwTtVcuHFE8IXblLghCvhyMu7YVwnq5wLFthCp3HR i2s0DlfVOG9CPCP8BxTYNamZcmXLUpR7WxjleOD49VKtQxuv5Ita4KKBAuwSQbp6AfpEU/eGme3 FnQNlrNSmW4AXw48eR6+w945Ba1Qz8DBYQQUzE7wodIrkvikaerCHjEmKvGXjmQhtDUbUU+DqJA I7OlyIu12aQQJkvD0CU6z6j1wWknbVZNpwxUkoSMKja4Z8QjKLY7pfLVCjtV5qP1b3Go6T4tEDT p0LqnR4MS7jySyiP+g5uZanBG+SgjQf39YVgQwcgjPhnBs2BjF6KPRMVZSZRnvrDiFl6FJEDal8 wMzhYpAzqLUHoUF0Qke/8NRiYEO/Ws9jeddnfIUV/6J2TI4pscibMtmTOQsXIEZTVjRrw/m30ZE W/J0MnNuPqsUAf0oLA0qusb+Rht+7fUVTTlsTNl98zzpw== X-Google-Smtp-Source: AGHT+IFTnMmDHPNwIWaFNUDiWs8LHPZFWecIJ/7Oqvl9a6a20oegm3WJ1WBMq6ExVZuLNOROc8dWXg== X-Received: by 2002:a05:600c:470e:b0:471:13fa:1b84 with SMTP id 5b1f17b1804b1-47a8f8c0527mr159483295e9.12.1765880669772; Tue, 16 Dec 2025 02:24:29 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bd9965f70sm6020555e9.19.2025.12.16.02.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Dec 2025 02:24:29 -0800 (PST) Date: Tue, 16 Dec 2025 10:24:28 +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=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Dec 16, 2025 at 04:33:17PM +0900, Michael Paquier wrote: > > Hence, why don't we split PgStat_StatTabEntry into three things from > the start, even if it means to duplicate some of them? Say: > - Table fields: includes [auto]vacuum/analyze data, block fields, > fields of pg_stat_all_tables. > - Index fields: no need for the [auto]vacuum/analyze time and counts, > block fields, pg_stat_all_indexes fields. > - Relfilenode fields: dead_tuples, ins_since_vacuum and > mod_since_analyze. Does not apply to partitioned tables and indexes, > only applies to tables. Provides a clean split, embrace the fact that > these are the only three fields we need to worry about during > recovery. I think that the PSEUDO_PARTITION_TABLE_SPCOID just proposed in [1] approach is simple enough and solves the collision issue raised by Andres. I think I prefer the unified structure as proposed in the patch (though we may want to split tables and indexes later on). The reason is that it's easier to expose publicly. Indeed, at the very beginning of this thread, in v1, I created a new PGSTAT_KIND_RELFILENODE and had to make it coexist with PGSTAT_KIND_RELATION and that led to discussion on how we should expose them ([2]). [1]: https://www.postgresql.org/message-id/aUEyzoOJtrCLAEeT%40ip-10-97-1-34.eu-west-3.compute.internal [2]: https://www.postgresql.org/message-id/CA%2BTgmoZtwT6h%3DnyuQ1J9GNSrRyhf0fv7Ai6FzO%3DbH0C9Bf6tew%40mail.gmail.com Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com