move down data range construction in filterMarksUsingIndex and filterMarksUsingMergedIndex

This commit is contained in:
xinhuitian 2022-04-19 13:26:33 +08:00
parent 8a2e006cc4
commit 5d0957e669

View File

@ -1576,16 +1576,16 @@ MarkRanges MergeTreeDataSelectExecutor::filterMarksUsingIndex(
if (index_mark != index_range.begin || !granule || last_index_mark != index_range.begin)
granule = reader.read();
MarkRange data_range(
std::max(ranges[i].begin, index_mark * index_granularity),
std::min(ranges[i].end, (index_mark + 1) * index_granularity));
if (!condition->mayBeTrueOnGranule(granule))
{
++granules_dropped;
continue;
}
MarkRange data_range(
std::max(ranges[i].begin, index_mark * index_granularity),
std::min(ranges[i].end, (index_mark + 1) * index_granularity));
if (res.empty() || res.back().end - data_range.begin > min_marks_for_seek)
res.push_back(data_range);
else
@ -1676,16 +1676,16 @@ MarkRanges MergeTreeDataSelectExecutor::filterMarksUsingMergedIndex(
}
}
MarkRange data_range(
std::max(range.begin, index_mark * index_granularity),
std::min(range.end, (index_mark + 1) * index_granularity));
if (!condition->mayBeTrueOnGranule(granules))
{
++granules_dropped;
continue;
}
MarkRange data_range(
std::max(range.begin, index_mark * index_granularity),
std::min(range.end, (index_mark + 1) * index_granularity));
if (res.empty() || res.back().end - data_range.begin > min_marks_for_seek)
res.push_back(data_range);
else