Re: Vacuum statistics

From: Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Jim Nasby <jnasby(at)upgrade(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Andrei Zubkov <zubkov(at)moonset(dot)ru>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, a(dot)lepikhov(at)postgrespro(dot)ru, Sami Imseih <samimseih(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>
Subject: Re: Vacuum statistics
Date: 2025-05-09 12:03:55
Message-ID: 2a04ad18-5572-4633-848b-eb57209e7ac0@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, all!

On 25.03.2025 09:12, Alena Rybakina wrote:
>
> Hi! I rebased the patches again - PGSTAT_FILE_FORMAT_ID needed to be
> fixed.
>
On 05.02.2025 09:59, Alexander Korotkov wrote:
> 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%3D73kudgMp5wiGiyYUN9LuC9z2ka6YTru5Gw%40mail.gmail.com
I did a rebase and finished the part with storing statistics separately
from the relation statistics - now it is possible to disable the
collection of statistics for relationsh using gucs and
this allows us to solve the problem with the memory consumed.

For now I have formatted all this as a diff file. The diff file must be
applied after all patches have been applied. While looking at it I
noticed that the code requires significant code refactoring, so I will
do that.

--
Regards,
Alena Rybakina
Postgres Professional

Attachment Content-Type Size
v22-0001-Machinery-for-grabbing-an-extended-vacuum-statistics.patch text/x-patch 71.3 KB
v22-0002-Machinery-for-grabbing-an-extended-vacuum-statistics.patch text/x-patch 57.9 KB
v22-0003-Machinery-for-grabbing-an-extended-vacuum-statistics.patch text/x-patch 31.1 KB
v22-0004-Add-documentation-about-the-system-views-that-are-us.patch text/x-patch 24.5 KB
vacuum_stats.diff text/x-patch 37.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-05-09 12:04:49 strange perf regression with data checksums
Previous Message Stepan Neretin 2025-05-09 10:57:35 Re: [PATCH] avoid double scanning in function byteain