Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activityview? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activityview?
Date
Msg-id CA+TgmoYyFN3FuiC+E0Ug4ceXmfUYKpmqx6xZdLZq-F9ZJoZutg@mail.gmail.com
Whole thread Raw
In response to Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activityview?  (Julien Rouhaud <julien.rouhaud@free.fr>)
Responses Re: Feature improvement: can we add queryId forpg_catalog.pg_stat_activity view?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Thu, Aug 1, 2019 at 2:46 AM Julien Rouhaud <julien.rouhaud@free.fr> wrote:
> This patch is actually storing the queryid in PGPROC, not in
> PgBackendStatus, thus the need for an atomic.  I used PGPROC because
> the value needs to be available in log_line_prefix() and spi.c, so
> pgstat.c / PgBackendStatus didn't seem like the best interface in that
> case.  Is widening PGPROC is too expensive for this purpose?

I doubt it.

However, I think that the fact that this patch adds 15 new calls to
pg_atomic_write_u64(&MyProc->queryId, ...) is probably not a good
sign.  It seems like we ought to be able to centralize it better than
that.

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
Next
From: Andres Freund
Date:
Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release2019a.)