X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8B4C38B9E80 for ; Wed, 23 Feb 2005 19:12:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02312-10 for ; Wed, 23 Feb 2005 19:12:38 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 668118B9CAD for ; Wed, 23 Feb 2005 19:12:37 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1NJCQ1Z021429; Wed, 23 Feb 2005 14:12:26 -0500 (EST) To: "Tomeh, Husam" Cc: "Joshua D. Drake" , pgsql-admin@postgresql.org Subject: Re: Partitioning Option? In-reply-to: References: Comments: In-reply-to "Tomeh, Husam" message dated "Wed, 23 Feb 2005 10:54:50 -0800" Date: Wed, 23 Feb 2005 14:12:26 -0500 Message-ID: <21428.1109185946@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/268 X-Sequence-Number: 16436 "Tomeh, Husam" writes: > (I was referring to object partitioning. For instance, if I have a huge > table with US counties as my partition key, I could create partitions > within the same table based on the partition key (a US county for > example). When querying, the engine will access the partition instead of > the whole table to get the result set. This is provided in Oracle DB EE. > So, I was wondering whether I can do similar thing in PostgreSQL since > we're exploring PostgreSQL) You can build it out of spare parts: either a view over a UNION ALL of component tables, or a parent table with a bunch of inheritance children, either way with rules to redirect insertions into the right subtable. (With the inheritance way you could instead use a trigger for that, which'd likely be more flexible.) It's not going to be quite as good as the Oracle facility, mainly because the planner has no direct understanding that it's a partitioning setup, but you can get most of the win. See past discussions in the mailing list archives for details. regards, tom lane