mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
Merge pull request #846 from travisturner/reduce-executor-locks
micro optimization: reduce Lock calls in executor
This commit is contained in:
commit
046fb9b97e
1 changed files with 6 additions and 6 deletions
12
executor.go
12
executor.go
|
|
@ -92,8 +92,12 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic
|
|||
// Determine slices and inverseSlices for use in e.executeCall().
|
||||
if needsSlices {
|
||||
// Round up the number of slices.
|
||||
maxSlice := e.Holder.Index(index).MaxSlice()
|
||||
maxInverseSlice := e.Holder.Index(index).MaxInverseSlice()
|
||||
idx := e.Holder.Index(index)
|
||||
if idx == nil {
|
||||
return nil, ErrIndexNotFound
|
||||
}
|
||||
maxSlice := idx.MaxSlice()
|
||||
maxInverseSlice := idx.MaxInverseSlice()
|
||||
|
||||
// Generate a slices of all slices.
|
||||
slices = make([]uint64, maxSlice+1)
|
||||
|
|
@ -108,10 +112,6 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic
|
|||
}
|
||||
|
||||
// Fetch column label from index.
|
||||
idx := e.Holder.Index(index)
|
||||
if idx == nil {
|
||||
return nil, ErrIndexNotFound
|
||||
}
|
||||
columnLabel = idx.ColumnLabel()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue