diff --git a/internal/querycoordv2/task/utils.go b/internal/querycoordv2/task/utils.go index 709a662ef9..62307ad3a8 100644 --- a/internal/querycoordv2/task/utils.go +++ b/internal/querycoordv2/task/utils.go @@ -145,7 +145,6 @@ func packLoadSegmentRequest( loadScope = querypb.LoadScope_Delta } - // todo(SpadeA): consider struct fields schema = applyCollectionMmapSetting(schema, collectionProperties) return &querypb.LoadSegmentsRequest{ @@ -285,5 +284,16 @@ func applyCollectionMmapSetting(schema *schemapb.CollectionSchema, }) } } + for _, structField := range schema.GetStructArrayFields() { + for _, field := range structField.GetFields() { + if exist && + !common.FieldHasMmapKey(schema, field.GetFieldID()) { + field.TypeParams = append(field.TypeParams, &commonpb.KeyValuePair{ + Key: common.MmapEnabledKey, + Value: strconv.FormatBool(collectionMmapEnabled), + }) + } + } + } return schema }