Re: [POC] hash partitioning

From: amul sul <sulamul(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, David Steele <david(at)pgmasters(dot)net>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [POC] hash partitioning
Date: 2017-06-06 07:33:58
Message-ID: CAAJ_b95LfWcH2qxFYtytkuxyzWiRDcdFjyzKv3sZEdwivfvh0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Dilip,

Thanks for review.

On Sat, Jun 3, 2017 at 6:54 PM, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> On Thu, May 25, 2017 at 9:59 AM, amul sul <sulamul(at)gmail(dot)com> wrote:
>> On Mon, May 22, 2017 at 2:23 PM, amul sul <sulamul(at)gmail(dot)com> wrote:
>>>
>>> Updated patch attached. Thanks a lot for review.
>>>
>> Minor fix in the document, PFA.
>
> Patch need rebase
>

Done.

> -------
> Function header is not consistent with other neighbouring functions
> (some function contains function name in the header but others don't)
> +/*
> + * Compute the hash value for given not null partition key values.
> + */
>
Done.

> ------
> postgres=# create table t1 partition of t for values with (modulus 2,
> remainder 1) partition by range(a);
> CREATE TABLE
> postgres=# create table t1_1 partition of t1 for values from (8) to (10);
> CREATE TABLE
> postgres=# insert into t1 values(8);
> 2017-06-03 18:41:46.067 IST [5433] ERROR: new row for relation "t1_1"
> violates partition constraint
> 2017-06-03 18:41:46.067 IST [5433] DETAIL: Failing row contains (8).
> 2017-06-03 18:41:46.067 IST [5433] STATEMENT: insert into t1 values(8);
> ERROR: new row for relation "t1_1" violates partition constraint
> DETAIL: Failing row contains (8).
>
> The value 8 is violating the partition constraint of the t1 and we are
> trying to insert to value in t1,
> still, the error is coming from the leaf level table t1_1, that may be
> fine but from error, it appears that
> it's violating the constraint of t1_1 whereas it's actually violating
> the constraint of t1.
>
> From Implementation, it appears that based on the key are identifying
> the leaf partition and it's only failing during ExecInsert while
> checking the partition constraint.
>
May I ask you, how you sure about 8 is an unfit value for t1 relation?
And what if the value other than 8, for e.g. 7?

Updated patch attached.

Regards,
Amul Sul

Attachment Content-Type Size
0001-Cleanup_v5.patch application/octet-stream 3.9 KB
0002-hash-partitioning_another_design-v13.patch application/octet-stream 77.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-06-06 07:39:50 Re: Use of non-restart-safe storage by temp_tablespaces
Previous Message Michael Paquier 2017-06-06 06:40:05 Re: [HACKERS] Channel binding support for SCRAM-SHA-256