mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 16:15:56 +00:00
removed maxslice from setbit path
This commit is contained in:
parent
1e816b401c
commit
e3f4eab5ac
1 changed files with 26 additions and 6 deletions
32
executor.go
32
executor.go
|
|
@ -52,13 +52,15 @@ func (e *Executor) Execute(ctx context.Context, db string, q *pql.Query, slices
|
|||
|
||||
// If slices aren't specified, then include all of them.
|
||||
if len(slices) == 0 {
|
||||
// Round up the number of slices.
|
||||
maxSlice := e.Index.DB(db).MaxSlice()
|
||||
if needsSlices(q.Calls){
|
||||
// Round up the number of slices.
|
||||
maxSlice := e.Index.DB(db).MaxSlice()
|
||||
|
||||
// Generate a slices of all slices.
|
||||
slices = make([]uint64, maxSlice+1)
|
||||
for i := range slices {
|
||||
slices[i] = uint64(i)
|
||||
// Generate a slices of all slices.
|
||||
slices = make([]uint64, maxSlice+1)
|
||||
for i := range slices {
|
||||
slices[i] = uint64(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -876,3 +878,21 @@ func hasOnlySetBitmapAttrs(calls pql.Calls) bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func needsSlices(calls pql.Calls) bool {
|
||||
if len(calls) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, call := range calls {
|
||||
if _, ok := call.(pql.BitmapCall); !ok {
|
||||
return true
|
||||
}else if _, ok := call.(*pql.Count); !ok {
|
||||
return true
|
||||
}else if _, ok := call.(*pql.TopN); !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue