mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 13:32:13 +00:00
added indexes in selectexecutor
This commit is contained in:
parent
5079330bdc
commit
f90cdca498
@ -528,6 +528,16 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts(
|
||||
else
|
||||
ranges.ranges = MarkRanges{MarkRange{0, part->marks_count}};
|
||||
|
||||
for (const auto index_part : part->index_parts) {
|
||||
const auto condition = index_part->createIndexConditionOnPart(
|
||||
query_info, context, index_part->index->sample.getNames(), index_part->index->expr);
|
||||
if (condition->alwaysUnknownOrTrue()) {
|
||||
continue;
|
||||
} else {
|
||||
ranges.ranges = condition->filterRanges(ranges.ranges);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ranges.ranges.empty())
|
||||
{
|
||||
parts_with_ranges.push_back(ranges);
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
protected:
|
||||
IndexCondition() = default;
|
||||
|
||||
public:
|
||||
MergeTreeIndexPartPtr part;
|
||||
};
|
||||
|
||||
@ -80,6 +81,7 @@ protected:
|
||||
virtual void updateImpl(const Block & block, const Names & column_names) = 0;
|
||||
virtual void mergeImpl(const MergeTreeIndexPart & other) = 0;
|
||||
|
||||
public:
|
||||
MergeTreeIndexPtr index;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user