Re: Identify transactions causing highest wal generation

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Gayatri Singh <gayatripremselvi(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Identify transactions causing highest wal generation
Date: 2024-03-08 15:40:39
Message-ID: e2734466-50a2-4b7a-91a7-b141e9d16b93@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2024-03-08 15:40:42 Re: Confine vacuum skip logic to lazy_scan_skip
Previous Message Tom Lane 2024-03-08 15:35:39 Re: type cache cleanup improvements