Conversation
|
There should probably be a naive implementation in query_impl.go |
|
Something like: type FilterKeySeekPrefix struct {
SeekPrefix string
}
func (f FilterKeySeekPrefix) Filter(e Entry) bool {
return e.Key >= f.SeekPrefix
}and func NaiveQueryApply(q Query, qr Results) Results {
if q.Prefix != "" {
qr = NaiveFilter(qr, FilterKeyPrefix{q.Prefix})
}
if q.SeekPrefix != "" {
qr = NaiveFilter(qr, FilterKeySeekPrefix{q.SeekPrefix})
}
...? |
|
That will just act like |
Let's say we have entries whose keys are zero-padded time codes for speedy scanning by time: .SeekPrefix could be something like type FilterKeySeekPrefix struct {
Ascending bool
SeekPrefix string
}
func (f FilterKeySeekPrefix) Filter(e Entry) bool {
if f.Ascending {
return e.Key >= f.SeekPrefix
} else {
return e.Key <= f.SeekPrefix
}
}Is the only place |
|
You're right, assuming ordering by key, that should work. Actually, I'm starting to wonder how this should interact with sorting by value. Let's discuss here: #116 (comment)
We use it in the |
|
Ok cool, thanks for indulging me on that ques and glad you're catching this stuff. Like that we're gettin through this together and adding a nice feature to ds. |
|
This looks pretty stale... does that mean another avenue was chosen? Or key seeking is still not possible? |
No description provided.