Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Berkely DB > Ridiculous data...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 1757 of 1804
Post > Topic >>

Ridiculous database size

by Smalltalk80 <timtanbin@[EMAIL PROTECTED] > Jun 21, 2007 at 06:13 PM

I'm building a hash-based databased where key and data are both 8-byte
integers. There is roughly 50M entries, so the actual data size is
about 800M, but the produced db file is 2.1G. Why does it use so much
space for a hash table which is supposed to be a compact data
structure?

Here's my configuration:

        db.set_cachesize(10, 0 * 1024 * 1024, 1); //If I set it to 2G,
then it becomes terribly slow after 20M entries. I don't understand
why.
        u_int32_t pageSize = 4 * 1024; // block size on my machine
        db.set_pagesize(pageSize);
        db.set_h_ffactor((pageSize - 32) / (keySize + 8 + 8)); //
according to recommendation
        db.set_h_nelem(50000000);
        db.open(NULL, "test.db", NULL, DB_HASH, DB_CREATE |
DB_TRUNCATE, 0);

Thanks!
 




 3 Posts in Topic:
Ridiculous database size
Smalltalk80 <timtanbin  2007-06-21 18:13:25 
Re: Ridiculous database size
Smalltalk80 <timtanbin  2007-06-22 04:53:05 
Re: Ridiculous database size
zengli8916@[EMAIL PROTECT  2007-06-29 21:12:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 20 0:38:50 CDT 2008.