Re: Partitioning Option?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tomeh, Husam" <htomeh(at)firstam(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Partitioning Option?
Date: 2005-02-23 19:12:26
Message-ID: 21428.1109185946@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Tomeh, Husam" <htomeh(at)firstam(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bruno Wolff III 2005-02-23 19:48:42 Re: Partitioning Option?
Previous Message Tomeh, Husam 2005-02-23 18:54:50 Re: Partitioning Option?