niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
time to insert 100,000 key,data pairs into DB_BTREE is 2s!!!
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
berkeleydb_user
*nix forums beginner


Joined: 16 Mar 2005
Posts: 17

PostPosted: Thu Mar 17, 2005 5:45 pm    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

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

PostPosted: Thu Mar 17, 2005 6:42 am    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

"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

PostPosted: Thu Mar 17, 2005 6:28 am    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

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

PostPosted: Thu Mar 17, 2005 6:10 am    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

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

PostPosted: Thu Mar 17, 2005 4:50 am    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

"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

PostPosted: Thu Mar 17, 2005 4:37 am    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with 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.
Back to top
Michael Cahill
*nix forums Guru Wannabe


Joined: 26 May 2005
Posts: 219

PostPosted: Thu Mar 17, 2005 12:42 am    Post subject: Re: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

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

PostPosted: Thu Mar 17, 2005 12:19 am    Post subject: time to insert 100,000 key,data pairs into DB_BTREE is 2s!!! Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 5:04 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Insert header and footer in every page served by proxy ehmedk Apache 0 Tue Apr 22, 2008 6:27 pm
No new posts Insert header and footer in every page served by squid ehmedk Squid 0 Tue Apr 22, 2008 6:16 pm
No new posts container for insert/delete + fast index Neal Becker C++ 1 Fri Jul 21, 2006 12:57 pm
No new posts Running php file everyday on scheduled time sachin PHP 1 Fri Jul 21, 2006 12:49 pm
No new posts Bug#379103: ITP: complearn-gui -- 3D drag-and-drop interf... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:00 am

Song Lyrics | Credit Card Debt Consolidation | Western Union Locations | Debt Help | Online Name
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1671s ][ Queries: 20 (0.0901s) ][ GZIP on - Debug on ]