Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-admin by date

Next:From: Bruno Wolff IIIDate: 2005-02-23 19:48:42
Subject: Re: Partitioning Option?
Previous:From: Tomeh, HusamDate: 2005-02-23 18:54:50
Subject: Re: Partitioning Option?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group