Re: nested queries vs. pg_stat_activity

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: legrand legrand <legrand_legrand(at)hotmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: nested queries vs. pg_stat_activity
Date: 2020-08-10 20:09:41
Message-ID: CABUevEwkC7-yJEOzJ9pP-S7F2oqmo8phiA6seDkkxpopPO+bQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 10, 2020 at 9:51 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Mon, Aug 10, 2020 at 12:51 PM legrand legrand
> <legrand_legrand(at)hotmail(dot)com> wrote:
> > An other solution is to expose nested queryid, and to join it with
> pg_stat_statements.
> > Actual development trying to add queryid to pg_stat_activity isn't
> helpfull, because it is only exposing top level one.
> > Extension pg_stat_sql_plans (github) propose a function called
> pg_backend_queryid(pid),
> > that gives the expected queryid (that is stored in shared memory for
> each backend) ...
>
> That'd help people using pg_stat_statements, but not others.
>

Would it even solve the problem for them? pg_stat_statements collects
aggregate stats and not a view of what's happening right now -- so it'd be
mixing two different types of values. And it would get worse if the same
thing is executed multiple times concurrently.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2020-08-10 20:20:21 Re: Allow some recovery parameters to be changed with reload
Previous Message Robert Haas 2020-08-10 19:51:03 Re: nested queries vs. pg_stat_activity