Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-hackers(at)postgreSQL(dot)org
Cc: fulan Peng <fulanpeng(at)gmail(dot)com>
Subject: Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.
Date: 2009-09-12 19:48:57
Message-ID: 20090912194857.GR17756@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

* Stephen Frost (sfrost(at)snowman(dot)net) wrote:
> Ehhh, it's likely to be cached.. Sounds like a stretch to me that this
> would actually be a performance hit. If it turns out to really be one,
> we could just wait to move to subdirectories until some threshold (eg-
> 30k) is hit.

Thinking this through a bit more, I realized that I didn't explain my
thought here very well. My idea would be-
do everything as we do now, until we hit a threshold (perhaps an easy
one would be '10000').
Once we hit the threshold, create a subdirectory first and then the new
database directory in that. eg:

0/
1/
2/
3/
4/
[...]
9999/
00001/0/
00001/1/
00001/2/
00001/3/
00001/[...]
00001/9999/
00002/0/
00002/1/
00002/2/
00002/[...]
00002/9999/
00003/0/
00003/1/
[...]
09999/0/
09999/1/
09999/[...]
09999/9999/

This would allow for 220M+ databases. I'm not sure how bad it'd be to
introduce another field to pg_database which provides the directory (as
it'd now be distinct from the oid..) or if that might require alot of
changes. Not sure how easy it'd be to implement something to address
this problem while we continue to tie the directory name to the oid.

Thanks,

Stephen

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Mark Mielke 2009-09-12 19:52:32 Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.
Previous Message Stephen Frost 2009-09-12 19:33:08 Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Mielke 2009-09-12 19:52:32 Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.
Previous Message Stephen Frost 2009-09-12 19:35:26 Re: drop tablespace error: invalid argument