4 ms·
It's late and I must be missing something (or maybe a lot). ordered by key? ordered by value? ordered by insertion/update time? Ordered for enumeration? or ord
by jfoutz 6y ago
It's late and I must be missing something (or maybe a lot).
ordered by key? ordered by value? ordered by insertion/update time?
Ordered for enumeration? or ordered where I can provide my own search? binary search is great, but I can think cases with better performance lookups with a bias in one direction.
I guess there are two main things.
1. what does ordered mean? I can think of lots of cases where having access to order would be super helpful. How do I tag the thing(s) I care about for lookup>
2. I'm not a super fan of go, but randomizing enumeration of maps was a really good move for avoiding inadvertent dependence on order.
I checked again, and I still don't see what order "means" (safari on OS X. maybe it's not rendering right?)
_edit_
after digging a little deeper, I guess I want to add 3
How are ties broken? Fastest result? Highest memory address?
Ordered KV would be super handy. But the devil is in the details, and I can't find any details.
- rapsey 6y agoOrdered by key. If you want to know more read the FoundationDB docs.
- beagle3 6y agoThanks. Should be noted that when talking about e.g. Python dictionaries (and some other in-memory associative arrays), "ordered" refers to insertion order, where as "sorted" refers to key order.
- erk__ 6y agoI guess ordered KV stores usually requires total order on they, and that if two keys are identical they refer to the same data. Randomizing the hash value is great for unordered maps, but for ordered maps you sometimes want to extract a range which can be done faster if you have them ordered for example in a b-tree.