From 71233e11a9d6daf10cbcc1aa1638b152b647d816 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Wed, 17 Jul 2019 09:24:37 +0800 Subject: [PATCH] minor updates. --- dbms/src/Columns/IColumn.h | 14 -------------- dbms/src/Storages/IStorage.h | 15 +++++++++++++++ dbms/src/Storages/MergeTree/MergeTreeDataPart.h | 1 + 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dbms/src/Columns/IColumn.h b/dbms/src/Columns/IColumn.h index 17c62fbd2d8..3955ed4b528 100644 --- a/dbms/src/Columns/IColumn.h +++ b/dbms/src/Columns/IColumn.h @@ -24,20 +24,6 @@ namespace ErrorCodes class Arena; class ColumnGathererStream; -struct ColumnSize -{ - size_t marks = 0; - size_t data_compressed = 0; - size_t data_uncompressed = 0; - - void add(const ColumnSize & other) - { - marks += other.marks; - data_compressed += other.data_compressed; - data_uncompressed += other.data_uncompressed; - } -}; - /// Declares interface to store columns in memory. class IColumn : public COW { diff --git a/dbms/src/Storages/IStorage.h b/dbms/src/Storages/IStorage.h index 7c45401e338..477c4456b17 100644 --- a/dbms/src/Storages/IStorage.h +++ b/dbms/src/Storages/IStorage.h @@ -38,6 +38,19 @@ class AlterCommands; class MutationCommands; class PartitionCommands; +struct ColumnSize +{ + size_t marks = 0; + size_t data_compressed = 0; + size_t data_uncompressed = 0; + + void add(const ColumnSize & other) + { + marks += other.marks; + data_compressed += other.data_compressed; + data_uncompressed += other.data_uncompressed; + } +}; /** Storage. Describes the table. Responsible for * - storage of the table data; @@ -82,6 +95,8 @@ public: /// Returns true if the storage supports deduplication of inserted data blocks. virtual bool supportsDeduplication() const { return false; } + /// Optional size information of each physical column. + /// Currently it's only used by the MergeTree family for query optimizations. using ColumnSizeByName = std::unordered_map; virtual ColumnSizeByName getColumnSizes() const { return {}; } diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataPart.h b/dbms/src/Storages/MergeTree/MergeTreeDataPart.h index 053e9428861..f41ea8af424 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataPart.h +++ b/dbms/src/Storages/MergeTree/MergeTreeDataPart.h @@ -22,6 +22,7 @@ namespace DB { +struct ColumnSize; class MergeTreeData;