Re: [HACKERS] Passing query string to workers

2017-02-21 Thread Rafia Sabih
On Wed, Feb 22, 2017 at 12:25 PM, Robert Haas wrote: > Looks fine to me. Committed. I did move es_queryText to what I think > is a more appropriate location in the structure definition. > > Thanks. > Many thanks to Robert for committing and to Kuntal and Amit for

Re: [HACKERS] Passing query string to workers

2017-02-21 Thread Robert Haas
On Tue, Feb 21, 2017 at 9:18 AM, Rafia Sabih wrote: > Done. Looks fine to me. Committed. I did move es_queryText to what I think is a more appropriate location in the structure definition. Thanks. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The

Re: [HACKERS] Passing query string to workers

2017-02-20 Thread Rafia Sabih
On Mon, Feb 20, 2017 at 8:35 PM, Kuntal Ghosh wrote: > > + char *query_data; > + query_data = estate->es_sourceText; > estate->es_sourceText is a const char* variable. Assigning this const > pointer to a non-const pointer violates the rules >

Re: [HACKERS] Passing query string to workers

2017-02-20 Thread Kuntal Ghosh
On Mon, Feb 20, 2017 at 10:11 AM, Rafia Sabih wrote: > On Sun, Feb 19, 2017 at 10:11 PM, Robert Haas wrote: >> + query_data = (char *) palloc0(strlen(estate->es_queryString) + 1); >> + strcpy(query_data, estate->es_queryString); >>

Re: [HACKERS] Passing query string to workers

2017-02-19 Thread Rafia Sabih
On Sun, Feb 19, 2017 at 10:11 PM, Robert Haas wrote: > On Thu, Feb 16, 2017 at 6:41 PM, Kuntal Ghosh > wrote: > > On Thu, Feb 16, 2017 at 5:47 PM, Rafia Sabih > > wrote: > >> Other that that I updated some

Re: [HACKERS] Passing query string to workers

2017-02-19 Thread Robert Haas
On Thu, Feb 16, 2017 at 6:41 PM, Kuntal Ghosh wrote: > On Thu, Feb 16, 2017 at 5:47 PM, Rafia Sabih > wrote: >> Other that that I updated some comments and other cleanup things. Please >> find the attached patch for the revised version. >

Re: [HACKERS] Passing query string to workers

2017-02-16 Thread Kuntal Ghosh
On Thu, Feb 16, 2017 at 5:47 PM, Rafia Sabih wrote: > Other that that I updated some comments and other cleanup things. Please > find the attached patch for the revised version. Looks good. It has passed the regression tests (with and without regress mode). Query is

Re: [HACKERS] Passing query string to workers

2017-02-16 Thread Rafia Sabih
On Thu, Feb 16, 2017 at 5:06 PM, Kuntal Ghosh wrote: > > >> > >> Another question is don't we need to set debug_query_string in worker? > > > > In the updated version I am setting it in ParallelQueryMain. > > > Ahh, I missed that. debug_query_string is used to show the

Re: [HACKERS] Passing query string to workers

2017-02-16 Thread Kuntal Ghosh
On Sat, Feb 11, 2017 at 8:38 AM, Rafia Sabih wrote: > >> >> Another question is don't we need to set debug_query_string in worker? > > In the updated version I am setting it in ParallelQueryMain. > Ahh, I missed that. debug_query_string is used to show the log

Re: [HACKERS] Passing query string to workers

2017-02-10 Thread Rafia Sabih
> > > > There are some spacing issues in the code. For example, > > + estate->es_queryString = (char > > *)palloc0(strlen(queryDesc->sourceText) + 1); > > + /*Estimate space for query text. */ > > pgindent might be helpful to track all such changes. > > > Fixed. > > +#define

Re: [HACKERS] Passing query string to workers

2017-02-10 Thread Amit Kapila
On Fri, Feb 10, 2017 at 2:54 PM, Kuntal Ghosh wrote: > On Tue, Feb 7, 2017 at 10:19 AM, Rafia Sabih > wrote: >> Thanks a lot Kuntal for the review, please find attached patch for the >> revised version. > Few comments on the patch: > >

Re: [HACKERS] Passing query string to workers

2017-02-10 Thread Kuntal Ghosh
On Tue, Feb 7, 2017 at 10:19 AM, Rafia Sabih wrote: > Thanks a lot Kuntal for the review, please find attached patch for the > revised version. Few comments on the patch: There are some spacing issues in the code. For example, + estate->es_queryString = (char

Re: [HACKERS] Passing query string to workers

2017-02-06 Thread Rafia Sabih
On Mon, Jan 23, 2017 at 2:46 PM, Kuntal Ghosh wrote: > I've looked into the patch. I've some comments regarding that. > > +#define PARALLEL_KEY_QUERY_TEXTUINT64CONST(0xE010) > It should be UINT64CONST(0xE00A) > > + query_len =

Re: [HACKERS] Passing query string to workers

2017-01-23 Thread Kuntal Ghosh
On Fri, Jan 13, 2017 at 4:25 PM, Rafia Sabih wrote: > > Please let me know your feedback over the same. > I've looked into the patch. I've some comments regarding that. +#define PARALLEL_KEY_QUERY_TEXTUINT64CONST(0xE010) It should be

Re: [HACKERS] Passing query string to workers

2017-01-13 Thread Rafia Sabih
On Thu, Jan 12, 2017 at 6:24 PM, Robert Haas wrote: > On Wed, Jan 11, 2017 at 11:12 PM, Tom Lane wrote: >> Robert Haas writes: >>> On Wed, Jan 11, 2017 at 6:36 PM, Tom Lane wrote: That would work, if you

Re: [HACKERS] Passing query string to workers

2017-01-12 Thread Robert Haas
On Wed, Jan 11, 2017 at 11:12 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Jan 11, 2017 at 6:36 PM, Tom Lane wrote: >>> That would work, if you had a way to get at the active QueryDesc ... >>> but we don't pass that down to

Re: [HACKERS] Passing query string to workers

2017-01-11 Thread Tom Lane
Robert Haas writes: > On Wed, Jan 11, 2017 at 6:36 PM, Tom Lane 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

Re: [HACKERS] Passing query string to workers

2017-01-11 Thread Robert Haas
On Wed, Jan 11, 2017 at 6:36 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Jan 11, 2017 at 7:37 AM, Tom Lane wrote: >>> As far as reproducing the pg_stat_activity query goes, you could probably >>> grab that string out of the

Re: [HACKERS] Passing query string to workers

2017-01-11 Thread Tom Lane
Robert Haas writes: > On Wed, Jan 11, 2017 at 7:37 AM, Tom Lane wrote: >> 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.

Re: [HACKERS] Passing query string to workers

2017-01-11 Thread Robert Haas
On Wed, Jan 11, 2017 at 7:37 AM, Tom Lane wrote: > Rafia Sabih 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.

Re: [HACKERS] Passing query string to workers

2017-01-11 Thread Tom Lane
Rafia Sabih 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

[HACKERS] Passing query string to workers

2017-01-10 Thread Rafia Sabih
Hello everybody, Currently, query string is not passed to the workers and only master has it. In the events, when multiple queries are running on a server and for one query some worker crashes then it becomes quite burdensome to find the query with the crashed worker, since on the worker crash no