Re: Significance of backend_xmin in pg_stat_activity view

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: postgann2020 s <postgann2020(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Significance of backend_xmin in pg_stat_activity view
Date: 2020-04-07 06:27:16
Message-ID: fb8a5bd0618e6b63b8ed5402b81130658badf1f8.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Toomas Kristin 2020-04-07 06:43:17 Vault or AWS/IAM
Previous Message J T 2020-04-07 00:30:18 pg_rewind interesting issue. Any feedback appreciated