mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix limiting the number of threads for VIEW.
This commit is contained in:
parent
f87c3af097
commit
6527e04ec3
@ -167,6 +167,13 @@ public:
|
|||||||
/// Set upper limit for the recommend number of threads
|
/// Set upper limit for the recommend number of threads
|
||||||
void setMaxThreads(size_t max_threads_) { max_threads = max_threads_; }
|
void setMaxThreads(size_t max_threads_) { max_threads = max_threads_; }
|
||||||
|
|
||||||
|
/// Update upper limit for the recommend number of threads
|
||||||
|
void limitMaxThreads(size_t max_threads_)
|
||||||
|
{
|
||||||
|
if (max_threads == 0 || max_threads_ < max_threads)
|
||||||
|
max_threads = max_threads_;
|
||||||
|
}
|
||||||
|
|
||||||
/// Convert query pipeline to single or several pipes.
|
/// Convert query pipeline to single or several pipes.
|
||||||
Pipe getPipe() &&;
|
Pipe getPipe() &&;
|
||||||
Pipes getPipes() &&;
|
Pipes getPipes() &&;
|
||||||
|
@ -153,8 +153,8 @@ QueryPipelinePtr QueryPlan::buildQueryPipeline()
|
|||||||
bool limit_max_threads = frame.pipelines.empty();
|
bool limit_max_threads = frame.pipelines.empty();
|
||||||
last_pipeline = frame.node->step->updatePipeline(std::move(frame.pipelines));
|
last_pipeline = frame.node->step->updatePipeline(std::move(frame.pipelines));
|
||||||
|
|
||||||
if (limit_max_threads)
|
if (limit_max_threads && max_threads)
|
||||||
last_pipeline->setMaxThreads(max_threads);
|
last_pipeline->limitMaxThreads(max_threads);
|
||||||
|
|
||||||
stack.pop();
|
stack.pop();
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ ReadFromStorageStep::ReadFromStorageStep(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipes.size() == 1)
|
if (pipes.size() == 1 && !storage->isView())
|
||||||
pipeline->setMaxThreads(1);
|
pipeline->setMaxThreads(1);
|
||||||
|
|
||||||
for (auto & pipe : pipes)
|
for (auto & pipe : pipes)
|
||||||
|
Loading…
Reference in New Issue
Block a user