Re: reasonable limit to number of schemas in a database? - Mailing list pgsql-general

From Tom Lane
Subject Re: reasonable limit to number of schemas in a database?
Date
Msg-id 13743.1177478055@sss.pgh.pa.us
Whole thread Raw
In response to reasonable limit to number of schemas in a database?  (Ben <bench@silentmedia.com>)
Responses Re: reasonable limit to number of schemas in a database?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: reasonable limit to number of schemas in a database?  (Ben <bench@silentmedia.com>)
List pgsql-general
Ben <bench@silentmedia.com> writes:
> I'm considering re-architecting a database to make use of many, many
> schemas.... over time, it would probably grow to be on the order of 3,000
> or so, with each schema holding ~100 tables. Is that an absurd amount, or
> well within postgres' limits? I haven't been able to find any information
> on what penalties one pays as you increase the schema count.

The number of schemas doesn't scare me so much as the number of tables.
Are you using a filesystem that can cope gracefully with 300K files in
one directory?  How many of these tables do you anticipate any one
session touching?  (That last translates to catalog cache and lock table
space...)

Generally, when someone proposes a scheme like this, they are thinking
that N identical tables are somehow better than one table with an
additional key column.  The latter is usually the better design, unless
you have special requirements you didn't mention.

            regards, tom lane

pgsql-general by date:

Previous
From: Benjamin Arai
Date:
Subject: Re: Slow query using simple equality operators
Next
From: Tom Lane
Date:
Subject: Re: Additional debugging of idle sessions?