Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRyMi-000821-Q7 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 08:04:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZRyMi-0003kX-8Q for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 08:04:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZRyMg-0003ir-7s for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 08:04:54 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZRyMd-0003MB-BT for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 08:04:53 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t7J84gCn019342; Wed, 19 Aug 2015 17:04:42 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 972885F58E; Wed, 19 Aug 2015 17:04:42 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 7B7345F611; Wed, 19 Aug 2015 17:04:42 +0900 (JST) Received: from [127.0.0.1] ([129.60.241.61]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t7J84gf3021456; Wed, 19 Aug 2015 17:04:42 +0900 Subject: Re: Declarative partitioning To: Marc Mamin , Pg Hackers References: <55D3093C.5010800@lab.ntt.co.jp> From: Amit Langote Message-ID: <55D43840.5030504@lab.ntt.co.jp> Date: Wed, 19 Aug 2015 17:03:12 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2015-08-19 AM 02:57, Marc Mamin wrote: >> 2. Creating a partition of a partitioned table >> >> CREATE TABLE table_name >> PARTITION OF partitioned_table_name >> FOR VALUES values_spec; >> >> Where values_spec is: >> >> listvalues: [IN] (val1, ...) >> > > Would it make sense to allow one complementary partition to the listvalues? > > listvalues: [[NOT] IN] (val1, ...) > > I've thought a few times about moving data with some most common values to dedicated partitions > and keeping the rest in a separate one... > Thanks, that's definitely something to consider. I have been thinking of a sort of default list partition for the "rest" of values. Would you rather declare that with something like the below than having to enumerate all the values in a NOT IN list? Or the NOT IN way is more intuitive/friendly? CREATE TABLE _rest PARTITION OF table_name FOR VALUES [ IN ] DEFAULT Of course, at most one such partition would be allowed. Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers