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

On Thu, Apr 08, 2021 at 01:22:49PM +0800, Julien Rouhaud wrote:
> Le jeu. 8 avr. 2021 à 13:17, Andres Freund <andres@anarazel.de> a écrit :
> 
> >
> > This - or something in the vicinity - seems to break running the
> > regression tests with force_parallel_mode=regress. There's lots of
> > differences like
> >
> >  SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE
> > "C";
> >                                      query
> >      | calls | rows
> >
> >  ------------------------------------------------------------------------------+-------+------
> >   SELECT (i + $2 + $3)::INTEGER
> >     |     2 |    2
> >   SELECT (i + $2)::INTEGER LIMIT $3
> >     |     2 |    2
> > - SELECT PLUS_ONE($1)
> >     |     2 |    2
> > - SELECT PLUS_TWO($1)
> >     |     2 |    2
> > - SELECT pg_stat_statements_reset()
> >     |     1 |    1
> > + SELECT PLUS_ONE($1)
> >     |     4 |    4
> > + SELECT PLUS_TWO($1)
> >     |     4 |    4
> > + SELECT pg_stat_statements_reset();
> 
> 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.

Attachments:

  v1-0001-Ignore-parallel-workers-in-pg_stat_statements.patch (text/x-diff, 0B) download

view thread (12+ messages)  latest in thread

Message-ID: <20210408061102.xripofnfvqt7qcrg@nol>
Permalink:  ../20210408061102.xripofnfvqt7qcrg@nol/
Also on:    postgresql.org/message-id/20210408061102.xripofnfvqt7qcrg@nol

 ·  · 

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: rjuju123@gmail.com, andres@anarazel.de, bruce@momjian.us
  Subject: Re: pgsql: Move pg_stat_statements query jumbling to core.
  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>

* 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