added indexes in selectexecutor

This commit is contained in:
Nikita Vasilev 2018-12-29 16:02:57 +03:00
parent 5079330bdc
commit f90cdca498
2 changed files with 784 additions and 772 deletions

View File

@ -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);

View File

@ -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;
};