Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V23U4-0004G6-4z for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2013 18:08:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V23U3-00074b-F0 for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2013 18:08:19 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V23U2-00074P-9O for pgsql-admin@postgresql.org; Wed, 24 Jul 2013 18:08:18 +0000 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V23Tu-0007hu-PR for pgsql-admin@postgresql.org; Wed, 24 Jul 2013 18:08:17 +0000 Received: by mail-pb0-f41.google.com with SMTP id rp16so10141391pbb.28 for ; Wed, 24 Jul 2013 11:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=SBQjR6j6FZsIo/s7OJrehTP95QxrzQQkCJLhKPww7B4=; b=QqCcCTrrbWiNlKALoMmIBLOFYu3u205qjGKBDscpaHRjipRuUd5EP1yV3agEEhzrzH TLEN/HyL7vp4BrPkiWfMZZ4lQIzFPRrEgcererLjp1YuQiTvQjmaePMxtD0mFdiSzgke BiUfDFxpYXoDpVhY5OO/eUMm4nqC97vwuafWyA0IDG8d20D2LnB9wjVJTluBr713s4IY xHdvMos8UFN9R5/o1CcytzLNVmdTQSrpqRSjOoSg4XCOKP3PWYSQfcbppjTOWXpPPYpB MhY14vIjk86ZnMGAgM8kJlPANicisLfHQS9WlWb1jTuACARvREc+HYQNLmLhBVHMt3vh SXZw== X-Received: by 10.66.139.193 with SMTP id ra1mr18739075pab.70.1374689289444; Wed, 24 Jul 2013 11:08:09 -0700 (PDT) Received: from [192.168.1.4] ([117.202.158.208]) by mx.google.com with ESMTPSA id wr9sm49246093pbc.7.2013.07.24.11.08.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 11:08:08 -0700 (PDT) References: <20130724142155.GD31462@momjian.us> Mime-Version: 1.0 (1.0) In-Reply-To: <20130724142155.GD31462@momjian.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <158B9BCD-BE51-4AA4-A92C-9E056C2C1177@gmail.com> Cc: "pgsql-admin@postgresql.org" X-Mailer: iPhone Mail (10B350) From: Anand Muthukrishnan Subject: Re: Postgres schema having > 20,000 schemas Date: Wed, 24 Jul 2013 23:38:05 +0530 To: Bruce Momjian X-Pg-Spam-Score: 0.7 (/) 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 We want them all in one Database.=20 Multi database architecture is giving high amount of overhead during databa= se migrations and database connection pooling. So we are evaluating single = db with multi schema approach.=20 Also, is there any hard limit on number of schemas and tables that can be p= resent in one postgres database?=20 Sent from my iPhone On 24-Jul-2013, at 7:51 PM, 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 ar= e the >> implications of such a database design. >>=20 >> I was reading about postgres schemas here - http://www.postgresql.org/do= cs/8.2/ >> static/ddl-schemas.html and I'm planning to create one schema per accoun= t in my >> multi-tenant Ruby on Rails app. Each schema would have a set of tables t= o store >> data of the relevant account. >>=20 >> Each user/schema for all the features we offer, could have 50-60 tables. >>=20 >> Can postgres handle all of this without any hiccups, provided I allocate= a >> large EC2 instance to host the database server ? >>=20 >> By experience if any one faced trouble with such number of schemas in po= stgres, >> they could share and i thought i can get more guidance to avoid such pit= falls. >=20 > 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: >=20 > http://momjian.us/main/blogs/pgblog/2012.html#April_23_2012 >=20 > 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. >=20 > --=20 > Bruce Momjian http://momjian.us > EnterpriseDB http://enterprisedb.com >=20 > + It's impossible for everything to be true. + --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin