maximum number of databases and / or schemas in a single database instance

Started by Menelaos PerdikeasSemantixover 13 years ago4 messagesgeneral
Jump to latest
#1Menelaos PerdikeasSemantix
mperdikeas.semantix@gmail.com

The following page:

http://www.postgresql.org/about/

mentions some limits but not the following:

[1]: maximum number of databases per database server instance
[2]: maximum number of schemas per database

Is there empirical information on whether both these values can be as high
as a few hundreds? (I don't really need any more for my use case)

Thanks,
Menelaos.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Menelaos PerdikeasSemantix (#1)
Re: maximum number of databases and / or schemas in a single database instance

Menelaos PerdikeasSemantix <mperdikeas.semantix@gmail.com> writes:

The following page:
http://www.postgresql.org/about/

mentions some limits but not the following:

[1] maximum number of databases per database server instance
[2] maximum number of schemas per database

Is there empirical information on whether both these values can be as high
as a few hundreds? (I don't really need any more for my use case)

You can certainly have hundreds of schemas. I wouldn't really recommend
more than a few dozen databases per instance, though. It tends to bog
down autovacuum, and remember you are storing a separate copy of the
system catalogs per database. You might be able to make a few hundred
databases work all right if you don't mind expending some tuning effort;
but a few thousand is probably right out.

regards, tom lane

#3Chris Angelico
rosuav@gmail.com
In reply to: Tom Lane (#2)
Re: maximum number of databases and / or schemas in a single database instance

On Sun, Aug 5, 2012 at 2:05 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Menelaos PerdikeasSemantix <mperdikeas.semantix@gmail.com> writes:

The following page:
http://www.postgresql.org/about/

mentions some limits but not the following:

[1] maximum number of databases per database server instance
[2] maximum number of schemas per database

Is there empirical information on whether both these values can be as high
as a few hundreds? (I don't really need any more for my use case)

You can certainly have hundreds of schemas.

What about thousands of schemas? Is there significant cost to schemas
beyond the tables they contain?

Chris Angelico

#4Ben
bench@silentmedia.com
In reply to: Menelaos PerdikeasSemantix (#1)
Re: maximum number of databases and / or schemas in a single database instance

On Aug 4, 2012, at 12:24 PM, Menelaos PerdikeasSemantix wrote:

The following page:

http://www.postgresql.org/about/

mentions some limits but not the following:

[1] maximum number of databases per database server instance
[2] maximum number of schemas per database

Is there empirical information on whether both these values can be as high as a few hundreds? (I don't really need any more for my use case)

As a anecdote, we have a postgres cluster running a single db with ~1200 schemas, each schema having ~600 relations. Tab-completion is a little slow, but http://archives.postgresql.org/pgsql-general/2012-03/msg00666.php allowed things to be quite reasonable.