Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 583BA133655C for ; Thu, 25 Nov 2010 08:02:18 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 04927-06 for ; Thu, 25 Nov 2010 12:02:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id E66E2133616B for ; Thu, 25 Nov 2010 08:02:10 -0400 (AST) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id 8882F15E412E; Thu, 25 Nov 2010 13:02:08 +0100 (CET) Received: from 85.162.33.90 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Thu, 25 Nov 2010 13:02:08 +0100 Message-ID: In-Reply-To: <991565.83793.qm@web65414.mail.ac4.yahoo.com> References: <991565.83793.qm@web65414.mail.ac4.yahoo.com> Date: Thu, 25 Nov 2010 13:02:08 +0100 Subject: Re: Which gives good performance? separate database vs separate schema From: tv@fuzzy.cz To: "Divakar Singh" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_20=-0.001 X-Spam-Level: X-Archive-Number: 201011/369 X-Sequence-Number: 41393 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