Thanks Rajkumar for the test.
On 2017/11/21 19:06, Rajkumar Raghuwanshi wrote:
> 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.
> !>
It seems I wrote an Assert in the code to support hash partitioning that
wasn't based on a valid assumption. I was wrongly assuming that all hash
partitions for a given modulus (largest modulus) must exist at any given
time, but that isn't the case.
Fixed in the attached. No other changes beside that.
Thanks,
Amit