[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Regarding size of database (ldbm)

Hash: SHA1

On Thu, 24 May 2001, Vishwanath wrote:
> I had 6 thousand entries in my ldbm database, the size of the database
> directory was 6.6MB, Now i deleted 5900 entries and for surprise found
> that the size of directory was same. Even the search on, any of the
> deleted entry failed, What is the problem ?

I think the problem is that you expected the database to shrink when
records are deleted, but this is not the case with most databases and
other keyed storage methods.  The space occupied by those 5900 entries
marked as deleted is still allocated to the database, but is now available
for reuse.

What to do in such a situation depends on your long-term expectations.
If you expect the number of records to remain around 100 from now on, then
you could dump the database and reload it, creating a new smaller file.
If you expect the number of records to rise to around 6,000 once more,
it's probably best to do nothing -- adding records will not increase the
size of the file until all of that unused space has been filled.

(These comments are based on my limited understanding of Berkeley DB.
Some other indexed methods require offline reclamation of empty "buckets"
or the like.)

- -- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Make a good day.
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: pgpenvelope 2.8.6 - http://pgpenvelope.sourceforge.net/