Re: Disable parallel query by default

From: Lukas Fittl <lukas(at)fittl(dot)com>
To: Scott Mead <scott(at)meads(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Disable parallel query by default
Date: 2025-05-13 21:05:04
Message-ID: CAP53PkwUz4dXUE=PQ3Xq5FhaOP7vu9aRRE=QKwwzxn08Bc8BYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 13, 2025 at 4:36 PM Scott Mead <scott(at)meads(dot)us> wrote:

> I'm looking forward to the upcoming monitoring in e7a9496 (Add two
> attributes to pg_stat_database for parallel workers activity), it will be
> easier to empirically prove that parallel query is being used. I don't
> think the patch goes far enough though, we really need the ability to
> pinpoint the query and the specific variables used that triggered the
> parallel plan. When we tell a user that parallel query is in-use and
> suspected, it is almost always met with "no, we don't use that feature".
> Users do not even realize that it's happening and quickly ask for a list of
> all queries that have ever undergone parallel execution. It's pretty much
> impossible to give an accurate list of these because there is no
> instrumentation available (even in the new patch) to get to the per-query
> level.

Independent of your point at hand, its worth noting that pg_stat_statements
has also gained the two fields parallel_workers_to_launch and
parallel_workers_launched in 18 (see cf54a2c0), that would allow breaking
this down on a per-query basis and getting a better assessment as to which
queries are using parallelism (and whether sufficient parallel workers were
available during execution).

That doesn't help with the aspect of which parameters cause parallel plans
to be used of course (in case a query is flipping between plans), but may
help narrow it down.

Best,
Lukas

--
Lukas Fittl

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-05-13 21:07:58 Re: Disable parallel query by default
Previous Message Mihail Nikalayeu 2025-05-13 20:44:24 Re: Small fixes needed by high-availability tools