mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
dbms: Server: queries with several replicas: development [#METR-14410]
This commit is contained in:
parent
1b48a66c6d
commit
2201c073a8
@ -254,13 +254,15 @@ BlockInputStreams MergeTreeDataSelectExecutor::read(
|
||||
|
||||
RangesInDataParts * final_parts_with_ranges = nullptr;
|
||||
|
||||
if (settings.parallel_replicas_count > 0)
|
||||
if (settings.parallel_replicas_count > 1)
|
||||
{
|
||||
PartsWithRangesSplitter splitter(parts_with_ranges, sum_marks, data.settings.min_rows_for_seek,
|
||||
settings.parallel_replicas_count);
|
||||
auto per_replica_parts_with_ranges = splitter.perform();
|
||||
|
||||
if ((per_replica_parts_with_ranges.size() > 1) && (settings.parallel_replica_offset < per_replica_parts_with_ranges.size()))
|
||||
if (settings.parallel_replica_offset < per_replica_parts_with_ranges.size())
|
||||
{
|
||||
if (per_replica_parts_with_ranges.size() > 1)
|
||||
{
|
||||
/// Для каждого элемента массива per_replica_parts_with_ranges, вычисляем его хэш
|
||||
/// Сортируем массив per_replica_parts_with_ranges по хэшу.
|
||||
@ -292,9 +294,16 @@ BlockInputStreams MergeTreeDataSelectExecutor::read(
|
||||
sum_marks += range.end - range.begin;
|
||||
}
|
||||
}
|
||||
else
|
||||
final_parts_with_ranges = &parts_with_ranges;
|
||||
}
|
||||
|
||||
if (final_parts_with_ranges == nullptr)
|
||||
else
|
||||
{
|
||||
BlockInputStreams res;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else
|
||||
final_parts_with_ranges = &parts_with_ranges;
|
||||
|
||||
LOG_DEBUG(log, "Selected " << parts.size() << " parts by date, " << final_parts_with_ranges->size() << " parts by key, "
|
||||
|
Loading…
Reference in New Issue
Block a user