Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system. - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.
Date
Msg-id 20090912194857.GR17756@tamriel.snowman.net
Whole thread Raw
In response to Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.
List pgsql-hackers
* Stephen Frost (sfrost@snowman.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

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: drop tablespace error: invalid argument
Next
From: Mark Mielke
Date:
Subject: Re: Re: [COMMITTERS] Can not create more than 32766 databases in ufs file system.