-
Notifications
You must be signed in to change notification settings - Fork 64
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 – sorted limited offset mount queries #124
Conversation
I'm working on more tests now. |
bff153a
to
9550a82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorry for leaving you with the annoying part)
mount/mount.go
Outdated
if !f.Filter(head.next.Entry) { | ||
continue | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, we could probably switch to the naive filter as well. I'm not sure why I did it this way (well, it'll be slightly faster but not by much).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stebalien Actually we're finding that we might have to use the NaiveFilter implementation because if the underlying datastores support filter they're going to be filtering only on the subkey (if they filter on key) meaning they'll exclude their mount prefix. So we probably have to treat filters in the same way we do offsets by stashing them and then removing them from the Query that is passed to each datastore, and then applying them at then end when the keys are full keys. So we're going to do as you suggest here and use NaiveFilter. It reads a little clearer too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commit that fixes filtering by using NaiveFilter
: 5b4de5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. We definitely need to remove the filters from the query we're forwarding. Actually, we should probably just create a new query.
f4f30df
to
55e8dfe
Compare
55e8dfe
to
1633052
Compare
340ca11
to
e192b45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Based on: #123
Supersedes: #121
Use NaiveLimit and NaiveOffset to add limit/offset features to queries on mount.