Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V23KR-0003sB-RI for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2013 17:58:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V23KR-0000xT-2u for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2013 17:58:23 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V23KP-0000xK-Q9 for pgsql-admin@postgresql.org; Wed, 24 Jul 2013 17:58:21 +0000 Received: from mail-ve0-x233.google.com ([2607:f8b0:400c:c01::233]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V23KM-0007Vc-NM for pgsql-admin@postgresql.org; Wed, 24 Jul 2013 17:58:20 +0000 Received: by mail-ve0-f179.google.com with SMTP id d10so7215541vea.38 for ; Wed, 24 Jul 2013 10:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=YPfuLk5KlO/7Q3Dql5GsDmTuc/c2A9a8hP4KzaZqc8o=; b=aPd1HGGyKGf29qJap2esFZqQ8c9zFU4wsAJI9ZsdUm/3CsAIb5F20BA/cTDoOVy1kX hSCBXwDUKf+s/eFzPszfcEw2CDQqKOhfYX65jODi7e3NRW1lSwIIEZvTzMtCh1uM/h1N azz59YTdOULd5bLe/4w8WFFP0ku2PhZQ9iQrRH2z7GvAZkSMw2mlDxzSTI4KgaVF8Mfx wT1JDOk59OC1Hyntq+8+Nisim1Ghyxd7WhKI2tR8Q7k+EL/5pZABBNMPZ9Z2veFplzN8 nTVGCa1O0Ip2tOsbG62SGqBGPn7rkSuMl8utgmrL2HB6PjRIbm7fCFVxvrcy7M/HoWbA 1E0w== X-Received: by 10.52.165.48 with SMTP id yv16mr12524886vdb.54.1374688697697; Wed, 24 Jul 2013 10:58:17 -0700 (PDT) Received: from [192.168.204.38] (173-161-251-161-Philadelphia.hfc.comcastbusiness.net. [173.161.251.161]) by mx.google.com with ESMTPSA id 20sm15268205vde.3.2013.07.24.10.58.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 10:58:16 -0700 (PDT) Message-ID: <51F015AD.503@gmail.com> Date: Wed, 24 Jul 2013 13:58:05 -0400 From: Elliot User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Momjian CC: Anand Muthukrishnan , pgsql-admin@postgresql.org Subject: Re: Postgres schema having > 20,000 schemas References: <20130724142155.GD31462@momjian.us> In-Reply-To: <20130724142155.GD31462@momjian.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Also, the "Billion Tables Project" mentions a few attempts at databases with many tables (20k schemas at 50 tables per schema is one million tables). The presentation page is here http://www.pgcon.org/2013/schedule/events/595.en.html On 2013-07-24 10:21, Bruce Momjian wrote: > On Wed, Jul 24, 2013 at 04:41:07PM +0530, Anand Muthukrishnan wrote: >> Can a single Postgres database contain more than 20,000 schemas? What are the >> implications of such a database design. >> >> I was reading about postgres schemas here - http://www.postgresql.org/docs/8.2/ >> static/ddl-schemas.html and I'm planning to create one schema per account in my >> multi-tenant Ruby on Rails app. Each schema would have a set of tables to store >> data of the relevant account. >> >> Each user/schema for all the features we offer, could have 50-60 tables. >> >> Can postgres handle all of this without any hiccups, provided I allocate a >> large EC2 instance to host the database server ? >> >> By experience if any one faced trouble with such number of schemas in postgres, >> they could share and i thought i can get more guidance to avoid such pitfalls. > Well, I think the big question is whether you want them all in the same > database (in separate schemas), or in their own databases. You might > want to look at this: > > http://momjian.us/main/blogs/pgblog/2012.html#April_23_2012 > > We have done some work in improving performance for databases with many > table and many schemas. Not sure about the 20k schema performance, > though. You might need to just test it. > -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin