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

Re: [GENERAL] CLUSTER command

From: johnnnnnn <john(at)phaedrusdeinus(dot)org>
To: pgsql-performance(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] CLUSTER command
Date: 2002-12-12 23:00:02
Message-ID: 20021212230002.GC8278@performics.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-interfacespgsql-performance
On Thu, Dec 12, 2002 at 05:39:44PM -0500, Jean-Luc Lachance wrote:
> Let's create a new command:
> 
> PARTITION <table> ON <attribute>
<snip>
> Because the table file is already extended (2G limit) using
> different files extension (.N)
> how complicated (modifying the code) would it be to have the table
> files split according to the cluster key?

I think the code changes would be complicated. Just at a 30-second
consideration, this would need to touch:
- all sql (selects, inserts, updates, deletes)
- vacuuming
- indexing
- statistics gathering
- existing clustering

That's not to say it's not worthwhile to look into, but it's big.

All of that aside, a view over unions is possible now:

create table u1 (...);
create table u2 (...);
create table u3 (...);

create view uv as (select "A" as partition_key, ... from u1
                   union all
                   select "B" as partition_key, ... from u2
                   union all
                   select "C" as partition_key, ... from u3);

That keeps the tables in different files on-disk while still allowing
you to query against all of them. You need to index them separately
and logic is necessary when changing data.

Hope that helps.

-johnnnnnnnnnn

In response to

Responses

pgsql-performance by date

Next:From: Stephan SzaboDate: 2002-12-13 00:03:47
Subject: Re: [PERFORM] CLUSTER command
Previous:From: Michael EngelhartDate: 2002-12-12 22:50:55
Subject: PerformPortalClose warning in 7.3

pgsql-interfaces by date

Next:From: Stephan SzaboDate: 2002-12-13 00:03:47
Subject: Re: [PERFORM] CLUSTER command
Previous:From: Michael EngelhartDate: 2002-12-12 22:50:55
Subject: PerformPortalClose warning in 7.3

pgsql-general by date

Next:From: Neil ConwayDate: 2002-12-12 23:04:49
Subject: Re: client for solaris
Previous:From: Michael EngelhartDate: 2002-12-12 22:50:55
Subject: PerformPortalClose warning in 7.3

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