pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Move pg_stat_statements query jumbling to core.
Date: Thu, 8 Apr 2021 11:16:24 -0400
Message-ID: <20210408151624.GA2439@momjian.us> (raw)
In-Reply-To: <20210408061102.xripofnfvqt7qcrg@nol>
References: <E1lUBdr-0000k6-N8@gemulon.postgresql.org>
	<20210408051735.lfbdzun5zdlax5gd@alap3.anarazel.de>
	<CAOBaU_aOr8LRyzmgnq78Qp9oJup9TQ3i67STLYfBJDGu3tYvjw@mail.gmail.com>
	<20210408061102.xripofnfvqt7qcrg@nol>

On Thu, Apr  8, 2021 at 02:11:02PM +0800, Julien Rouhaud wrote:
> > oh, I think it's because parallel workers now have the queryid of the main
> > query. Probably ignoring parallel workers in the executor end hook will fix
> > the problem. I'll look at it as soon as I will be back home.
> 
> That was indeed the problem.  I think the best is to entirely ignore parallel
> workers in pg_stat_statements, as done in attached patch, which fixes the
> regression tests with force_parallel_mode = regress.

> >From 45885bee58ab98c33b8e75edec13e08851523444 Mon Sep 17 00:00:00 2001
> From: Julien Rouhaud <julien.rouhaud@free.fr>
> Date: Thu, 8 Apr 2021 13:59:43 +0800
> Subject: [PATCH v1] Ignore parallel workers in pg_stat_statements.
> 
> Oversight in 4f0b0966c8 which exposed queryid in parallel workers.  Counters
> are aggregated by the main backend process so parallel workers would report
> duplicated activity, and could also report activity for the wrong entry as they
> are only aware of the top level queryid.
> 
> Author: Julien Rouhaud
> Reported-by: Andres Freund
> Discussion: https://postgr.es/m/20210408051735.lfbdzun5zdlax5gd@alap3.anarazel.de

Patch applied.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.






view thread (12+ messages)  latest in thread

Message-ID: <20210408151624.GA2439@momjian.us>
Permalink:  ../20210408151624.GA2439@momjian.us/
Also on:    postgresql.org/message-id/20210408151624.GA2439@momjian.us

 · 

reply

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: bruce@momjian.us, rjuju123@gmail.com, andres@anarazel.de
  Subject: Re: pgsql: Move pg_stat_statements query jumbling to core.
  In-Reply-To: <20210408151624.GA2439@momjian.us>
  References: <E1lUBdr-0000k6-N8@gemulon.postgresql.org> <20210408051735.lfbdzun5zdlax5gd@alap3.anarazel.de> <CAOBaU_aOr8LRyzmgnq78Qp9oJup9TQ3i67STLYfBJDGu3tYvjw@mail.gmail.com> <20210408061102.xripofnfvqt7qcrg@nol> <20210408151624.GA2439@momjian.us>

* 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