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

From Tom Lane
Subject Re: [HACKERS] Passing query string to workers
Date
Msg-id 13030.1484138260@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Passing query string to workers  (Rafia Sabih <rafia.sabih@enterprisedb.com>)
Responses Re: [HACKERS] Passing query string to workers  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Rafia Sabih <rafia.sabih@enterprisedb.com> writes:
> Approach:
> A token for query string is created in the shared memory, this token is
> populated with the query string using the global string --
> debug_query_string. Now, for each of the worker when
> ExecGetParallelQueryDesc is called, we retrieve the query text from shared
> memory and pass it to CreateQueryDesc.

This is simply wrong, because debug_query_string need have nothing to do
with what the actual parallel query is.  I'm all for sending over the
correct query, but if you aren't bothering to accurately reproduce the
master's query descriptor, I think you will increase confusion not
reduce it.

As far as reproducing the pg_stat_activity query goes, you could probably
grab that string out of the master backend's pgstat entry and pass it over
at parallel query start.  But please don't confuse it with either
debug_query_string or the string referenced by the QueryDesc; I do not
think there's any guarantee that those are the same.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Beena Emerson
Date:
Subject: Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctlstart without --wait
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Do we support using agg or window functions in delete statement?