From a071bde59e2aa1290f5aeddb44cfcedc44c79dd6 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Thu, 7 Apr 2022 19:56:31 +0800 Subject: [PATCH] Use storage_snapshot for projection analysis --- src/Storages/MergeTree/MergeTreeData.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Storages/MergeTree/MergeTreeData.cpp b/src/Storages/MergeTree/MergeTreeData.cpp index eacec8f50e5..80ad6a4fd67 100644 --- a/src/Storages/MergeTree/MergeTreeData.cpp +++ b/src/Storages/MergeTree/MergeTreeData.cpp @@ -5176,7 +5176,9 @@ std::optional MergeTreeData::getQueryProcessingStageWithAgg if (const StorageReplicatedMergeTree * replicated = dynamic_cast(this)) max_added_blocks = std::make_shared(replicated->getMaxAddedBlocks()); } - auto parts = getDataPartsVector(); + + const auto & snapshot_data = assert_cast(*storage_snapshot->data); + const auto & parts = snapshot_data.parts; // If minmax_count_projection is a valid candidate, check its completeness. if (minmax_count_projection_candidate)