Re: auto_explain vs. parallel query

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: auto_explain vs. parallel query
Date: 2016-11-01 14:58:03
Message-ID: daa33ddc-409e-3105-8078-0106521ec8bb@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/01/2016 03:29 PM, Robert Haas wrote:
> On Tue, Nov 1, 2016 at 10:21 AM, Tomas Vondra
> <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
>> Clearly we need to pass some information to the worker processes, so that
>> they know whether to instrument the query or not. I don't know if there's a
>> good non-invasive way to do that from an extension - the easiest way I can
>> think of is using a bit of shared memory to pass the "sample query" flag -
>> attached is a patch that does that, and it seems to be working fine for me.
>
> Uh, isn't this going to break as soon as there are multiple parallel
> queries in process at the same time?
>

Damn! You're right of course. Who'd guess I need more coffee this early?

Attached is a fix replacing the flag with an array of flags, indexed by
ParallelMasterBackendId. Hopefully that makes it work with multiple
concurrent parallel queries ... still, I'm not sure this is the right
solution.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
auto_explain_parallel-v2.patch text/x-diff 5.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2016-11-01 15:05:11 Re: emergency outage requiring database restart
Previous Message Julian Markwort 2016-11-01 14:49:42 Re: [PATCH] pgpassfile connection option