From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Wasim Devale <wasimd60@gmail.com>
Cc: Siraj G <tosiraj.g@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Finding detailed information about LOCKS
Date: Fri, 03 May 2024 08:26:00 +0200
Message-ID: <28414c4c93ffa0ceab8a475747825de558ddf1ea.camel@cybertec.at> (raw)
In-Reply-To: <CAB5fag41pNnLgwQDh-TRpcffOiygd=92NRKjFWaGk0xmK+Ga8g@mail.gmail.com>
References: <CAC5iy62UVbNdz1QVBCW=MPkOh3E2iqkUMs6bqfUehO14B665hw@mail.gmail.com>
<0410bdf03cad96a0fec82b9a8c49e05ab5a79b51.camel@cybertec.at>
<CAB5fag41pNnLgwQDh-TRpcffOiygd=92NRKjFWaGk0xmK+Ga8g@mail.gmail.com>
On Fri, 2024-05-03 at 11:52 +0530, Wasim Devale wrote:
> On Fri, 3 May, 2024, 11:46 am Laurenz Albe, <laurenz.albe@cybertec.at> wrote:
> > On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> > > I come from Oracle background. In Oracle there is a licensed feature (Diagnostics + Tuning)
> > > upon using which the system keeps historic session records, which gives a better way
> > > to find out locking related details- like the blocking session, total sessions blocked
> > > and the time the blocking event was active. I am finding it a little hard in PgSQL
> > > to find this information.
> > >
> > > I am seeking help in finding a detailed analysis on the locks that happened yesterday,
> > > 2 days back or in the last week. Can someone assist please.
> >
> > PostgreSQL doesn't keep historical information on these things.
> >
> > You need a monitoring tool like pgwatch2 that takes regular snapshots of these data
> > and allows you to access this information.
>
> Can we not use pgbadger?
pgBadger can only collect what is in the log file. How would you get that information
into the log file? The best you can get in the log file is the information from
"log_lock_waits = on", which is information about situations where somebody had to
wait for a lock for more than a second. Definitely useful, but capturing "pg_stat_activity"
snapshots will provide more infrmation.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, wasimd60@gmail.com, tosiraj.g@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Finding detailed information about LOCKS
In-Reply-To: <28414c4c93ffa0ceab8a475747825de558ddf1ea.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox