dbTalk Databases Forums  

BDB-JE: Byte array key comparisons.

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss BDB-JE: Byte array key comparisons. in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
heng.mei@gmail.com
 
Posts: n/a

Default BDB-JE: Byte array key comparisons. - 01-22-2006 , 10:12 PM






Hi,

I'm using BDB-JE 2.083. I have a DB that uses a byte-array as the
key... I'm trying to merge the results from two queries -- i'm
basically just iterating through the two result sets (which are ordered
by byte-array key) and merging. However, this only works if my
comparison function for byte-arrays behaves exactly like the one used
by BDB internally.

Can you point me to the location in the source code where the byte
comparisons are implemented for Btree keys? The docs mentioned that
the database keys are "lexographically" ordered -- does that mean
unsigned byte comparisons?

Thanks,
~Heng


Reply With Quote
  #2  
Old   
heng.mei@gmail.com
 
Posts: n/a

Default Re: BDB-JE: Byte array key comparisons. - 01-22-2006 , 10:40 PM






Doing unsigned byte comparisons seems to work for me now..... basically
I do (bytes[i] & 0xFF) before I compare each byte.

I'd still like to see how BDB-JE internally compares byte arrays when
comparing keys (so please point me to the source) ---- perhaps there's
some more efficient code i can re-use...

Thanks,
~Heng


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.