Re: Autovacuum, dead tuples and bloat

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "Shenavai, Manuel" <manuel(dot)shenavai(at)sap(dot)com>, Achilleas Mantzios <a(dot)mantzios(at)cloud(dot)gatewaynet(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Autovacuum, dead tuples and bloat
Date: 2024-06-26 15:05:26
Message-ID: e29dfa81-cff7-49f8-9895-f50ed187709c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/26/24 00:03, Shenavai, Manuel wrote:
> Thanks for the suggestions.
> I checked pg_locks shows and pg_stat_activity but I could not find a LOCK or an transaction on this (at this point in time).
>
> I assume that this problem may relate to long running transactions which write a lot of data. Is there already something in place that would help me to:
> 1) identify long running transactions
> 2) get an idea of the data-volume a single transaction writes?
>
> I tested the log_statement='mod' but this writes too much data (including all payloads). I rather would like to get a summary entry of each transaction like:
> "Tx 4752 run for 1hour and 1GB data was written."

https://www.postgresql.org/docs/current/runtime-config-logging.html

log_min_duration_statement

Read the Note below the entry.

This will log long running queries, though it will not show th amount of
data written.

If you want to go more in depth there is:

https://www.postgresql.org/docs/current/pgstatstatements.html

It is an extension that you will need to install per instructions at the
link.

>
> Is there something like this already available in postgres?
>
> Best regards,
> Manuel

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message satyajit patra 2024-06-26 16:21:34 --frokbackend process
Previous Message Andrew Longwill 2024-06-26 14:43:30 ERROR: could not attach to dynamic shared area