Re: [HACKERS] Passing query string to workers - Mailing list pgsql-hackers

From Rafia Sabih
Subject Re: [HACKERS] Passing query string to workers
Date
Msg-id CAOGQiiPq=Wdv-4xdOROJkX2J8CprRYDoLgLpzQMLSyngPXpyWA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Passing query string to workers  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Passing query string to workers
List pgsql-hackers
On Thu, Jan 12, 2017 at 6:24 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Wed, Jan 11, 2017 at 11:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> On Wed, Jan 11, 2017 at 6:36 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> That would work, if you had a way to get at the active QueryDesc ...
>>>> but we don't pass that down to executor nodes.
>>
>>> Hmm, that is a bit of a problem.  Do you have a suggestion?
>>
>> Copy that string pointer into the EState, perhaps?
>
> OK, that sounds good.

Thanks a lot Tom and Robert for the suggestions. Please find the
attached file for the revised version of the patch, wherein I added an
extra pointer for queryString in EState and populated it with
queryDesc->sourceText in standard_ExecutorStart. Later, in
ExecInitParallelPlan a token for queryString is created in shared
memory which is used in ExecParallelGetQueryDesc and
ParallelWorkerMain as before (in version 1 of patch).

Please let me know your feedback over the same.

-- 
Regards,
Rafia Sabih
EnterpriseDB: http://www.enterprisedb.com/

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Ants Aasma
Date:
Subject: Re: [HACKERS] Replication slot xmin is not reset if HS feedback isturned off while standby is shut down
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] UNDO and in-place update