pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Significance of backend_xmin in pg_stat_activity view
3+ messages / 2 participants
[nested] [flat]

* Significance of backend_xmin in pg_stat_activity view
@ 2020-04-06 17:41  postgann2020 s <postgann2020@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: postgann2020 s @ 2020-04-06 17:41 UTC (permalink / raw)
  To: pgsql-admin

Hi Team,

Good evening,
Could someone please explain what is the significance of backend_xmin in
pg_stat_activity view.

Is xmin same as backend_xmin?

Regards,
Postgann.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Significance of backend_xmin in pg_stat_activity view
@ 2020-04-07 06:27  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: postgann2020 s <postgann2020@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2020-04-07 06:27 UTC (permalink / raw)
  To: postgann2020 s <postgann2020@gmail.com>; pgsql-admin

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






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Significance of backend_xmin in pg_stat_activity view
@ 2020-04-08 17:50  postgann2020 s <postgann2020@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 3+ messages in thread

From: postgann2020 s @ 2020-04-08 17:50 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin

Thank you for the clarification.

On Tue, Apr 7, 2020, 11:57 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:

> 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
>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-04-08 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 17:41 Significance of backend_xmin in pg_stat_activity view postgann2020 s <postgann2020@gmail.com>
2020-04-07 06:27 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-04-08 17:50   ` postgann2020 s <postgann2020@gmail.com>

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