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