pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Ildar Musin <i.musin@postgrespro.ru>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Declarative partitioning
Date: Tue, 19 Apr 2016 16:57:40 +0300
Message-ID: <57163954.2020701@postgrespro.ru> (raw )
In-Reply-To: <57106F9E.3000309@lab.ntt.co.jp >
References: <55D3093C.5010800@lab.ntt.co.jp >
<CA+TgmoZZMfcf16YaHuhP1Vk=j8PDFeHCvfj+FJQd+eFhs+7P8A@mail.gmail.com >
<5678ACBC.8050809@lab.ntt.co.jp >
<5698CE6D.3070907@lab.ntt.co.jp >
<CA+TgmoY9C_XxbngCd9TtbEuwhu+4oHjeHt+QSzs-6bM=oY4f-w@mail.gmail.com >
<56C55973.80309@lab.ntt.co.jp >
<CADkLM=fz4SRiaLggFctOcJegpcjxaWPwCyi6YDwq9Wnceno7=w@mail.gmail.com >
<56CD6598.4090302@lab.ntt.co.jp >
<CADkLM=f1zyL-cV_LK8GpXv=iS_=VbHs8bernUMa+8yHtUXjebQ@mail.gmail.com >
<56DE2D4B.1040001@lab.ntt.co.jp >
<CADkLM=cb7q4TSYQYX4EsMHVK0hjEnBJiA8+XMSSropk2CHwa_A@mail.gmail.com >
<56DF74F0.7060404@lab.ntt.co.jp >
<CAPpHfdut34uqoY1vKgvBhsGZqhR6Nky=_Dxn0un57G_M2CvLTA@mail.gmail.com >
<CA+HiwqFFH10_ku6z_Ps=H7=pR5cWJk9Bdr9nE08+3F53yTEr9A@mail.gmail.com >
<CAPpHfdu0mGbt9T2Jx04OKJfJQ0zW55BFqmisinRYWd2OaowRWQ@mail.gmail.com >
<CA+TgmoaoZRqk2dr3xonta3o4omKuO4V4niVC2DKKo9VpdMc_zQ@mail.gmail.com >
<56F0AC96.2010303@lab.ntt.co.jp >
<CAFjFpReZ2nmpfOA2uGdgVp3ivWC13VDFYOQ7rs5LFeqo_Zm4vA@mail.gmail.com >
<57106F9E.3000309@lab.ntt.co.jp >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Hi Amit,
On 15.04.2016 07:35, Amit Langote wrote:
> Thanks a lot for the comments. The patch set changed quite a bit since
> the last version. Once the CF entry was marked returned with feedback
> on March 22, I held off sending the new version at all. Perhaps, it
> would have been OK. Anyway here it is, if you are interested. I will
> create an entry in CF 2016-09 for the same. Also, see below replies to
> you individual comments.
Thanks for your new patch! I've tried it and discovered some strange
behavior for partitioning by composite key. Here is an example of my setup:
create table test(a int, b int) partition by range (a, b);
create table test_1 partition of test for values start (0, 0) end (100,
100);
create table test_2 partition of test for values start (100, 100) end
(200, 200);
create table test_3 partition of test for values start (200, 200) end
(300, 300);
It's alright so far. But if we try to insert record in which attribute
'a' belongs to one partition and attribute 'b' belongs to another then
record will be inserted in the first one:
insert into test(a, b) values (150, 50);
select tableoid::regclass, * from test;
tableoid | a | b
----------+-----+----
test_2 | 150 | 50
(1 row)
I think there should be an error because value for 'b' violates range
constraint for test_2. Now if we query data from 'test' and add filter b
< 100, then planner will exclude partitions 'test_2' (which actually
contains inserted row) and 'test_3' and return nothing:
select * from test where b < 100;
a | b
---+---
(0 rows)
explain (costs off) select * from test where b < 100;
QUERY PLAN
---------------------------
Append
-> Seq Scan on test
Filter: (b < 100)
-> Seq Scan on test_1
Filter: (b < 100)
(5 rows)
--
Ildar Musin
i.musin@postgrespro.ru
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (161+ messages) latest in thread
Message-ID: <57163954.2020701@postgrespro.ru>
Permalink: ../57163954.2020701@postgrespro.ru/
Also on: postgresql.org/message-id/57163954.2020701@postgrespro.ru
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: i.musin@postgrespro.ru, Langote_Amit_f8@lab.ntt.co.jp, ashutosh.bapat@enterprisedb.com, robertmhaas@gmail.com, a.korotkov@postgrespro.ru, amitlangote09@gmail.com, corey.huinker@gmail.com
Subject: Re: Declarative partitioning
In-Reply-To: <57163954.2020701@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox