From 6f68979662cad8d6005d500e8cbcd865aa5c0ec3 Mon Sep 17 00:00:00 2001 From: Vladimir Chebotarev Date: Mon, 11 May 2020 10:31:26 +0300 Subject: [PATCH] Switched `system.parts.move_ttl_info` to separate arrays. --- src/Storages/System/StorageSystemParts.cpp | 31 +++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/Storages/System/StorageSystemParts.cpp b/src/Storages/System/StorageSystemParts.cpp index 39246498849..8c1fdd667c4 100644 --- a/src/Storages/System/StorageSystemParts.cpp +++ b/src/Storages/System/StorageSystemParts.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -55,15 +54,9 @@ StorageSystemParts::StorageSystemParts(const std::string & name_) {"hash_of_uncompressed_files", std::make_shared()}, {"uncompressed_hash_of_compressed_files", std::make_shared()}, - {"move_ttl_info", std::make_shared( - std::make_shared( - DataTypes({ - std::make_shared(), - std::make_shared(), - std::make_shared() - }), - Strings({"expression", "min", "max"}) - ))}, + {"move_ttl_info.expression", std::make_shared(std::make_shared())}, + {"move_ttl_info.min", std::make_shared(std::make_shared())}, + {"move_ttl_info.max", std::make_shared(std::make_shared())}, } ) { @@ -143,17 +136,19 @@ void StorageSystemParts::processNextStorage(MutableColumns & columns_, const Sto /// move_ttl_info { - Array move_ttl_info_array; - move_ttl_info_array.reserve(part->ttl_infos.moves_ttl.size()); + Array expression_array, min_array, max_array; + expression_array.reserve(part->ttl_infos.moves_ttl.size()); + min_array.reserve(part->ttl_infos.moves_ttl.size()); + max_array.reserve(part->ttl_infos.moves_ttl.size()); for (const auto & [expression, move_ttl_info] : part->ttl_infos.moves_ttl) { - Tuple move_ttl_info_tuple; - move_ttl_info_tuple.push_back(expression); - move_ttl_info_tuple.push_back(static_cast(move_ttl_info.min)); - move_ttl_info_tuple.push_back(static_cast(move_ttl_info.max)); - move_ttl_info_array.emplace_back(std::move(move_ttl_info_tuple)); + expression_array.emplace_back(expression); + min_array.push_back(static_cast(move_ttl_info.min)); + max_array.push_back(static_cast(move_ttl_info.max)); } - columns_[i++]->insert(move_ttl_info_array); + columns_[i++]->insert(expression_array); + columns_[i++]->insert(min_array); + columns_[i++]->insert(max_array); } } }