pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: postgann2020 s <postgann2020@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: Significance of backend_xmin in pg_stat_activity view
Date: Tue, 07 Apr 2020 08:27:16 +0200
Message-ID: <fb8a5bd0618e6b63b8ed5402b81130658badf1f8.camel@cybertec.at> (raw)
In-Reply-To: <CANynezNYpEduAnfSexZ8qkCPpGL=ZK54qr-ds9+5Y=mNQ5c65w@mail.gmail.com>
References: <CANynezNYpEduAnfSexZ8qkCPpGL=ZK54qr-ds9+5Y=mNQ5c65w@mail.gmail.com>

On Mon, 2020-04-06 at 23:11 +0530, postgann2020 s wrote:
> Could someone please explain what is the significance of backend_xmin in pg_stat_activity view.
> 
> Is xmin same as backend_xmin?

It is the backend's xmin horizon.

That means that it is the oldest transaction ID whose effects may not be
visible to the transaction running in the backend.

Since transaction IDs are stored in each row to determine its visibility,
the minimum of the "backend_xmin" of all backends determines the cut-off
point beyond which all backends will agree on the visibility of tuples.

This is for example relevant for VACUUM: it cannot remove any dead tuples
that contain a transaction ID that is not older than any backend's
"backend_xmin" (unless the tuple is "frozen", but that leads too far).

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (3+ messages)  latest in thread

Message-ID: <fb8a5bd0618e6b63b8ed5402b81130658badf1f8.camel@cybertec.at>
Permalink:  ../fb8a5bd0618e6b63b8ed5402b81130658badf1f8.camel@cybertec.at/
Also on:    postgresql.org/message-id/fb8a5bd0618e6b63b8ed5402b81130658badf1f8.camel@cybertec.at

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, postgann2020@gmail.com
  Subject: Re: Significance of backend_xmin in pg_stat_activity view
  In-Reply-To: <fb8a5bd0618e6b63b8ed5402b81130658badf1f8.camel@cybertec.at>
  References: <CANynezNYpEduAnfSexZ8qkCPpGL=ZK54qr-ds9+5Y=mNQ5c65w@mail.gmail.com> <fb8a5bd0618e6b63b8ed5402b81130658badf1f8.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