-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 2I to Memory backend #314
Conversation
I'm a bit puzzled by the comment about |
@slfritchie "which do not let you specify a starting key" is the main point there, sorry. In contrast, LevelDB lets you seek to a starting key, then iterate. How would you do the same in ETS? |
With an ordered_set table, |
A few tidbits from the Efficiency Guide:
...
In this case, because a large portion of the key is bound in the match specs, it should be less likely to need a full-table scan. |
@slfritchie Aha, so it could be done with |
If this new feature is only being used for testing, and it's not buggy, then I'd leave it as-is. If the new feature is meant for general use (including by customers), then it's worth getting rid of as many |
@slfritchie Thanks. It might be difficult to remove |
…lic so they can be cleared externally.
@slfritchie Ok, I've switched as much as possible to use |
Sean, things look pretty sane. If the Dialyzer isn't angered more by these patches, then +1 -- ideally, the module would be warning-free. |
Ok, I will dialyze and fix. |
* CRITICAL: riak_kv_vnode should cons the async_folds option onto the backend configuration, not nest the latter in a new list. * The key_range_folder doesn't work properly for entire bucket lists, instead use the regular folder. * Simplify further the implementation of reset/0,2.
@slfritchie One final look if you will? Thank you so much for your help on this. |
+1 to merge, many thanks! |
As it says, this adds secondary indexes to the memory backend. Why?
reset()
function.)Caveats:
riak_object
.It is necessary to useets:match_delete/2
andets:select/1,3
operations to efficiently select items from the index, as ETS has no concept of cursors beyondets:first/1
andets:next/2
which do not let you specify a starting key.match
andselect
have been known to be locky in certain scenarios.ets:match_delete/2
must be used when deleting all postings for a bucket/key from the index table, due to the natural ordering of index keys. This penalty is only incurred when removing objects in LRU mode.