Convert OID intergers to path strings.

From: fulan Peng <fulanpeng(at)gmail(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: Convert OID intergers to path strings.
Date: 2009-09-13 18:06:11
Message-ID: bf0f1bc90909131106k1cc69dcagac0d43a7b09ead5d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi, committers!

I am naive for postgresql. I have millions of tiny databases. When I
was trying to createdb, it fails because each database is saved in
$PG_DATA/base/Oid. In UFS system, one directory maximum can hold
32768 subdirectories.

Oid is 4 byte integer. Subdirectory is a path name with maximum 32768
variations. Use Oid as a directory name to save object is not a good
practice because they are different object.

For myself, I want to make 2 functions Oid2Dir and Dir2Oid. For example:

Oid Dir Object Location
1 00/00/00/01 00/00/00/01/1
10 00/00/00/0A 00/00/00/0A/10
255 00/00/00/FF 00/00/00/FF/255
65535 00/00/FF/FF 00/00/FF/FF/65535
.... .... ....
4294967285 FF/FF/FF/FF FF/FF/FF/FF/4294967285

This is the way you guys can map all of your objects on disk without
worry of break the limitation of the file system.
This will make postgresql one more reason better than mysql. I wish
someone would help me.

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-09-13 18:32:08 pgsql: Don't error out if recycling or removing an old WAL segment fails
Previous Message Andrew Dunstan 2009-09-13 14:07:15 Re: [COMMITTERS] pgsql: Add Unicode support in PL/Python