Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy6Y8-00049r-CT for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Dec 2014 22:13:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xy6Y7-00032Z-1Q for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Dec 2014 22:12:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xy6Y5-00032P-LZ for pgsql-hackers@postgresql.org; Mon, 08 Dec 2014 22:12:57 +0000 Received: from mail-bn1on0695.outbound.protection.outlook.com ([2a01:111:f400:fc10::695] helo=na01-bn1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy6Y0-00087P-1z for pgsql-hackers@postgresql.org; Mon, 08 Dec 2014 22:12:55 +0000 Received: from decina.local (24.55.12.91) by BY1PR11MB0341.namprd11.prod.outlook.com (25.160.206.154) with Microsoft SMTP Server (TLS) id 15.1.31.17; Mon, 8 Dec 2014 22:12:43 +0000 Message-ID: <54862252.3070405@BlueTreble.com> Date: Mon, 8 Dec 2014 16:12:34 -0600 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Josh Berkus , Amit Langote , 'Amit Kapila' CC: 'Robert Haas' , 'Andres Freund' , 'Alvaro Herrera' , 'Bruce Momjian' , 'Pg Hackers' Subject: Re: On partitioning References: <20140829155607.GF7705@eldon.alvh.no-ip.org> <053501cffa30$ecdf8700$c69e9500$@lab.ntt.co.jp> <066501cffd52$3d919390$b8b4bab0$@lab.ntt.co.jp> <032601d00471$ea6f4280$bf4dc780$@lab.ntt.co.jp> <04da01d00917$2dde1010$899a3030$@lab.ntt.co.jp> <015b01d00eab$56d37700$047a6500$@lab.ntt.co.jp> <035801d012a8$458f0170$d0ad0450$@lab.ntt.co.jp> <001001d012b7$a81380f0$f83a82d0$@lab.ntt.co.jp> <5485ED3C.7020206@agliodbs.com> In-Reply-To: <5485ED3C.7020206@agliodbs.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [24.55.12.91] X-ClientProxiedBy: BN1PR08CA0020.namprd08.prod.outlook.com (10.242.217.148) To BY1PR11MB0341.namprd11.prod.outlook.com (25.160.206.154) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR11MB0341; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY1PR11MB0341; X-Forefront-PRVS: 041963B986 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(479174003)(377454003)(199003)(51704005)(24454002)(189002)(107046002)(93886004)(106356001)(105586002)(15975445007)(122386002)(117636001)(59896002)(97736003)(50466002)(21056001)(46102003)(64126003)(68736005)(36756003)(4396001)(40100003)(83506001)(23676002)(561944003)(101416001)(19580395003)(31966008)(99396003)(64706001)(20776003)(65956001)(120916001)(77156002)(54356999)(65816999)(62966003)(47776003)(92566001)(87266999)(87976001)(50986999)(42186005)(76176999)(66066001)(86362001)(85282002)(62816006)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR11MB0341; H:decina.local; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY1PR11MB0341; X-OriginatorOrg: bluetreble.com X-Pg-Spam-Score: -1.9 (-) 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 12/8/14, 12:26 PM, Josh Berkus wrote: > 4. Creation Locking Problem > high probability of lock pile-ups whenever a new partition is created on > demand due to multiple backends trying to create the partition at the > same time. > Not Addressed? Do users actually try and create new partitions during DML? That sounds doomed to failure in pretty much any system... > 6. Unique Index Problem > Cannot create a unique index across multiple partitions, which prevents > the partitioned table from being FK'd. > Not Addressed > (but could be addressed in the future) And would be extremely useful even with simple inheritance, let alone partitioning... > 9. Hibernate Problem > When using the trigger method, inserts into the master partition return > 0, which Hibernate and some other ORMs regard as an insert failure. > Addressed. It would be really nice to address this with regular inheritance too... > 11. Hash Partitioning > Some users would prefer to partition into a fixed number of > hash-allocated partitions. > Not Addressed. Though, you should be able to do that in either system if you bother to define your own hash in a BEFORE trigger... > A. COPY/ETL then attach > In inheritance partitioning, you can easily build a partition outside > the master and then "attach" it, allowing for minimal disturbance of > concurrent users. Could be addressed in the future. How much of the desire for this is because our current "row routing" solutions are very slow? I suspect that's the biggest reason, and hopefully Alvaro's proposal mostly eliminates it. > B. Catchall Partition > Many partitioning schemes currently contain a "catchall" partition which > accepts rows outside of the range of the partitioning scheme, due to bad > input data. Probably not handled on purpose; Alvaro is proposing that > we reject these instead, or create the partitions on demand, which is a > legitimate approach. > > C. Asymmetric Partitioning / NULLs in partition column > This is the classic Active/Inactive By Month setup for partitions. > Could be addressed via special handling for NULL/infinity in the > partitioned column. If we allowed for a "catchall partition" and supported normal inheritance/triggers on that partition then users could continue to do whatever they needed with data that didn't fit the "normal" partitioning pattern. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers