Re: Identify transactions causing highest wal generation - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Identify transactions causing highest wal generation
Date
Msg-id e2734466-50a2-4b7a-91a7-b141e9d16b93@enterprisedb.com
Whole thread Raw
In response to Identify transactions causing highest wal generation  (Gayatri Singh <gayatripremselvi@gmail.com>)
Responses Re: Identify transactions causing highest wal generation
Re: Identify transactions causing highest wal generation
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: type cache cleanup improvements
Next
From: Peter Geoghegan
Date:
Subject: Re: Confine vacuum skip logic to lazy_scan_skip