mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
enhance: Skip loading pk index for sorted segment in loader (#39437)
Related to #39339 Previous PR #39389 only skips append index into segment Also related to #39428 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
513b489c85
commit
fb5761af8d
@ -1021,6 +1021,19 @@ func (s *LocalSegment) LoadIndex(ctx context.Context, indexInfo *querypb.FieldIn
|
||||
return err
|
||||
}
|
||||
|
||||
// // if segment is pk sorted, user created indexes bring no performance gain but extra memory usage
|
||||
if s.IsSorted() && fieldSchema.GetIsPrimaryKey() {
|
||||
log.Info("skip loading index for pk field in sorted segment")
|
||||
// set field index, preventing repeated loading index task
|
||||
s.fieldIndexes.Insert(indexInfo.GetFieldID(), &IndexedFieldInfo{
|
||||
FieldBinlog: &datapb.FieldBinlog{
|
||||
FieldID: indexInfo.GetFieldID(),
|
||||
},
|
||||
IndexInfo: indexInfo,
|
||||
IsLoaded: true,
|
||||
})
|
||||
}
|
||||
|
||||
return s.innerLoadIndex(ctx, fieldSchema, indexInfo, tr, fieldType)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user