Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C9E372E30C6; Wed, 28 Nov 2007 16:41:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 09522-07; Wed, 28 Nov 2007 16:41:22 -0400 (AST) Received: from fetter.org (start.fetter.org [66.92.188.65]) by postgresql.org (Postfix) with ESMTP id B9EDB2E30C5; Wed, 28 Nov 2007 16:41:21 -0400 (AST) Received: by fetter.org (Postfix, from userid 500) id DAE8DFBCDAF; Wed, 28 Nov 2007 12:41:20 -0800 (PST) Date: Wed, 28 Nov 2007 12:41:20 -0800 From: David Fetter To: PostgreSQL Docs Cc: PostgreSQL Patches Subject: Re: Partition: use triggers instead of rules Message-ID: <20071128204120.GI24146@fetter.org> References: <20071128202615.GG24146@fetter.org> <20071128123904.672beb8b@commandprompt.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tsOsTdHNUZQcU9Ye" Content-Disposition: inline In-Reply-To: <20071128123904.672beb8b@commandprompt.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/106 X-Sequence-Number: 4639 --tsOsTdHNUZQcU9Ye Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 28, 2007 at 12:39:04PM -0800, Joshua D. Drake wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Wed, 28 Nov 2007 12:26:15 -0800 > David Fetter wrote: > > > Folks, > > > > Best practices for partitioning so far have shown that TRIGGERs are > > better than RULEs for most cases. Please find attached a patch which > > reflects this. > > > > Thanks to Robert Treat for help putting this together :) > > > > Cheers, > > David. > > +1 > > Joshua D. Drake Per Robert, I've also dropped the UNION partitioning suggestion as it's pretty useless. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate --tsOsTdHNUZQcU9Ye Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="partition.diff" Index: doc/src/sgml/ddl.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ddl.sgml,v retrieving revision 1.77 diff -c -r1.77 ddl.sgml *** doc/src/sgml/ddl.sgml 28 Nov 2007 15:42:31 -0000 1.77 --- doc/src/sgml/ddl.sgml 28 Nov 2007 20:39:48 -0000 *************** *** 2571,2594 **** script that generates the required DDL automatically. - - Partitioning can also be arranged using a UNION ALL - view: - - - CREATE VIEW measurement AS - SELECT * FROM measurement_y2004m02 - UNION ALL SELECT * FROM measurement_y2004m03 - ... - UNION ALL SELECT * FROM measurement_y2005m11 - UNION ALL SELECT * FROM measurement_y2005m12 - UNION ALL SELECT * FROM measurement_y2006m01; - - - However, the need to - recreate the view adds an extra step to adding and dropping - individual partitions of the data set. - --- 2571,2576 ---- --tsOsTdHNUZQcU9Ye--