![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way in JE to read records in insertion order? I'd like to use a cursor, but they seem to always sort records by keys. |
#3
| |||
| |||
|
|
theschooligan (AT) gmail (DOT) com wrote: Is there a way in JE to read records in insertion order? I'd like to use a cursor, but they seem to always sort records by keys. JE stores and retrieves records in an ordered Btree, so records are always retrieved in key order. The only way (currently) to return records in insertion order is to use a key that is incremented to match insertion order. That could be the primary key or a secondary key. Timestamps or a sequence could be used to assign key values. |
|
We are considering adding a way to retrieve records in arbitrary storage (log file) order. This would be for better performance when order of retrieval doesn't matter. It would *roughly* be insertion order, but would not be insertion order when records had been migrated by the cleaner or updated. Hope this helps, Mark |
#4
| |||
| |||
|
|
Thanks for your quick reply, Mark. |
|
What I see happening is that when an item is removed, it calls my SecondaryKeyCreator again. Maybe it expects that if the SecondaryKeyCreator is called with the same primary key and data again, it will generate the same secondary key. However in my application this isn't the case, since secondary keys are based on the current time and are not at all related to the primary key or data. Is there any way around this, or am I doing something incorrectly? |
![]() |
| Thread Tools | |
| Display Modes | |
| |