Re: auto_explain vs. parallel query - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: auto_explain vs. parallel query
Date
Msg-id daa33ddc-409e-3105-8078-0106521ec8bb@2ndquadrant.com
Whole thread Raw
In response to Re: auto_explain vs. parallel query  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: auto_explain vs. parallel query  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 11/01/2016 03:29 PM, Robert Haas wrote:
> On Tue, Nov 1, 2016 at 10:21 AM, Tomas Vondra
> <tomas.vondra@2ndquadrant.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

pgsql-hackers by date:

Previous
From: Julian Markwort
Date:
Subject: Re: [PATCH] pgpassfile connection option
Next
From: Merlin Moncure
Date:
Subject: Re: emergency outage requiring database restart