Re: Vacuum statistics

Alena Rybakina <a.rybakina@postgrespro.ru>

From: Alena Rybakina <a.rybakina@postgrespro.ru>
To: Masahiko Sawada <sawada.mshk@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>, Andrei Zubkov <zubkov@moonset.ru>
Cc: jian he <jian.universality@gmail.com>, Alexander Korotkov <aekorotkov@gmail.com>, Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>, Alena Rybakina <lena.ribackina@yandex.ru>, pgsql-hackers <pgsql-hackers@postgresql.org>, a.lepikhov@postgrespro.ru
Date: 2024-09-28T21:22:28Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Move wal_buffers_full from PgStat_PendingWalStats to WalUsage

Hi! Thank you for your interesting for this patch!
>> I took a very brief look at this and was wondering if it was worth
>> having a way to make the per-table vacuum statistics opt-in (like a
>> table storage parameter) in order to decrease the shared memory
>> footprint of storing the stats.
> I'm not sure how users can select tables that enable vacuum statistics
> as I think they basically want to have statistics for all tables, but
> I see your point. Since the size of PgStat_TableCounts approximately
> tripled by this patch (112 bytes to 320 bytes), it might be worth
> considering ways to reduce the number of entries or reducing the size
> of vacuum statistics.

The main purpose of these statistics is to see abnormal behavior of 
vacuum in relation to a table or the database as a whole.

For example, there may be a situation where vacuum has started to run 
more often and spends a lot of resources on processing a certain index, 
but the size of the index does not change significantly. Moreover, the 
table in which this index is located can be much smaller in size. This 
may be because the index is bloated and needs to be reindexed.

This is exactly what vacuum statistics can show - we will see that 
compared to other objects, vacuum processed more blocks and spent more 
time on this index.

Perhaps the vacuum parameters for the index should be set more 
aggressively to avoid this in the future.

I suppose that if we turn off statistics collection for a certain 
object, we can miss it. In addition, the user may not enable the 
parameter for the object in time, because he will forget about it.

As for the second option, now I cannot say which statistics can be 
removed, to be honest. So far, they all seem necessary.

-- 
Regards,
Alena Rybakina
Postgres Professional