| Author |
Message |
berkeleydb_user *nix forums beginner
Joined: 16 Mar 2005
Posts: 17
|
Posted: Thu Mar 17, 2005 5:45 pm Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
Probably once. It could go upto half million or more. I have a memory
only implementation of B+tree and I could do about 400000 under 2s. But
my program is still nascent. I understand that Berkeley DB is more
generic. Is there some tuning that I can do to make DB faster?
thanks |
|
| Back to top |
|
 |
Patrick Schaaf *nix forums beginner
Joined: 28 May 2005
Posts: 36
|
Posted: Thu Mar 17, 2005 6:42 am Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
"berkeleydb_user" <prasad.koya@gmail.com> writes:
| Quote: | I want the database to sort it. Thats why i want to use BTree. I want
fast searching, sorting, insertion, read keys in order. Thats why I
have to use BTree based database.
|
How often / regular do you expect to insert 100000 key/data pairs
into the btree? More often than about every 10 seconds?
best regards
Patrick |
|
| Back to top |
|
 |
berkeleydb_user *nix forums beginner
Joined: 16 Mar 2005
Posts: 17
|
Posted: Thu Mar 17, 2005 6:28 am Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
I tried this with sorted input and the response is about 600-700ms
faster. But I don't expect my input (keys) to be sorted. |
|
| Back to top |
|
 |
berkeleydb_user *nix forums beginner
Joined: 16 Mar 2005
Posts: 17
|
Posted: Thu Mar 17, 2005 6:10 am Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
Given that key type (data) is opaque, what would you rather recommend
for insertion sort? |
|
| Back to top |
|
 |
Patrick Schaaf *nix forums beginner
Joined: 28 May 2005
Posts: 36
|
Posted: Thu Mar 17, 2005 4:50 am Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
"berkeleydb_user" <prasad.koya@gmail.com> writes:
| Quote: | I have a simple memory-only DB, configured to use DB_BTREE during
open() time. I am inserting 100,000 unsorted dictionary words into this
|
Btree based insertion sort is not the best of sorting methods, you know.
Compare times to the case where the input keys are already sorted, and
things may become a lot faster.
best regards
Patrick |
|
| Back to top |
|
 |
berkeleydb_user *nix forums beginner
Joined: 16 Mar 2005
Posts: 17
|
Posted: Thu Mar 17, 2005 4:37 am Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
I want the database to sort it. Thats why i want to use BTree. I want
fast searching, sorting, insertion, read keys in order. Thats why I
have to use BTree based database. |
|
| Back to top |
|
 |
Michael Cahill *nix forums Guru Wannabe
Joined: 26 May 2005
Posts: 219
|
Posted: Thu Mar 17, 2005 12:42 am Post subject:
Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
Try loading all the words into memory and sorting with qsort before
doing the insert.
Regards,
Michael. |
|
| Back to top |
|
 |
berkeleydb_user *nix forums beginner
Joined: 16 Mar 2005
Posts: 17
|
Posted: Thu Mar 17, 2005 12:19 am Post subject:
time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
|
|
|
Hi
I have a simple memory-only DB, configured to use DB_BTREE during
open() time. I am inserting 100,000 unsorted dictionary words into this
with no transactions and cache size set to 10MB. It takes 2s on a 1GHz
x86 processor. The average key size is about 10 bytes. Can I make it
faster? I am expecting in the order of 200 or 300ms not this high.
thanks |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|