Re: Passing query string to workers

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: Rafia Sabih <rafia(dot)sabih(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Passing query string to workers
Date: 2017-01-23 09:16:26
Message-ID: CAGz5QCJ46h_fGoAFBo6uCM=n36-HSsAvoKAdaUKx78xmm-SkYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 13, 2017 at 4:25 PM, Rafia Sabih
<rafia(dot)sabih(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-01-23 09:19:36 Re: Fix a comment in feelist.c
Previous Message Amit Kapila 2017-01-23 08:57:44 Re: Checksums by default?