Re: Partitioning

From: "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>
To: "'Bernd Helmle'" <mailings(at)oopsware(dot)de>, "'Scott Marlowe'" <smarlowe(at)g2switchworks(dot)com>
Cc: "'Jim C(dot) Nasby'" <jim(at)nasby(dot)net>, "'Jeremy Haile'" <jhaile(at)fastmail(dot)fm>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Partitioning
Date: 2007-01-11 14:18:39
Message-ID: 045101c7358b$644554a0$6400a8c0@dualcore
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


Each partition can have its own disk, without using subpartitions.

CREATE TABLE th (id INT, name VARCHAR(30), adate DATE)
PARTITION BY LIST(YEAR(adate))
(
PARTITION p1999 VALUES IN (1995, 1999, 2003)
DATA DIRECTORY = '/var/appdata/95/data'
INDEX DIRECTORY = '/var/appdata/95/idx',
PARTITION p2000 VALUES IN (1996, 2000, 2004)
DATA DIRECTORY = '/var/appdata/96/data'
INDEX DIRECTORY = '/var/appdata/96/idx',
PARTITION p2001 VALUES IN (1997, 2001, 2005)
DATA DIRECTORY = '/var/appdata/97/data'
INDEX DIRECTORY = '/var/appdata/97/idx',
PARTITION p2000 VALUES IN (1998, 2002, 2006)
DATA DIRECTORY = '/var/appdata/98/data'
INDEX DIRECTORY = '/var/appdata/98/idx'
);

Subpartitions are just a way to break (parent) partitions up into
smaller pieces. Those of course can be moved to other disks
just like the main partitions.

-----Original Message-----
From: pgsql-performance-owner(at)postgresql(dot)org
[mailto:pgsql-performance-owner(at)postgresql(dot)org] On Behalf Of Bernd
Helmle
Sent: Thursday, January 11, 2007 6:51 AM
To: Scott Marlowe
Cc: Jim C. Nasby; Jeremy Haile; pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Partitioning

On Wed, 10 Jan 2007 15:30:16 -0600, Scott Marlowe
<smarlowe(at)g2switchworks(dot)com> wrote:

[...]

>
> And I don't think the mysql partition supports tablespaces either.
>

MySQL supports distributing partitions over multiple disks via the
SUBPARTITION clause [1].
I leave it to you, wether their syntax is cleaner, more powerful or
easier or ....;)

Bernd

[1]
http://dev.mysql.com/doc/refman/5.1/en/partitioning-subpartitions.html

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bernd Helmle 2007-01-11 14:32:56 Re: Partitioning
Previous Message Jeremy Haile 2007-01-11 14:02:01 Re: Partitioning