Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E001E9FB27A for ; Wed, 10 Jan 2007 16:32:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 78490-05 for ; Wed, 10 Jan 2007 16:31:44 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by postgresql.org (Postfix) with ESMTP id 5FD9F9FB276 for ; Wed, 10 Jan 2007 16:31:52 -0400 (AST) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id E41DD75574 for ; Wed, 10 Jan 2007 15:28:00 -0500 (EST) Received: from web2.messagingengine.com ([10.202.2.211]) by out1.internal (MEProxy); Wed, 10 Jan 2007 15:28:00 -0500 Received: by web2.messagingengine.com (Postfix, from userid 99) id C16E6179E1; Wed, 10 Jan 2007 15:28:00 -0500 (EST) Message-Id: <1168460880.7578.1168617399@webmail.messagingengine.com> X-Sasl-Enc: G9nRyZuxCFn3zHMAmJoAIH5bsCCJQM7pqg9TQkqOkTOG 1168460880 From: "Jeremy Haile" To: pgsql-performance@postgresql.org Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface References: <7F10D26ECFA1FB458B89C5B4B0D72C2B82CD0A@sesrv12.wirelesscar.com> <20070110202006.GU12217@nasby.net> Subject: Re: Partitioning In-Reply-To: <20070110202006.GU12217@nasby.net> Date: Wed, 10 Jan 2007 15:28:00 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/148 X-Sequence-Number: 22749 I really wish that PostgreSQL supported a "nice" partitioning syntax like MySQL has. Here is an example: CREATE TABLE tr (id INT, name VARCHAR(50), purchased DATE) PARTITION BY RANGE( YEAR(purchased) ) ( PARTITION p0 VALUES LESS THAN (1990), PARTITION p1 VALUES LESS THAN (1995), PARTITION p2 VALUES LESS THAN (2000), PARTITION p3 VALUES LESS THAN (2005) ); And to drop a partition: ALTER TABLE tr DROP PARTITION p2; This seems so much more intuitive and simpler than what is required to set it up in PostgreSQL. Does PostgreSQL's approach to table partitioning have any advantage over MySQL? Is a "nicer" syntax planned for Postgres? On Wed, 10 Jan 2007 14:20:06 -0600, "Jim C. Nasby" said: > BTW, someone coming up with a set of functions to handle partitioning > for the general 'partition by time' case would make a GREAT project on > pgFoundry. > > On Fri, Jan 05, 2007 at 12:47:08PM +0100, Mikael Carneholm wrote: > > Take a look at the set of partitioning functions I wrote shortly after > > the 8.1 release: > > > > http://www.studenter.hb.se/~arch/files/part_functions.sql > > > > You could probably work something out using those functions (as-is, or > > as inspiration) together with pgAgent > > (http://www.pgadmin.org/docs/1.4/pgagent.html) > > > > /Mikael > > > > > -----Original Message----- > > > From: pgsql-performance-owner@postgresql.org > > [mailto:pgsql-performance- > > > owner@postgresql.org] On Behalf Of Arnau > > > Sent: den 5 januari 2007 12:02 > > > To: pgsql-performance@postgresql.org > > > Subject: [PERFORM] Partitioning > > > > > > Hi all, > > > > > > I'm not sure if this question fits in the topic of this list. > > > > > > I'm interested in partitioning and it's the first time I'd use it. > > > There is an issue I don't know how you handle it. Lets say I'm > > > interested in store monthly based statistical data like the example of > > > http://www.postgresql.org/docs/8.2/static/ddl-partitioning.html. What > > I > > > don't like of this approach is that the monthly tables, rules... must > > be > > > created "manually" or at least I haven't found any other option. > > > > > > My question is how do you manage this? do you have a cron task that > > > creates automatically these monthly elements (tables, rules, ... ) or > > > there is another approach that doesn't require external things like > > cron > > > only PostgreSQL. > > > -- > > > Arnau > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > > TIP 5: don't forget to increase your free space map settings > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 9: In versions below 8.0, the planner will ignore your desire to > > choose an index scan if your joining column's datatypes do not > > match > > > > -- > Jim Nasby jim@nasby.net > EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly