Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Christian Kruse <christian(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication
Date: 2014-01-13 18:06:56
Message-ID: 52D42B40.80904@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2014-01-13 18:12:55 Re: Standalone synchronous master
Previous Message Alexander Korotkov 2014-01-13 18:01:20 Re: PoC: Partial sort