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 1suGag-005VB0-Su for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 19:25:23 +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 1suGaf-00DyrA-RT for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 19:25:21 +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 1suGaf-00Dyqe-HZ for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 19:25:21 +0000 Received: from relay161.nicmail.ru ([91.189.117.5]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1suGaa-001P31-VZ for pgsql-hackers@postgresql.org; Fri, 27 Sep 2024 19:25:20 +0000 Received: from [10.28.136.255] (port=40138 helo=localhost) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1suGaZ-000000001yj-3kGd; Fri, 27 Sep 2024 22:25:16 +0300 Received: from [78.107.250.17] (account zubkov@moonset.ru HELO localhost) by incarp1105.mail.hosting.nic.ru (Exim 5.55) with id 1suGaZ-006MRp-2K; Fri, 27 Sep 2024 22:25:15 +0300 Received: from [192.168.61.161] by localhost with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1suGaY-008Nt3-Ud; Fri, 27 Sep 2024 22:25:14 +0300 Message-ID: <11b9f9f053edf5a4909cd7a19ca4cd162ac398f2.camel@moonset.ru> Subject: Re: Vacuum statistics From: Andrei Zubkov To: Masahiko Sawada , Alena Rybakina Cc: jian he , Alexander Korotkov , Ilia Evdokimov , pgsql-hackers , a.lepikhov@postgrespro.ru Date: Fri, 27 Sep 2024 22:25:14 +0300 In-Reply-To: References: <53c47c2d-72a5-44f2-900c-9973b2af1808@tantorlabs.com> <4a902cea-54fb-41b5-b208-b84731a5f577@postgrespro.ru> <092adec6-4eae-4bd4-bd0d-473a9df1282b@tantorlabs.com> <3deae1bd-ad84-4459-a26e-04c9136b84e9@postgrespro.ru> <9b10c6d3-52c4-4eef-b67c-c33442667729@postgrespro.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-MS-Exchange-Organization-SCL: -1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, 2024-09-27 at 11:15 -0700, Masahiko Sawada wrote: > I'm concerned that a pg_stat_vacuum_tables view has some duplicated > statistics that we already collect in different ways. For instance, > total_blks_{read,hit,dirtied,written} are already tracked at > system-level by pg_stat_io, pg_stat_vacuum_tables.total_blks_{read,hit,dirtied,written} tracks blocks used by vacuum in different ways while vacuuming this particular table while pg_stat_io tracks blocks used by vacuum on the cluster level. > and per-relation block I/O statistics can > be collected using pg_stat_statements. This is impossible. pg_stat_statements tracks block statistics on a=20 statement level. One statement could touch many tables and many indexes, and all used database blocks will be counted by the pg_stat_statements counters on a statement-level. Autovacuum statistics won't be accounted by the pg_stat_statements. After all, pg_stat_statements won't hold the statements statistics forever. Under pressure of new statements the statement eviction can happen and statistics will be lost. All of the above is addressed by relation-level vacuum statistics held in the Cumulative Statistics System proposed by this patch. --=20 regards, Andrei Zubkov Postgres Professional