Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication
Date
Msg-id 52D42B40.80904@vmware.com
Whole thread Raw
In response to Patch: show xid and xmin in pg_stat_activity and pg_stat_replication  (Christian Kruse <christian@2ndQuadrant.com>)
Responses Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication  (Christian Kruse <christian@2ndQuadrant.com>)
List pgsql-hackers
On 12/17/2013 04:58 PM, Christian Kruse wrote:
> attached you will find a patch for showing the current transaction id
> (xid) and the xmin of a backend in pg_stat_activty and the xmin in
> pg_stat_replication.

Docs.

When an admin is looking for a long-running transaction that's blocking 
vacuum, he will currently rely on the timestamp fields, xact_start and 
query_start. I'm not sure how much extra value this adds over those 
timestamps in pg_stat_activity, but there are not such fields in 
pg_stat_replication, so that part is definitely useful. And if we're 
going to add xmin to pg_stat_replication, it makes sense to add it to 
pg_stat_activity too. Unless someone can come up with something better 
to display for walsenders. The timestamp of the last commit record 
that's been replayed, perhaps?

What else would a user would want to do with these?

This definitely sounds useful to me as a developer, though. So I'm 
thinking we should add these for that reason, in any case.

- Heikki



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: PoC: Partial sort
Next
From: Hannu Krosing
Date:
Subject: Re: Standalone synchronous master