On 3/8/24 15:50, Gayatri Singh wrote:
> Hello Team,
>
> Can you help me with steps to identify transactions which caused wal
> generation to surge ?
>
You should probably take a look at pg_waldump, which prints information
about WAL contents, including which XID generated each record.
I don't know what exactly is your goal, but sometimes it's not entirely
direct relationship. For example, a transaction may delete a record,
which generates just a little bit of WAL. But then after a checkpoint a
VACUUM comes around, vacuums the page to reclaim the space of the entry,
and ends up writing FPI (which is much larger). You could argue this WAL
is also attributable to the original transaction, but that's not what
pg_waldump will allow you to do. FPIs in general may inflate the numbers
unpredictably, and it's not something the original transaction can
affect very much.
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company