mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
slightly optimize very short queries with LowCardinality
This commit is contained in:
parent
93d49e5815
commit
eeb78bf291
@ -43,11 +43,13 @@ MergeTreeReaderStream::MergeTreeReaderStream(
|
||||
/// If the end of range is inside the block, we will need to read it too.
|
||||
if (right_mark < marks_count && marks_loader.getMark(right_mark).offset_in_decompressed_block > 0)
|
||||
{
|
||||
while (right_mark < marks_count
|
||||
&& marks_loader.getMark(right_mark).offset_in_compressed_file == marks_loader.getMark(mark_range.end).offset_in_compressed_file)
|
||||
auto indices = ext::range(right_mark, marks_count);
|
||||
auto it = std::upper_bound(indices.begin(), indices.end(), right_mark, [this](size_t i, size_t j)
|
||||
{
|
||||
++right_mark;
|
||||
}
|
||||
return marks_loader.getMark(i).offset_in_compressed_file < marks_loader.getMark(j).offset_in_compressed_file;
|
||||
});
|
||||
|
||||
right_mark = (it == indices.end() ? marks_count : *it);
|
||||
}
|
||||
|
||||
size_t mark_range_bytes;
|
||||
|
Loading…
Reference in New Issue
Block a user