Merge pull request #36034 from amosbird/better-projection2

Use storage_snapshot for projection analysis
This commit is contained in:
Anton Popov 2022-04-08 13:22:53 +02:00 committed by GitHub
commit a16ac67c0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5184,7 +5184,9 @@ std::optional<ProjectionCandidate> MergeTreeData::getQueryProcessingStageWithAgg
if (const StorageReplicatedMergeTree * replicated = dynamic_cast<const StorageReplicatedMergeTree *>(this)) if (const StorageReplicatedMergeTree * replicated = dynamic_cast<const StorageReplicatedMergeTree *>(this))
max_added_blocks = std::make_shared<PartitionIdToMaxBlock>(replicated->getMaxAddedBlocks()); max_added_blocks = std::make_shared<PartitionIdToMaxBlock>(replicated->getMaxAddedBlocks());
} }
auto parts = getDataPartsVector();
const auto & snapshot_data = assert_cast<const MergeTreeData::SnapshotData &>(*storage_snapshot->data);
const auto & parts = snapshot_data.parts;
// If minmax_count_projection is a valid candidate, check its completeness. // If minmax_count_projection is a valid candidate, check its completeness.
if (minmax_count_projection_candidate) if (minmax_count_projection_candidate)