On Thu, Apr 08, 2021 at 11:16:24AM -0400, Bruce Momjian wrote: > 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.rouh...@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.lfbdzun5zdlax...@alap3.anarazel.de > > Patch applied.
Thanks Bruce!