0
0
Fork 0

scorch zap optimize merge when deletion bitmap is empty

This change detects whether a deletion bitmap is empty, and treats
that as a nil bitmap, which allows further postings iterator codepaths
to avoid roaring bitmap operations (like, AndNot(docNums, drops)).
This commit is contained in:
Steve Yen 2018-03-16 09:51:23 -07:00
parent 5411d9ae4f
commit e52eb84e37
1 changed files with 5 additions and 1 deletions

View File

@ -207,7 +207,11 @@ func persistMergedRest(segments []*SegmentBase, dropsIn []*roaring.Bitmap,
}
if itr != nil {
newDocNums = append(newDocNums, newDocNumsIn[segmentI])
drops = append(drops, dropsIn[segmentI])
if dropsIn[segmentI] != nil && !dropsIn[segmentI].IsEmpty() {
drops = append(drops, dropsIn[segmentI])
} else {
drops = append(drops, nil)
}
dicts = append(dicts, dict)
itrs = append(itrs, itr)
}