mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Fix the estimation of total rows for the numbers data source
This commit is contained in:
parent
385dabaa19
commit
bc899ead26
@ -596,12 +596,12 @@ Pipe ReadFromSystemNumbersStep::makePipe()
|
||||
numbers_storage.step,
|
||||
step_between_chunks);
|
||||
|
||||
if (numbers_storage.limit && i == 0)
|
||||
if (end && i == 0)
|
||||
{
|
||||
auto rows_appr = itemCountInRange(numbers_storage.offset, *numbers_storage.limit, numbers_storage.step);
|
||||
if (limit > 0 && limit < rows_appr)
|
||||
rows_appr = query_info_limit;
|
||||
source->addTotalRowsApprox(rows_appr);
|
||||
UInt64 rows_approx = itemCountInRange(numbers_storage.offset, *end, numbers_storage.step);
|
||||
if (limit > 0 && limit < rows_approx)
|
||||
rows_approx = query_info_limit;
|
||||
source->addTotalRowsApprox(rows_approx);
|
||||
}
|
||||
|
||||
pipe.addSource(std::move(source));
|
||||
|
Loading…
Reference in New Issue
Block a user