Skip to content
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

Fix list index implementation #171

Merged
merged 7 commits into from
Sep 1, 2020
Merged

Fix list index implementation #171

merged 7 commits into from
Sep 1, 2020

Conversation

asdine
Copy link
Collaborator

@asdine asdine commented Aug 29, 2020

This PR fixes #170 by changing how list indexes are implemented. Previously, each couple value to index / key was stored in a store as following:

store key store value
value to index+separator+key of the associated document nil

This used to be valued as some point but this now has some obvious issues as the separator can be contained in both the value to index and the key of the document, making it impossible to determine where the separator is.

The new implementation uses a new method added to the engines called NextSequence(), which is responsible of returning a monotonically increasing integer.
This integer will be encoded and appended to every value to index, while the document key will be stored in the value of the store:

store key store value
value to index+integer key of the associated document

@asdine asdine merged commit 31c774f into master Sep 1, 2020
@asdine asdine deleted the fix/list-index branch September 1, 2020 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query on indexed field only returns 29 records
1 participant