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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Christian Kruse <christian(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication
Date: 2013-12-17 17:08:11
Message-ID: CA+TgmoaVc44bgNxM_3L_y6iieqhB+Qwg4NOXGSouLX-23HQxVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 17, 2013 at 9:58 AM, Christian Kruse
<christian(at)2ndquadrant(dot)com> wrote:
> Hi,
>
> 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.
>
> This may be helpful when looking for the cause of bloat.
>
> I added two new struct members in PgBackendStatus which get filled in
> pgstat_read_current_status() and slightly modified the catalog schema
> and the pg_stat_get_activity() procedure.
>
> I'm not sure if it is a good idea to gather the data in
> pgstat_read_current_status(), but I chose to do it this way
> nonetheless because otherwise I would have to create collector
> functions like pgstat_report_xid_assignment() /
> pgstat_report_xmin_changed() (accordingly to
> pgstat_report_xact_timestamp()) which may result in a performance hit.

Please add your patch here so we don't lose track of it:

https://commitfest.postgresql.org/action/commitfest_view/open

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2013-12-17 17:17:19 Re: Extension Templates S03E11
Previous Message Pavel Stehule 2013-12-17 17:07:38 Re: patch: make_timestamp function