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 1tXIdY-005Mlb-MO for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jan 2025 11:29:41 +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 1tXIdX-009xPO-EI for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jan 2025 11:29:39 +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 1tXIdW-009xPF-VU for pgsql-hackers@lists.postgresql.org; Mon, 13 Jan 2025 11:29:39 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXIdU-000APY-24 for pgsql-hackers@postgresql.org; Mon, 13 Jan 2025 11:29:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1736767772; bh=AnVh0j4DJ7Pr0cBI6X/icT6BJmPhZYufg4sI7qa945c=; h=Message-ID:Date:User-Agent:Subject:From:To:Cc:References: In-Reply-To:From; b=RFMpmYcD7z6gifhE0Q1vEwUixeinKBLllg9y5dbZj/HvG+v1KXIIVi+muRCrC+XZb 6k3cmmAMW6A11YJ0KH6x5eDif4+bHGER/lgd4+aeDVZFReE+EhEb89W7MLIz2duFwb Ad78j0EhSLbvNd57QPfBOmtJiVftgHx4pb1emqxzCVMcfaqOu37TINTvJ0m7R1s6tq HvrEH5T9+UyZmnZDMLLQINN/WbY2930lxpbd7TkFM4yr7UthLhzBkmgVmGJlvQ4FTW pjgQd9OAI6FdGZIb1x23akls2nmN86oDwsmurYM9uC2k66oIbQE7DqbXFg/dZiNQ2H U7dSEhRMe3gHQ== Received: from [10.4.12.74] (unknown [93.174.131.141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.rybakina@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 08CF76025E; Mon, 13 Jan 2025 14:29:32 +0300 (MSK) Content-Type: multipart/alternative; boundary="------------yrOBMZ39EuJ1gYhiYHRw9Nzt" Message-ID: <91065110-624a-4b9d-960e-e5fddee85e1d@postgrespro.ru> Date: Mon, 13 Jan 2025 14:29:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Vacuum statistics From: Alena Rybakina To: Alexander Korotkov Cc: Jim Nasby , Andrei Zubkov , Masahiko Sawada , Melanie Plageman , jian he , pgsql-hackers , a.lepikhov@postgrespro.ru References: <9485d892-fd04-4e3a-ac24-7dd767cb7333@postgrespro.ru> <0B6CBF4C-CC2A-4200-9126-CE3A390D938B@upgrade.com> <6732acf8ce0f31025b535ae1a64568750924a887.camel@moonset.ru> <5AA8FFD5-6DE2-4A31-8E00-AE98F738F5D1@upgrade.com> <85b963fe-5977-43aa-9241-75b862abcc69@postgrespro.ru> <9C7A167C-DCDE-4A17-9ABE-6276723FEC50@upgrade.com> <2d493cf9-9ba7-4cc1-a3f2-67afd7c163ee@postgrespro.ru> <30d54302-9e9c-4e04-819e-a13b679cdcc8@postgrespro.ru> Content-Language: en-US In-Reply-To: X-KSMG-AntiPhishing: NotDetected, bases: 2025/01/13 09:45:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/01/13 07:04:00 #26996016 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------yrOBMZ39EuJ1gYhiYHRw9Nzt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10.01.2025 17:51, Alena Rybakina wrote: > > Hi! I thought about this problem again and I think I have a solution. > > On 02.12.2024 23:12, Alena Rybakina wrote: >>> * I've read the previous discussion on how important to keep all these >>> fields regarding vacuum statistics including points by Andrei and Jim. >>> It still worrying me that statistics volume is going to burst in about >>> 3 times, but I don't have a particular proposal on how to make more >>> granular approach. I wonder if you could propose something. > We can collect statistics on databases at all times - there are less > compared to vacuum statistics of relations, but they can give enough > information that can hint that something is going wrong. > With the track_vacuum_statistics guc we can cover cases of collecting > extended and complete information: when it is enabled, we will collect > vacuum statistics on relations both: heaps and indexes. > This will not lead to a synchronicity between constant database > statistics and temporary statistics of relations, since our vacuum > statistics are cumulative and it is assumed that we will look at > changes in statistics over a certain period. > What do you think? I implemented this in my latest patch version [0]. [0] https://www.postgresql.org/message-id/1e81a0a1-a63b-48fb-905a-d6495f89ab73%40postgrespro.ru -- Regards, Alena Rybakina Postgres Professional --------------yrOBMZ39EuJ1gYhiYHRw9Nzt Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 10.01.2025 17:51, Alena Rybakina wrote:

Hi! I thought about this problem again and I think I have a solution.

On 02.12.2024 23:12, Alena Rybakina wrote:
* I've read the previous discussion on how important to keep all these
fields regarding vacuum statistics including points by Andrei and Jim.
It still worrying me that statistics volume is going to burst in about
3 times, but I don't have a particular proposal on how to make more
granular approach.  I wonder if you could propose something.
We can collect statistics on databases at all times - there are less compared to vacuum statistics of relations, but they can give enough information that can hint that something is going wrong.
With the track_vacuum_statistics guc we can cover cases of collecting extended and complete information: when it is enabled, we will collect vacuum statistics on relations both: heaps and indexes.
This will not lead to a synchronicity between constant database statistics and temporary statistics of relations, since our vacuum statistics are cumulative and it is assumed that we will look at changes in statistics over a certain period.
What do you think?

    

I implemented this in my latest patch version [0].

[0] https://www.postgresql.org/message-id/1e81a0a1-a63b-48fb-905a-d6495f89ab73%40postgrespro.ru

-- 
Regards,
Alena Rybakina
Postgres Professional
--------------yrOBMZ39EuJ1gYhiYHRw9Nzt--