perf issue was due to duplicate fieldIDs getting
inserted to the list of dv enabled fields list - DocValueFields in mem segment. Moved back to the original type `DocValueFields map[uint16]bool` for easy look up to check whether the fieldID is configured for dv storage.
This commit is contained in:
parent
f42ecb0ac7
commit
71a726bbf6
|
@ -121,7 +121,7 @@ func (s *Segment) processDocument(result *index.AnalysisResult) {
|
|||
}
|
||||
// TODO with mapping changes for dv
|
||||
//if field.Options().IncludeDocValues() {
|
||||
s.DocValueFields = append(s.DocValueFields, fieldID)
|
||||
s.DocValueFields[fieldID] = true
|
||||
//}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,9 +89,8 @@ type Segment struct {
|
|||
StoredPos []map[uint16][][]uint64
|
||||
|
||||
// for storing the docValue persisted fields
|
||||
// field id
|
||||
DocValueFields []uint16
|
||||
|
||||
DocValueFields map[uint16]bool
|
||||
|
||||
// footprint of the segment, updated when analyzed document mutations
|
||||
// are added into the segment
|
||||
sizeInBytes uint64
|
||||
|
@ -100,7 +99,8 @@ type Segment struct {
|
|||
// New builds a new empty Segment
|
||||
func New() *Segment {
|
||||
return &Segment{
|
||||
FieldsMap: map[string]uint16{},
|
||||
FieldsMap: map[string]uint16{},
|
||||
DocValueFields: map[uint16]bool{},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -440,7 +440,7 @@ func persistDocValues(memSegment *mem.Segment, w *CountHashWriter,
|
|||
fieldChunkOffsets := make(map[uint16]uint64, len(memSegment.FieldsInv))
|
||||
fdvEncoder := newChunkedContentCoder(uint64(chunkFactor), uint64(len(memSegment.Stored)-1))
|
||||
|
||||
for _, fieldID := range memSegment.DocValueFields {
|
||||
for fieldID := range memSegment.DocValueFields {
|
||||
field := memSegment.FieldsInv[fieldID]
|
||||
docTermMap := make(map[uint64][]byte, 0)
|
||||
dict, err := memSegment.Dictionary(field)
|
||||
|
|
Loading…
Reference in New Issue