From: David Steele <david@pgmasters.net>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Declarative partitioning
Date: Thu, 20 Aug 2015 08:36:53 -0400
Message-ID: <55D5C9E5.6040900@pgmasters.net> (raw)
In-Reply-To: <55D5A1D0.2070709@lab.ntt.co.jp>
References: <55D3093C.5010800@lab.ntt.co.jp>
<CABOikdMMgkAG_iX1B_Yq4s-L8wd5PN4f1ptmPe0+z3E58bsArA@mail.gmail.com>
<55D5A1D0.2070709@lab.ntt.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 8/20/15 5:45 AM, Amit Langote wrote:
> On 2015-08-20 PM 06:27, Pavan Deolasee wrote:
>> On Tue, Aug 18, 2015 at 4:00 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp
>>> wrote:
>>>
>>> PARTITION BY LIST ON (name)
>>> PARTITION BY RANGE ON (year, month)
>>>
>>> PARTITION BY LIST ON ((lower(left(name, 2)))
>>> PARTITION BY RANGE ON ((extract(year from d)), (extract(month from d)))
>>>
>>>
>>
>> How about HASH partitioning? Are there plans to support foreign tables as
>> partitions?
>>
>
> I've not given HASH partitioning a lot of thought yet. About the latter,
> it seems it should not be too difficult to incorporate into the proposed
> partitioning internals.
Hash partitioning seems like it could wait. If fact, I've nearly always
implemented hash partitions as list partitions. This gives me control
over the hash function and allows me to use properties of the key to my
advantage. For instance - if your key is a sha1 hash there's no need to
rehash, just grab the required number of bits off the end of the key.
My experiences with Oracle's hash function were generally not good -
there's a reason many hash algorithms exist. If/when we do hash
partitioning in Postgres I'd like to see the hash function be
user-definable.
Meanwhile, I think list and range are a good start. I'd prefer to see
sub-partitioning before hash partitioning.
--
-David
david@pgmasters.net
Attachments:
[application/pgp-signature] signature.asc (841B, ../55D5C9E5.6040900@pgmasters.net/2-signature.asc)
download
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: david@pgmasters.net, Langote_Amit_f8@lab.ntt.co.jp, pavan.deolasee@gmail.com
Subject: Re: Declarative partitioning
In-Reply-To: <55D5C9E5.6040900@pgmasters.net>
* 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