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

added support for newly added Query.SeekPrefix #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drew-512
Copy link
Contributor

@drew-512 drew-512 commented Feb 6, 2019

No description provided.

it.Seek([]byte(q.SeekPrefix))
} else {
it.Seek(prefix)
}
Copy link
Member

Choose a reason for hiding this comment

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

This should probably seek to the "later" prefix (in case the seek prefix comes before the Prefix).

Copy link
Member

Choose a reason for hiding this comment

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

Actually, this all depends on the ordering. If we've reversed the order, we'd want to seek to the "earlier" prefix.

Speaking of ordering, we technically need to apply the "seek" prefix after the order. Badger internally handles ordering by key (ascending or descending) but we have to apply all other orderings (e.g., by value) after the fact.

So, if we aren't applying any additional orders len(order) == 0, we're all good. Otherwise, we should either return a not supported error or apply a naive seek after ordering.

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