Re: pgsql: Move pg_stat_statements query jumbling to core.

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Move pg_stat_statements query jumbling to core.
Date: 2021-04-08 15:16:24
Message-ID: 20210408151624.GA2439@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)rouhaud(at)free(dot)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(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2021-04-08 15:19:37 Re: pgsql: autovacuum: handle analyze for partitioned tables
Previous Message Bruce Momjian 2021-04-08 15:16:14 pgsql: Fixes for query_id feature