Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xw577-00040k-VX for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2014 08:16:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xw577-0003q5-0c for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2014 08:16:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xw574-0003pw-R9 for pgsql-hackers@postgresql.org; Wed, 03 Dec 2014 08:16:42 +0000 Received: from mail-bn1bon0605.outbound.protection.outlook.com ([2a01:111:f400:fc10::1:605] helo=na01-bn1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xw56w-0001OG-2L for pgsql-hackers@postgresql.org; Wed, 03 Dec 2014 08:16:40 +0000 Received: from decina.attlocal.net (108.232.179.70) by BY1PR11MB0344.namprd11.prod.outlook.com (25.160.206.16) with Microsoft SMTP Server (TLS) id 15.1.31.17; Wed, 3 Dec 2014 08:16:25 +0000 Message-ID: <547EC6D3.1030309@BlueTreble.com> Date: Wed, 3 Dec 2014 02:16:19 -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: Amit Langote , 'Robert Haas' CC: 'Andres Freund' , 'Alvaro Herrera' , 'Bruce Momjian' , 'Pg Hackers' Subject: Re: On partitioning References: <20140829155607.GF7705@eldon.alvh.no-ip.org> <20141013192755.GC21267@momjian.us> <20141013193838.GZ7043@eldon.alvh.no-ip.org> <20141013194317.GF21267@momjian.us> <010801cff1ba$f3f16b90$dbd442b0$@lab.ntt.co.jp> <20141027092933.GU1791@alvin.alvh.no-ip.org> <20141027114421.GA31497@awork2.anarazel.de> <01b001cff270$d470b990$7d522cb0$@lab.ntt.co.jp> <20141028100629.GE2639@awork2.anarazel.de> <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> In-Reply-To: <015b01d00eab$56d37700$047a6500$@lab.ntt.co.jp> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [108.232.179.70] X-ClientProxiedBy: BLUPR01CA031.prod.exchangelabs.com (25.160.23.21) To BY1PR11MB0344.namprd11.prod.outlook.com (25.160.206.16) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR11MB0344; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(3)(1); SRVR:BY1PR11MB0344; X-Forefront-PRVS: 0414DF926F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(52034003)(377454003)(24454002)(54094003)(479174003)(199003)(51704005)(42186005)(122386002)(68736005)(107046002)(65816999)(76176999)(87266999)(21056001)(50986999)(53416004)(54356999)(4396001)(64126003)(64706001)(106356001)(31966008)(20776003)(99396003)(120916001)(47776003)(65956001)(97736003)(66066001)(105586002)(81156004)(65806001)(36756003)(62966003)(40100003)(77156002)(101416001)(50466002)(46102003)(15202345003)(23676002)(87976001)(95666004)(15975445006)(93886004)(83506001)(69596002)(80316001)(19580395003)(102836001)(92566001)(33656002)(92726001)(86362001)(85282002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR11MB0344; H:decina.attlocal.net; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY1PR11MB0344; 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/2/14, 9:43 PM, Amit Langote wrote: >> >What is an overflow partition and why do we want that? >> > > That would be a default partition. That is, where the tuples that don't belong elsewhere (other defined partitions) go. VALUES clause of the definition for such a partition would look like: > > (a range partition) ... VALUES LESS THAN MAXVALUE > (a list partition) ... VALUES DEFAULT > > There has been discussion about whether there shouldn't be such a place for tuples to go. That is, it should generate an error if a tuple can't go anywhere (or support auto-creating a new one like in interval partitioning?) If we are going to do this, should the data just go into the parent? That's what would happen today. FWIW, I think an overflow would be useful, but there should be a way to (dis|en)able it. >> >What are you going to do if the partitioning key has two columns of >> >different data types? >> > > Sorry, this totally eluded me. Perhaps, the 'values' needs some more thought. They are one of the most crucial elements of the scheme. > > I wonder if your suggestion of pg_node_tree plays well here. This then could be a list of CONSTs or some such... And I am thinking it's a concern only for range partitions, no? (that is, a multicolumn partition key) > > I think partkind switches the interpretation of the field as appropriate. Am I missing something? By the way, I had mentioned we could have two values fields each for range and list partition kind. The more SQL way would be records (composite types). That would make catalog inspection a LOT easier and presumably make it easier to change the partitioning key (I'm assuming ALTER TYPE cascades to stored data). Records are stored internally as tuples; not sure if that would be faster than a List of Consts or a pg_node_tree. Nodes would theoretically allow using things other than Consts, but I suspect that would be a bad idea. Something else to consider... our user-space support for ranges is now rangetypes, so perhaps that's what we should use for range partitioning. The up-side (which would be a double-edged sword) is that you could leave holes in your partitioning map. Note that in the multi-key case we could still have a record of rangetypes. -- 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