mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 07:11:02 +00:00
don't try to use the rowCache for CountRange
Several issues: 1. tx.frag could be non-nil but not the fragment requested. 2. start and end need not be exact row boundaries. 3. therefore this could be returning the count of the row containing "start", for a fragment other than the one requested. 4. also in fact the rowcache wasn't populated before this so in one memory profile, this function alone was responsible for nearly 100GB of cached values...
This commit is contained in:
parent
dec0a00155
commit
17c24c236a
1 changed files with 1 additions and 13 deletions
14
rbf.go
14
rbf.go
|
|
@ -360,19 +360,7 @@ func (tx *RBFTx) UnionInPlace(index, field, view string, shard uint64, others ..
|
|||
// CountRange returns the count of hot bits in the start, end range on the fragment.
|
||||
// roaring.countRange counts the number of bits set between [start, end).
|
||||
func (tx *RBFTx) CountRange(index, field, view string, shard uint64, start, end uint64) (n uint64, err error) {
|
||||
|
||||
if tx.frag == nil {
|
||||
return tx.tx.CountRange(rbfName(index, field, view, shard), start, end)
|
||||
}
|
||||
|
||||
// For speed, exploit the fact that on startup the rowCache will
|
||||
// have already loaded fragments.
|
||||
rowID := start / ShardWidth
|
||||
row, err := tx.frag.unprotectedRow(tx, rowID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return row.Count(), nil
|
||||
return tx.tx.CountRange(rbfName(index, field, view, shard), start, end)
|
||||
}
|
||||
|
||||
func (tx *RBFTx) OffsetRange(index, field, view string, shard uint64, offset, start, end uint64) (*roaring.Bitmap, error) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue