0
0
Fork 0

posting iterator array positions clean up,

max segment size limit adjustment for hit-1
optimisation
This commit is contained in:
Sreekanth Sivasankaran 2018-03-15 14:40:00 +05:30
parent 985082d5d2
commit 1775602958
2 changed files with 5 additions and 3 deletions

View File

@ -117,14 +117,14 @@ func (o *MergePlanOptions) RaiseToFloorSegmentSize(s int64) int64 {
}
// MaxSegmentSizeLimit represents the maximum size of a segment,
// this limit comes as the roaring lib supports uint32.
const MaxSegmentSizeLimit = 1<<32 - 1
// this limit comes with hit-1 optimisation/max encoding limit uint31.
const MaxSegmentSizeLimit = 1<<31 - 1
// ErrMaxSegmentSizeTooLarge is returned when the size of the segment
// exceeds the MaxSegmentSizeLimit
var ErrMaxSegmentSizeTooLarge = errors.New("MaxSegmentSize exceeds the size limit")
// Suggested default options.
// DefaultMergePlanOptions suggests the default options.
var DefaultMergePlanOptions = MergePlanOptions{
MaxSegmentsPerTier: 10,
MaxSegmentSize: 5000000,

View File

@ -444,6 +444,8 @@ func (i *PostingsIterator) readLocation(l *Location) error {
l.end = end
if numArrayPos > 0 {
l.ap = make([]uint64, int(numArrayPos))
} else {
l.ap = l.ap[:0]
}
}