Re: [HACKERS] path toward faster partition pruning - Mailing list pgsql-hackers

From Rajkumar Raghuwanshi
Subject Re: [HACKERS] path toward faster partition pruning
Date
Msg-id CAKcux6=rEvFOjOaLXweGsvF7r1D1to-MPTCCSNy5BkDoQmtrXA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] path toward faster partition pruning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] path toward faster partition pruning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Fri, Nov 17, 2017 at 3:31 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:

Support for hash partitioning and tests for the same.  Also, since
update/delete on partitioned tables still depend on constraint exclusion
for pruning, fix things such that get_relation_constraints includes
partition constraints in its result only for non-select queries (for
selects we have the new pruning code).  Other bug fixes.

Hi Amit,

I have applied attached patch set on commit 11e264517dff7a911d9e6494de86049cab42cde3 and try to test for hash partition. I got a server crash with below test.

CREATE TABLE hp_tbl (a int, b int, c int) PARTITION BY HASH (a);
CREATE TABLE hp_tbl_p1 PARTITION OF hp_tbl FOR VALUES WITH (modulus 4, remainder 0) PARTITION BY HASH (b);
CREATE TABLE hp_tbl_p1_p1 PARTITION OF hp_tbl_p1 FOR VALUES WITH (modulus 4, remainder 0) PARTITION BY HASH (c);
CREATE TABLE hp_tbl_p1_p1_p1 PARTITION OF hp_tbl_p1_p1 FOR VALUES WITH (modulus 4, remainder 0);
CREATE TABLE hp_tbl_p2 PARTITION OF hp_tbl FOR VALUES WITH (modulus 4, remainder 1) PARTITION BY HASH (b);
CREATE TABLE hp_tbl_p2_p1 PARTITION OF hp_tbl_p2 FOR VALUES WITH (modulus 4, remainder 1);
CREATE TABLE hp_tbl_p2_p2 PARTITION OF hp_tbl_p2 FOR VALUES WITH (modulus 4, remainder 2);
insert into  hp_tbl select i,i,i from generate_series(0,10)i where i not in(2,4,6,7,10);

explain select * from hp_tbl where a = 2;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

Thanks & Regards,
Rajkumar Raghuwanshi
QMG, EnterpriseDB Corporation

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Martín Marqués
Date:
Subject: Re: [HACKERS] pg_basebackup --progress output for batch execution