From eb0270aee5a761955de7ee6781b73ae14d18be3c Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 22 Nov 2019 12:05:40 +0800 Subject: [PATCH] #470 raw files should not be build index --- core/src/db/meta/MetaConsts.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/db/meta/MetaConsts.h b/core/src/db/meta/MetaConsts.h index c21a749f..0c77dc25 100644 --- a/core/src/db/meta/MetaConsts.h +++ b/core/src/db/meta/MetaConsts.h @@ -32,7 +32,12 @@ const size_t H_SEC = 60 * M_SEC; const size_t D_SEC = 24 * H_SEC; const size_t W_SEC = 7 * D_SEC; -const size_t BUILD_INDEX_THRESHOLD = 1000; +// This value is to ignore small raw files when building index. +// The reason is: +// 1. The performance of brute-search for small raw files could be better than small index file. +// 2. And small raw files can be merged to larger files, thus reduce fragmented files count. +// We decide the value based on a testing for small size raw/index files. +const size_t BUILD_INDEX_THRESHOLD = 5000; } // namespace meta } // namespace engine -- GitLab