pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: johnnnnnn <john@phaedrusdeinus.org>
To: pgsql-performance@postgresql.org
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] CLUSTER command
Date: Thu, 12 Dec 2002 17:00:02 -0600
Message-ID: <20021212230002.GC8278@performics.com> (raw)
In-Reply-To: <3DF91030.A372DF7C@nsd.ca>
References: <3DF90042.E5290B7F@nsd.ca>
	<20021212135913.Q11714-100000@megazone23.bigpanda.com>
	<20021212222641.GA8278@performics.com>
	<3DF91030.A372DF7C@nsd.ca>

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



view thread (14+ messages)  latest in thread

Message-ID: <20021212230002.GC8278@performics.com>
Permalink:  ../20021212230002.GC8278@performics.com/
Also on:    postgresql.org/message-id/20021212230002.GC8278@performics.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: john@phaedrusdeinus.org, pgsql-performance@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] CLUSTER command
  In-Reply-To: <20021212230002.GC8278@performics.com>

* 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