pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomeh, Husam <htomeh@firstam.com>
Cc: Joshua D. Drake <jd@commandprompt.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Partitioning Option?
Date: Wed, 23 Feb 2005 14:12:26 -0500
Message-ID: <21428.1109185946@sss.pgh.pa.us> (raw)
In-Reply-To: <C45835824D00A844BBD0F032D5CDED9212FC75@pisgana01sxch01.ana.firstamdata.com>
References: <C45835824D00A844BBD0F032D5CDED9212FC75@pisgana01sxch01.ana.firstamdata.com>

"Tomeh, Husam" <htomeh@firstam.com> 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



view thread (8+ messages)  latest in thread

Message-ID: <21428.1109185946@sss.pgh.pa.us>
Permalink:  ../21428.1109185946@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21428.1109185946@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, htomeh@firstam.com, jd@commandprompt.com
  Subject: Re: Partitioning Option?
  In-Reply-To: <21428.1109185946@sss.pgh.pa.us>
  References: <C45835824D00A844BBD0F032D5CDED9212FC75@pisgana01sxch01.ana.firstamdata.com> <21428.1109185946@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox