From 9004601817d1684ff3e64796c2bd3b357f75385c Mon Sep 17 00:00:00 2001 From: yah01 Date: Thu, 31 Aug 2023 17:31:11 +0800 Subject: [PATCH] Enable vector index mmap (#26750) Signed-off-by: yah01 --- internal/core/src/index/Index.h | 1 + internal/core/src/index/VectorMemIndex.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/core/src/index/Index.h b/internal/core/src/index/Index.h index a4fadb70d1..0d1cc55ef7 100644 --- a/internal/core/src/index/Index.h +++ b/internal/core/src/index/Index.h @@ -24,6 +24,7 @@ #include "common/Types.h" const std::string kMmapFilepath = "mmap_filepath"; +const std::string kEnableMmap = "enable_mmap"; namespace milvus::index { diff --git a/internal/core/src/index/VectorMemIndex.cpp b/internal/core/src/index/VectorMemIndex.cpp index 93d2bb9a1e..786295c8b1 100644 --- a/internal/core/src/index/VectorMemIndex.cpp +++ b/internal/core/src/index/VectorMemIndex.cpp @@ -482,6 +482,7 @@ VectorMemIndex::LoadFromFile(const Config& config) { LOG_SEGCORE_INFO_ << "load index into Knowhere..."; auto conf = config; conf.erase(kMmapFilepath); + conf[kEnableMmap] = true; auto stat = index_.DeserializeFromFile(filepath.value(), conf); if (stat != knowhere::Status::success) { PanicCodeInfo(ErrorCodeEnum::UnexpectedError,