dbTalk Databases Forums  

seconday index sort order

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


Discuss seconday index sort order in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
niagara_man@hotmail.com
 
Posts: n/a

Default seconday index sort order - 03-15-2006 , 04:15 PM






Hi,
If I create a secondary index where the first part of the index is this
(using the associate() function):

typedef unsigned long ATYPE_NUMBER;
ATYPE_NUMBER value;
memcpy(&value, key.data, sizeof(ATYPE_NUMBER));
// Key:
// ATYPE_NUMBER + ASCII characters

If I then close the primary database, and only open the secondary
database for reading only, will the secondaries keys be sorted from
from 0 to N (unsigned long)?

I have done this and the secondary index does not appear to be sorted
correctly by unsigned long, but the data seems to be correct. Any
suggestions?
Thanks


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: seconday index sort order - 03-15-2006 , 04:46 PM






Hi,

If you are doing this on a big endian machine (Sparc, PPC, and so on),
the items will be sorted as you expect. If you're on a little-endian
machine (x86 and friends), the items won't sort in the order you
expect. Please see this FAQ entry for more information:

http://dev.sleepycat.com/resources/faq_show.html?id=70

Regards,
Michael.


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.