Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id BC78D9FB665 for ; Fri, 25 May 2007 15:17:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 44529-01 for ; Fri, 25 May 2007 15:17:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id 691619FC290 for ; Fri, 25 May 2007 15:16:10 -0300 (ADT) Received: by fafnir.androme.com (Postfix, from userid 1003) id 6C44BB94614; Fri, 25 May 2007 20:16:09 +0200 (CEST) Message-ID: <465727E8.8090806@andromeiberica.com> Date: Fri, 25 May 2007 20:16:08 +0200 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Tom Lane CC: PostgreSQL Performance Subject: Re: How PostgreSQL handles multiple DDBB instances? References: <4656A3BE.1070409@andromeiberica.com> <8684.1180103080@sss.pgh.pa.us> <465719D5.9040107@andromeiberica.com> <19775.1180116288@sss.pgh.pa.us> In-Reply-To: <19775.1180116288@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/532 X-Sequence-Number: 24922 Tom Lane wrote: > Arnau writes: >>> Can you instead run things with one postmaster per machine and one >>> database per customer within that instance? From a performance >>> perspective this is likely to work much better. > >> What I meant is just have only one postmaster per server and a lot of >> databases running in it. > > OK, we are on the same page then. Should work fine. I think I've heard > of people running installations with thousands of DBs in them. You'll > want to test it a bit of course ... I'm worried about performance, I have done some tests and I have on a server more than 400 DBs, so it's possible to run such amount of DBs in a single postmaster. The point I'm worried is performance. Do you think the performance would be better executing exactly the same queries only adding an extra column to all the tables e.g. customer_id, than open a connection to the only one customers DB and execute the query there? I don't know if PostgreSQL cache's mechanism works as good as querying to 400 possible DBs or just to one possible DB. Thank you very much for your help :) -- Arnau