diff --git a/src/Storages/MarkCache.h b/src/Storages/MarkCache.h index 6e36a941fff..5dfaa9ef0ea 100644 --- a/src/Storages/MarkCache.h +++ b/src/Storages/MarkCache.h @@ -21,10 +21,12 @@ namespace DB /// Estimate of number of bytes in cache for marks. struct MarksWeightFunction { + /// We spent additional bytes on key in hashmap, linked lists, shared pointers, etc ... + static constexpr size_t MARK_CACHE_OVERHEAD = 128; + size_t operator()(const MarksInCompressedFile & marks) const { - /// NOTE Could add extra 100 bytes for overhead of std::vector, cache structures and allocator. - return marks.size() * sizeof(MarkInCompressedFile); + return marks.size() * sizeof(MarkInCompressedFile) + MARK_CACHE_OVERHEAD; } };