From: Julien Rouhaud <rjuju123@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Move pg_stat_statements query jumbling to core.
Date: Thu, 8 Apr 2021 17:42:21 +0800
Message-ID: <20210408094221.s7nyhqe7h22htr7n@nol> (raw)
In-Reply-To: <CAA4eK1L5WBM99a-RzK6Yad8b+hBzVwaD+QKyGzTas8kwsyQoDQ@mail.gmail.com>
References: <E1lUBdr-0000k6-N8@gemulon.postgresql.org>
<20210408051735.lfbdzun5zdlax5gd@alap3.anarazel.de>
<CAOBaU_aOr8LRyzmgnq78Qp9oJup9TQ3i67STLYfBJDGu3tYvjw@mail.gmail.com>
<20210408061102.xripofnfvqt7qcrg@nol>
<CAA4eK1KbQp3-H2wFELhC40txvC8YiacX3qzsyP0Lj4ayzSnGmw@mail.gmail.com>
<20210408064919.bxqnzpi2ctt3rfzg@nol>
<CAA4eK1L5WBM99a-RzK6Yad8b+hBzVwaD+QKyGzTas8kwsyQoDQ@mail.gmail.com>
On Thu, Apr 08, 2021 at 02:52:26PM +0530, Amit Kapila wrote:
>
> Yeah, we do pass instrumentation flags from leader to worker but not
> the one allocated via pg_stat_staments (pgss_ExecutorStart {...
> queryDesc->totaltime ...}.
Ah indeed, I now remember that problem that I had to deal with in some
extensions [1]. For the record this was initially raised by Tomas in [2], but
unfortunately that thread got forgotten and probably all third-party extensions
ended up allocating some shmem for their need.
> However, I guess prior to this patch those
> were anyway not allocated separately because queryid was not passed to
> workers. So, I think you are right it shouldn't change the previous
> behavior.
I think that previously parallel workers always added the required
instrumentation if pg_stat_statements is loaded, but InstrEndLoop() wasn't
called by pgss itself so I'm not sure what happens in that case.
> I am not completely sure but it seems we were not accumulating the
> instrumentation info by workers required by pg_stat_statements neither
> before this patch nor after but I might be missing something.
Same here. I'll try to dig to get an answer, but it seems to me that it's an
old bug and not really a new one. It would probably still make sense to add an
open item for this in pg14 as it's evidently more broken that before.
[1]: https://github.com/powa-team/pg_qualstats/issues/9
[2]: https://www.postgresql.org/message-id/3f62f24e-51b3-175c-9222-95f25fd2a9d6@2ndquadrant.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: rjuju123@gmail.com, amit.kapila16@gmail.com, andres@anarazel.de, bruce@momjian.us
Subject: Re: pgsql: Move pg_stat_statements query jumbling to core.
In-Reply-To: <20210408094221.s7nyhqe7h22htr7n@nol>
References: <E1lUBdr-0000k6-N8@gemulon.postgresql.org> <20210408051735.lfbdzun5zdlax5gd@alap3.anarazel.de> <CAOBaU_aOr8LRyzmgnq78Qp9oJup9TQ3i67STLYfBJDGu3tYvjw@mail.gmail.com> <20210408061102.xripofnfvqt7qcrg@nol> <CAA4eK1KbQp3-H2wFELhC40txvC8YiacX3qzsyP0Lj4ayzSnGmw@mail.gmail.com> <20210408064919.bxqnzpi2ctt3rfzg@nol> <CAA4eK1L5WBM99a-RzK6Yad8b+hBzVwaD+QKyGzTas8kwsyQoDQ@mail.gmail.com> <20210408094221.s7nyhqe7h22htr7n@nol>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox