Fix cache size calculation

This commit is contained in:
alesapin 2020-11-27 16:17:10 +03:00
parent 875a0a04eb
commit ba481e6665

View File

@ -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;
}
};