Enable vector index mmap (#26750)

Signed-off-by: yah01 <yah2er0ne@outlook.com>
This commit is contained in:
yah01 2023-08-31 17:31:11 +08:00 committed by GitHub
parent d001133bd2
commit 9004601817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include "common/Types.h" #include "common/Types.h"
const std::string kMmapFilepath = "mmap_filepath"; const std::string kMmapFilepath = "mmap_filepath";
const std::string kEnableMmap = "enable_mmap";
namespace milvus::index { namespace milvus::index {

View File

@ -482,6 +482,7 @@ VectorMemIndex::LoadFromFile(const Config& config) {
LOG_SEGCORE_INFO_ << "load index into Knowhere..."; LOG_SEGCORE_INFO_ << "load index into Knowhere...";
auto conf = config; auto conf = config;
conf.erase(kMmapFilepath); conf.erase(kMmapFilepath);
conf[kEnableMmap] = true;
auto stat = index_.DeserializeFromFile(filepath.value(), conf); auto stat = index_.DeserializeFromFile(filepath.value(), conf);
if (stat != knowhere::Status::success) { if (stat != knowhere::Status::success) {
PanicCodeInfo(ErrorCodeEnum::UnexpectedError, PanicCodeInfo(ErrorCodeEnum::UnexpectedError,