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 1suFVz-005Mlm-Hn for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 18:16:28 +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 1suFVy-00D7K6-Dq for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 18:16:26 +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.94.2) (envelope-from ) id 1suFVy-00D7Ju-28 for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 18:16:26 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1suFVr-001MCr-ET for pgsql-hackers@postgresql.org; Fri, 27 Sep 2024 18:16:24 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-535be093a43so3038238e87.3 for ; Fri, 27 Sep 2024 11:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727460977; x=1728065777; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QewiyWPKF/UC3QG51tWSf6O7zw9nJtq6YiaLgkNLD9Q=; b=IRW8DJ2wFT5FMsHUN+NK1pTP/NsloZ6S4uNaWJ4MbyxEbKVeIKBByzQ0E1kDrlQJxT ZZS/8ajSqxKO4jC3zd7qnvLVT8wbG05id4IDILp4y62zLuYoXcxXvYIU/yY7Gh6epkAp +fTMH98j94fawO06HgxfCsk6oqoESJHGHbDUn2OCYtsitOR62dIGLTjv3ZikD/PDVLwL 3/4ChtXrON57X2tzdBS1K0+G3mppOKcZxx1vivJr+ENgenQbe2W94JnCaYTgFWV7aFHF MdikIfn6EnujV8PznmroL41W5LaMyJ/aX/HeiXXNlBnfrZlDMj5y2AJG3nVqmO82i4XS hzgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727460977; x=1728065777; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QewiyWPKF/UC3QG51tWSf6O7zw9nJtq6YiaLgkNLD9Q=; b=qKBDusoTEdKHbmOborEZQNTjAeZBApC7CBYyJtMmnwu96xhc8ZBdBC9eGbSSr1IkRG yvNO9o0I+j1+4GfHqoWPZdp+DslZNTKdb9G0hqTRuM9Dz+81+xaMSujV79ZbT7LjWVWr 1x6/ERCO4PXOeiv5JiZZ7Yy/UnDu1LtoZsu5wwbzC/gwcEAgFJZtcicgqfSZ2NafJnXL nJXx7dwF8zR8S/ZT1ujSLwKY8olFIc+FZjeg3m1qCUYcEcYyEj148O822OV89vMx13yF YuO18SdYf5msIX4aenmvTd2jG8ZYJ9B/vjwniMNbPTimyY6u5noHKbMJ2NeoO4XQ4a3i ZIQQ== X-Forwarded-Encrypted: i=1; AJvYcCUH0dMF/kcnHqhmvV8kNvJQbmKxjV2Y/cMZtaira7DKTH5doEubypJVN0S36m2YOKf4hmiZlumXeWKNWnqT@postgresql.org X-Gm-Message-State: AOJu0Yw+plQrRqgLi/Z/bbdC/HdlgvnGQVxW82KdonmU7qprhQnj9HbP hR9EHDubeP1P0Us7WWbiP8sq9b5pI5153VjIqLN9Cmf1rOanRr9PKG4XBb5KVlcrqeYfSFik10q lj88GxMa4CxM82OI98bNbJXxvI8E= X-Google-Smtp-Source: AGHT+IHfxdNaVN5Ae0/aCy5tp6r5SvqrVloUIYcoBU9FcDqESLhuiCUy3Oufow9kpfGDDMuiGDnC0iHDGSO3WwXzAWY= X-Received: by 2002:a05:6512:ad2:b0:52c:dfa2:5ac1 with SMTP id 2adb3069b0e04-5389fc39e26mr2810138e87.24.1727460976678; Fri, 27 Sep 2024 11:16:16 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <9b10c6d3-52c4-4eef-b67c-c33442667729@postgrespro.ru> From: Masahiko Sawada Date: Fri, 27 Sep 2024 11:15:39 -0700 Message-ID: Subject: Re: Vacuum statistics To: Alena Rybakina Cc: jian he , Alexander Korotkov , Ilia Evdokimov , Andrei Zubkov , Alena Rybakina , pgsql-hackers , a.lepikhov@postgrespro.ru Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Sep 5, 2024 at 2:01=E2=80=AFPM Alena Rybakina wrote: > > Hi! Thank you for your review! > > On 05.09.2024 15:47, jian he wrote: > > On Thu, Sep 5, 2024 at 1:23=E2=80=AFAM Alena Rybakina wrote: > > Hi, all! > > I have attached the new version of the code and the diff files > (minor-vacuum.no-cbot). Thank you for updating the patches. I've reviewed the 0001 patch and have two comments. I think we can split the 0001 patch into two parts: adding pg_stat_vacuum_tables system views that shows the vacuum statistics that we are currently collecting such as scanned_pages and removed_pages, and another one is to add new statistics to collect such as vacrel->set_all_visible_pages and visibility map updates. 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, and per-relation block I/O statistics can be collected using pg_stat_statements. Having duplicated statistics consumes more memory for pgstat and could confuse users if these statistics are not consistent. I think it would be better to avoid collecting duplicated statistics in different places. Regards, --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com