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 1tfZOA-003OVA-5Y for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Feb 2025 06:59:58 +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 1tfZO8-00CJxw-PI for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Feb 2025 06:59:56 +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 1tfZO8-00CJxo-Fo for pgsql-hackers@lists.postgresql.org; Wed, 05 Feb 2025 06:59:56 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfZO5-003NXB-1p for pgsql-hackers@postgresql.org; Wed, 05 Feb 2025 06:59:56 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-ab69bba49e2so953283266b.2 for ; Tue, 04 Feb 2025 22:59:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738738792; x=1739343592; 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=p71sOzXRcKtptpVudjBlHWOcxgA2ed+EDGOuOmpb+Rg=; b=hG7u2vZIotYNlNNoaXFrbnl4qxw35ButK0QRtTd3fqTI40BvMVi0sJZbdxsO6DewDs +6mKBLkPVZw3Fxs7jGeC3tTvkVVJNsZ9C4fMyIKBhUK8Hd9vkpTwMARLPJ0Bt1I7s/IY +fIUnn8ry8cbIoFHLqLI4dLvYZzKbXROxnrCsucBnyNYY49KC8LYyC+n1heA1C4s4dqq w7oE4u2s68yKsN/sQt1A6RdL7on9W/wJknO99OMuXeof0ykdtotOQmaGoTgPM46i0F6P SSLziU/d/vXRu/hPxn6lg/snBNui7WzkGC0e0kjHX/NrpNTW9p4wm2qNP4EDTsSYdFuK H2fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738738792; x=1739343592; 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=p71sOzXRcKtptpVudjBlHWOcxgA2ed+EDGOuOmpb+Rg=; b=ohC2w9UtyXrb6yjo3oscS6jG381qpSS4LdznleWjdjaI6b0u1EplJc0jPbjesV4LBh 3GZKsQV1/AWk1qM0ait1OoXgU2BvyxDZX9NvwOMVxYNN6mzsKptq57jPQb3hmMAQAcMs mtqpIlAdsGbHXWbjvR8LwFmMZB+Fh9x8CguW1FfPikLbsYl9hIGXBRX3Vt9zYB9R47ff 4/XYzIXtZfETAxhtuCWGRsGlodFzjKjeyl+zRMssHambai9HYiqWC+ojjvBu4Rxtw/W1 95sVs5vcBzzeFE1mqPsZII6zY3O2rwerw38SELCxx+nlYmt0ndQRk+fYpjoTaL3yDVaM zlaQ== X-Gm-Message-State: AOJu0Ywb40Z9iLDUJ3OZf05AUbJ29tWW9alZ3yN4fx7aMONZt/Qmonhs /WQjONbR5UvWCOEVVGWx1ovQVqIzi2NuOg8NXkMo+N1bJ6GGYZSfbxrjozhj6qB6EMOqByQ/7Bq ZOqQthU4GGjIl7wAJjGe+TKtoVM0= X-Gm-Gg: ASbGncsuk6Kog9Z8+RII/+eAWQwjr1voejyJuHtswXV7g51tbnxOOGzQm0+GCrk/X+J 3H0WO6RS3wsvaxogRni6o0VEu4B4JK19d9i2XzaGlrtgPwq4oixTWaTdjdTmRyJ2vugNxWFGS X-Google-Smtp-Source: AGHT+IEUre80ljxpMgccwsJWHB0aeBlcYTWzUIdHZBbag9lL5mNJJ7axtzU0Kxj1HUwWHyaK+tzFZ2IzB01/ks+6SWI= X-Received: by 2002:a05:6402:4404:b0:5d9:ad1:dafc with SMTP id 4fb4d7f45d1cf-5dcdb762de1mr3961702a12.25.1738738792077; Tue, 04 Feb 2025 22:59:52 -0800 (PST) MIME-Version: 1.0 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> <86f76aa5-1ab5-4e2e-9b15-405051852a2a@postgrespro.ru> <1e81a0a1-a63b-48fb-905a-d6495f89ab73@postgrespro.ru> <0b4eefc7-4c38-4caa-b2ca-a4c75dd7dd12@postgrespro.ru> In-Reply-To: From: Alexander Korotkov Date: Wed, 5 Feb 2025 08:59:40 +0200 X-Gm-Features: AWEUYZl_P4XtDtP5dO047nCDbkp86oPcXI9iLqkIoW5YX1eD67-9eB7Klczc7Hc Message-ID: Subject: Re: Vacuum statistics To: Alena Rybakina Cc: pgsql-hackers , Jim Nasby , Ilia Evdokimov , Kirill Reshke , Andrei Zubkov , Masahiko Sawada , Melanie Plageman , jian he , a.lepikhov@postgrespro.ru, Sami Imseih 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 On Tue, Feb 4, 2025 at 5:22=E2=80=AFPM Alena Rybakina wrote: > > Hi! Thank you for your review! > > On 02.02.2025 23:43, Alexander Korotkov wrote: > > On Mon, Jan 13, 2025 at 3:26=E2=80=AFPM Alena Rybakina > > wrote: > >> I noticed that the cfbot is bad, the reason seems to be related to the= lack of a parameter in src/backend/utils/misc/postgresql.conf.sample. I ad= ded it, it should help. > > The patch doesn't apply cleanly. Please rebase. > I rebased them. > > > > I see you introduced new GUC variable pgstat_track_vacuum_statistics, > > which should address the increased size of statistics. However, I > > don't see how it could affect the size of PgStat_StatTabEntry struct. > > It seems that when pgstat_track_vacuum_statistics =3D=3D 0, extended > > vacuum statistics is not collected but the size of hash table entries > > is the same. > > Yes, hash table entries will be the same but vacuum_ext structure stored > in PgStat_StatTabEntry will not be filled with statistics, although > vacuum_ext structure stored in PgStat_StatDBEntry will be fill be. What is the point for disabling pgstat_track_vacuum_statistics then? I don't see it saves any valuable resources. The original point by Masahiko Sawada was growth of data structures in times [1] (and corresponding memory consumption especially with large number of tables). Now, disabling pgstat_track_vacuum_statistics only saves some cycles of pgstat_accumulate_extvac_stats(), and that seems insignificant. I see that we use hash tables with static element size. So, we can't save space by dynamically changing entries size on the base of GUC. But could we move vacuum statistics to separate hash tables? When GUC is disabled, new hash tables could be just empty. Links 1. https://www.postgresql.org/message-id/CAD21AoD66b3u28n%3D73kudgMp5wiGiyY= UN9LuC9z2ka6YTru5Gw%40mail.gmail.com ------ Regards, Alexander Korotkov Supabase