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 > BTree elements ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 1705 of 1800
Post > Topic >>

BTree elements not sorted?

by cruppstahl@[EMAIL PROTECTED] Jan 25, 2007 at 12:49 PM

Hi!

I use a BTree as an indexing structure for my berkeleydb database. The
keys are all 4 bytes long, unsigned integers. And i use cursors to
traverse the database in both directions.

I thought that since i use a Btree, the elements are sorted, and the
cursors traverse a sorted tree. I thought that if i position the cursor
at the first element, i get the smallest key, and the last element is
the largest key. But i noticed that this is not the case - the cursors
rather return the elements in the order of insertion (the oldest
element is in DB_FIRST, the youngest in DB_LAST).

Is there a way how i can get "real" sorting?

Why does bdb use this sorting "by age"? Is there a special reason why
they decided to do so?

Regards & big thanks
Chris




 8 Posts in Topic:
BTree elements not sorted?
cruppstahl@[EMAIL PROTECT  2007-01-25 12:49:14 
Re: BTree elements not sorted?
cruppstahl@[EMAIL PROTECT  2007-01-27 02:29:46 
Re: BTree elements not sorted?
Florian Weimer <fw@[EM  2007-01-27 13:04:01 
Re: BTree elements not sorted?
cruppstahl@[EMAIL PROTECT  2007-01-27 11:36:21 
Re: BTree elements not sorted?
cruppstahl@[EMAIL PROTECT  2007-01-29 01:27:42 
Re: BTree elements not sorted?
Florian Weimer <fw@[EM  2007-01-29 11:01:42 
Re: BTree elements not sorted?
cruppstahl@[EMAIL PROTECT  2007-01-29 02:34:06 
Re: BTree elements not sorted?
cruppstahl@[EMAIL PROTECT  2007-01-30 15:04:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan13V112 Fri Jul 4 23:00:00 CDT 2008.