Re: Expose Parallelism counters planned/execute in pg_stat_statements - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Expose Parallelism counters planned/execute in pg_stat_statements
Date
Msg-id 20220816065843.lg2hvefuqysu2llr@jrouhaud
Whole thread Raw
In response to Expose Parallelism counters planned/execute in pg_stat_statements  (Anthony Sotolongo <asotolongo@gmail.com>)
Responses Re: Expose Parallelism counters planned/execute in pg_stat_statements
List pgsql-hackers
Hi,

On Fri, Jul 29, 2022 at 08:36:44AM -0500, Daymel Bonne Solís wrote:
>
> We have rewritten the patch and added the necessary columns to have the
> number of times a parallel query plan was not executed using parallelism.
>
> We are investigating how to add more information related to the workers
> created
> by the Gather/GatherMerge nodes, but it is not a trivial task.

As far as I can see the scope of the counters is now different.  You said you
wanted to be able to identify when a parallel query plan cannot be executed
with parallelism, but what the fields are now showing is simply whether no
workers were launched at all.  It could be because of the dbeaver behavior you
mentioned (the !es_use_parallel_mode case), but also if the executor did try to
launch parallel workers and didn't get any.

I don't think that's an improvement.  With this patch if you see the
"paral_planned_not_exec" counter going up, you still don't know if this is
because of the !es_use_parallel_mode or if you simply have too many parallel
queries running at the same time, or both, and therefore can't do much with
that information.  Both situations are different and in my opinion require
different (and specialized) counters to properly handle them.

Also, I don't think that paral_planned_exec and paral_planned_not_exec are good
column (and variable) names.  Maybe something like
"parallel_exec_count" and "forced_non_parallel_exec_count" (assuming it's based
on a parallel plan and !es_use_parallel_mode).



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Allow file inclusion in pg_hba and pg_ident files
Next
From: "wangw.fnst@fujitsu.com"
Date:
Subject: RE: Perform streaming logical transactions by background workers and parallel apply