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

Re: Which gives good performance? separate database vs separate schema

From: tv(at)fuzzy(dot)cz
To: "Divakar Singh" <dpsmails(at)yahoo(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Which gives good performance? separate database vs separate schema
Date: 2010-11-25 12:02:08
Message-ID: d0ba0839bcf4b41b456ec741f705e9bb.squirrel@sq.gransy.com (view raw or flat)
Thread:
Lists: pgsql-performance
Hello,

> Now, should I put these tables in 1 Database's different schemas or in
> separate
> databases itself for good performance?
> I am using libpq for connection.
>
> Pictorial Representation:
>
> Process1 -> DB1.schema1.table1
>
> Process2 -> DB1.schema2.table1
>
>   Vs.
>
> Process1 -> DB1.default.table1
>
> Process2 -> DB2.default.table1
>
> Which one is better?

Well, that depends on what you mean by "database." In many other products
each database is completely separate (with it's own cache, processes etc).
In PostgreSQL, there's a cluster of databases, and all of them share the
same cache (shared buffers) etc.

I don't think you'll get performance improvement from running two
PostgreSQL clusters (one for DB1, one for DB2). And when running two
databases within the same cluster, there's no measurable performance
difference AFAIK.

So the two options are exactly the same.

Tomas


In response to

Responses

pgsql-performance by date

Next:From: Thomas KellererDate: 2010-11-25 12:03:29
Subject: Re: Which gives good performance? separate database vs separate schema
Previous:From: Divakar SinghDate: 2010-11-25 11:37:36
Subject: Which gives good performance? separate database vs separate schema

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