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

From Kuntal Ghosh
Subject Re: [HACKERS] Passing query string to workers
Date
Msg-id CAGz5QCJ46h_fGoAFBo6uCM=n36-HSsAvoKAdaUKx78xmm-SkYw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Passing query string to workers  (Rafia Sabih <rafia.sabih@enterprisedb.com>)
Responses Re: [HACKERS] Passing query string to workers  (Rafia Sabih <rafia.sabih@enterprisedb.com>)
List pgsql-hackers
On Fri, Jan 13, 2017 at 4:25 PM, Rafia Sabih
<rafia.sabih@enterprisedb.com> 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_TEXT        UINT64CONST(0xE000000000000010)
It should be UINT64CONST(0xE00000000000000A)

+       query_len = strlen(query_data) + 1;
+       shm_toc_estimate_chunk(&pcxt->estimator, query_len);
+       shm_toc_estimate_keys(&pcxt->estimator, 1);
+
Adding a comment before this will be helpful. You should maintain the
same order for estimating and storing the query string. For example,
as you've estimated the space for query string after estimation of dsa
space, you should store the same after creating dsa. Besides, I think
the appropriate place for this would be before planned statement.

The regression test for select_parallel is failing after applying the
patch. You can reproduce the scenario by the following sql statements:

CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (generate_series(1,100000));
SET parallel_setup_cost=0;
SET parallel_tuple_cost=0;
SET min_parallel_relation_size=0;
SET max_parallel_workers_per_gather=4;
SELECT count(*) FROM t1;

It is showing the following warning.
WARNING:  problem in alloc set ExecutorState: detected write past
chunk end in block 0x14f5310, chunk 0x14f6c50


-- 
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Checksums by default?
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Fix a comment in feelist.c