Re: Vacuum statistics - Mailing list pgsql-hackers

From Alena Rybakina
Subject Re: Vacuum statistics
Date
Msg-id 3f9c57bc-dc1f-4ad8-a2e1-5be15ac79264@yandex.ru
Whole thread Raw
In response to Re: Vacuum statistics  (Alena Rybakina <lena.ribackina@yandex.ru>)
Responses Re: Vacuum statistics
List pgsql-hackers
I developed a patch with a different approach - using custom statistics. 
As in the previous approach, I store statistics separately in slots for 
relations and for databases. It was also necessary to introduce a hook, 
and all control is handled through an extension. Statistics collection 
in the core occurs only if the hook is defined (i.e., the extension is 
added to shared_preload_libraries).
The extension is also controlled by additional gucs that allow disabling 
vacuum statistics collection, or collecting statistics only for system 
relations, only for user relations, or only at the database or relation 
level.

For now, I have divided them into several categories: general statistics 
(including the number of removed tables and tuples, and how many times 
wraparound prevention occurred), cost-based statistics, buffer 
statistics, and timing statistics. Memory is dynamically freed or 
allocated when the corresponding guc configuration changes. This 
approach is still a work in progress.

In the README and documentation in the extension, I also added 
information about how much memory will be used to store the objects 
(approximately 300 KB) and added the function to measure memory 
consumption.

Currently there are three patches:
The first patch still collects statistics about frozen pages and pages 
where the visibility flag is cleared.
The second patch implements statistics collection in the core, but 
without storing them.

The third patch is the extension itself, where the statistics are stored 
and displayed, with the control mechanisms described above.


-----------
Best regards,
Alena Rybakina

Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Simplifies checks (src/bin/pg_dump/pg_backup_archiver.c)
Next
From: Manni Wood
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD