Re: Expose Parallelism counters planned/execute in pg_stat_statements

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Daymel Bonne Solís <daymelbonne(at)gmail(dot)com>
Cc: Anthony Sotolongo <asotolongo(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Expose Parallelism counters planned/execute in pg_stat_statements
Date: 2022-08-16 06:58:43
Message-ID: 20220816065843.lg2hvefuqysu2llr@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wangw.fnst@fujitsu.com 2022-08-16 07:33:04 RE: Perform streaming logical transactions by background workers and parallel apply
Previous Message Julien Rouhaud 2022-08-16 06:10:30 Re: Allow file inclusion in pg_hba and pg_ident files