posting iterator array positions clean up,
max segment size limit adjustment for hit-1 optimisation
This commit is contained in:
parent
985082d5d2
commit
1775602958
|
@ -117,14 +117,14 @@ func (o *MergePlanOptions) RaiseToFloorSegmentSize(s int64) int64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxSegmentSizeLimit represents the maximum size of a segment,
|
// MaxSegmentSizeLimit represents the maximum size of a segment,
|
||||||
// this limit comes as the roaring lib supports uint32.
|
// this limit comes with hit-1 optimisation/max encoding limit uint31.
|
||||||
const MaxSegmentSizeLimit = 1<<32 - 1
|
const MaxSegmentSizeLimit = 1<<31 - 1
|
||||||
|
|
||||||
// ErrMaxSegmentSizeTooLarge is returned when the size of the segment
|
// ErrMaxSegmentSizeTooLarge is returned when the size of the segment
|
||||||
// exceeds the MaxSegmentSizeLimit
|
// exceeds the MaxSegmentSizeLimit
|
||||||
var ErrMaxSegmentSizeTooLarge = errors.New("MaxSegmentSize exceeds the size limit")
|
var ErrMaxSegmentSizeTooLarge = errors.New("MaxSegmentSize exceeds the size limit")
|
||||||
|
|
||||||
// Suggested default options.
|
// DefaultMergePlanOptions suggests the default options.
|
||||||
var DefaultMergePlanOptions = MergePlanOptions{
|
var DefaultMergePlanOptions = MergePlanOptions{
|
||||||
MaxSegmentsPerTier: 10,
|
MaxSegmentsPerTier: 10,
|
||||||
MaxSegmentSize: 5000000,
|
MaxSegmentSize: 5000000,
|
||||||
|
|
|
@ -444,6 +444,8 @@ func (i *PostingsIterator) readLocation(l *Location) error {
|
||||||
l.end = end
|
l.end = end
|
||||||
if numArrayPos > 0 {
|
if numArrayPos > 0 {
|
||||||
l.ap = make([]uint64, int(numArrayPos))
|
l.ap = make([]uint64, int(numArrayPos))
|
||||||
|
} else {
|
||||||
|
l.ap = l.ap[:0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue