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

Fast reverse query #28

Merged
merged 3 commits into from
Apr 9, 2019
Merged

Fast reverse query #28

merged 3 commits into from
Apr 9, 2019

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Apr 9, 2019

  1. Make the reverse sorted query fast instead of falling back on the naive order.
  2. Always use the iterator-backed query adapter. Requires cleanup and optimize naive query filters go-datastore#125 (tests won't pass without it).

@ghost ghost assigned Stebalien Apr 9, 2019
@ghost ghost added the status/in-progress In progress label Apr 9, 2019
Copy link

@michaelavila michaelavila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien makes sense. Basically, we are taking advantage of the fact that LevelDB will iterate in some order (we can define, but lexicographical by default) and that we can iterate over that data both forward and backward, and so we special case these two orderings. Is there any reason this PR is still marked as Draft? Just pending the go-datastore changes?

@Stebalien
Copy link
Member Author

@Stebalien makes sense. Basically, we are taking advantage of the fact that LevelDB will iterate in some order (we can define, but lexicographical by default) and that we can iterate over that data both forward and backward, and so we special case these two orderings.

Yep.

Is there any reason this PR is still marked as Draft? Just pending the go-datastore changes?

Yes. It panics otherwise as the current naive query adapters call Close concurrently with Next somewhere down the chain.

@michaelavila michaelavila marked this pull request as ready for review April 9, 2019 17:23
The tests no longer pass with gx.
@Stebalien Stebalien merged commit 47a9627 into master Apr 9, 2019
@ghost ghost removed the status/in-progress In progress label Apr 9, 2019
@Stebalien Stebalien deleted the feat/fast-reverse-query branch April 9, 2019 18:05
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.

2 participants