Re: Databases Vs. Schemas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Subbiah, Stalin" <SSubbiah(at)netopia(dot)com>
Cc: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>, "'pgsql-performance(at)postgresql(dot)org'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Databases Vs. Schemas
Date: 2004-03-22 22:04:50
Message-ID: 8796.1079993090@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

"Subbiah, Stalin" <SSubbiah(at)netopia(dot)com> writes:
> Is it better to have 1000 databases vs 1000 schemas in a
> database cluster.

You almost certainly want to go for schemas, at least from a performance
point of view. The overhead of a schema is small (basically one more
row in pg_namespace) whereas the overhead of a database is not trivial.

The main reason you might not want to use schemas is if you want fairly
airtight separation between different services. Separate databases
would prevent services from looking at each others' catalog entries.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Subbiah, Stalin 2004-03-23 00:05:45 Benchmarking postgres on Solaris/Linux
Previous Message Sam Barnett-Cormack 2004-03-22 21:34:46 Re: Slow Foreign Key

Browse pgsql-performance by date

  From Date Subject
Next Message Subbiah, Stalin 2004-03-23 00:05:45 Benchmarking postgres on Solaris/Linux
Previous Message Subbiah, Stalin 2004-03-22 21:30:24 Databases Vs. Schemas