This commit is contained in:
Anton Popov 2024-11-12 17:24:30 +00:00
parent 3bba64e975
commit b758838c73
4 changed files with 9 additions and 3 deletions

View File

@ -68,7 +68,6 @@ public:
virtual uint64_t getBytesAllocated() const = 0;
virtual std::shared_ptr<MergeTreeIndexGranularity> optimize() const = 0;
virtual std::string describe() const = 0;
};

View File

@ -134,7 +134,7 @@ size_t MergeTreeIndexGranularityConstant::countRowsForRows(size_t from_mark, siz
std::string MergeTreeIndexGranularityConstant::describe() const
{
return fmt::format(
"Constant(constant_granularity: {}, last_mark_granularity: {}, num_marks_without_final: {}, has_final_mark: {}",
"Constant(constant_granularity: {}, last_mark_granularity: {}, num_marks_without_final: {}, has_final_mark: {})",
constant_granularity, last_mark_granularity, num_marks_without_final, has_final_mark);
}

View File

@ -8,8 +8,14 @@ CREATE TABLE t (
ENGINE MergeTree()
ORDER by key SETTINGS index_granularity = 10, index_granularity_bytes = '1024K';
ALTER TABLE t MODIFY SETTING enable_index_granularity_compression = 0;
INSERT INTO t SELECT number, toString(number) FROM numbers(100);
SELECT index_granularity_bytes_in_memory, index_granularity_bytes_in_memory_allocated FROM system.parts where table = 't' and database = currentDatabase();
ALTER TABLE t MODIFY SETTING enable_index_granularity_compression = 1;
INSERT INTO t SELECT number, toString(number) FROM numbers(100);
SELECT index_granularity_bytes_in_memory, index_granularity_bytes_in_memory_allocated FROM system.parts where table = 't' and database = currentDatabase() ORDER BY name;
DROP TABLE IF EXISTS t;