Re: [GENERAL] Physical Database Configuration

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, nolan(at)celery(dot)tssi(dot)com, Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Physical Database Configuration
Date: 2003-07-19 03:19:47
Message-ID: Pine.LNX.4.21.0307191314030.21451-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, 18 Jul 2003, Bruce Momjian wrote:

> Tom Lane wrote:
> > nolan(at)celery(dot)tssi(dot)com writes:
> > > I disagree. Just as you can have multiple schemas within one database
> > > you can have multiple tablespaces within one database.
> >
> > > And the tablespace is irrelevant as far as specifying an object is concerned.
> > > A fully qualified object would be:
> > > database.schema.object,
> > > not tablespace.database.schema.object or database.tablespace.schema.object.
> >
> > Right, the tablespace structure is really orthogonal to the
> > database/schema structure.
> >
> > I would envision tablespaces as being named by database-cluster-wide
> > names, just as users and groups are. Any given table could be placed
> > in any tablespace (although perhaps we want to invent some permission
> > mechanism here).
> >
> > Physically a tablespace is a directory with sub-directories for
> > databases under it --- so $PGDATA/base plays the role of the default
> > tablespace for a cluster. (The reason you need per-database
> > sub-directories is mostly to support DROP DATABASE, which has to be
> > able to nuke a database without knowing exactly what's in it.) But
> > this structure doesn't have anything to do with the logical structure
> > of the database cluster.
>
> Another good reason for per-database directories under the tablespace is
> to prevent directories from containing too many files.

I have a 3/4s finish implementation of table spaces. Per database
directories under the table space are required because CREATE DATABASE
just copies the data directory of the template database. If the databases
were in the same table space, they would need to share system catalogs
and it would also not be possible to create a database in a new table
space because the pg_class and pg_namespace would have references to the
table spaces used by the template database, not the new table space.

I will elaborate further when I have a near complete patch.

Thanks,

Gavin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kris Jurka 2003-07-19 03:22:24 Re: Urgent: 10K or more connections
Previous Message Rod Taylor 2003-07-19 03:06:36 Re: [GENERAL] Physical Database Configuration

Browse pgsql-hackers by date

  From Date Subject
Next Message Kris Jurka 2003-07-19 03:22:24 Re: Urgent: 10K or more connections
Previous Message Rod Taylor 2003-07-19 03:06:36 Re: [GENERAL] Physical Database Configuration