yiguolei commented on code in PR #58073:
URL: https://github.com/apache/doris/pull/58073#discussion_r2563750292
##########
be/src/pipeline/exec/scan_operator.cpp:
##########
@@ -72,6 +72,38 @@ bool ScanLocalState<Derived>::should_run_serial() const {
return _parent->cast<typename Derived::Parent>()._should_run_serial;
}
+int ScanLocalStateBase::max_scanners_concurrency(RuntimeState* state) const {
+ // For select * from table limit 10; should just use one thread.
+ if (should_run_serial()) {
+ return 1;
+ }
+ /*
+ * The max concurrency of scanners for each ScanLocalStateBase is
determined by:
+ * 1. User specified max_scanners_concurrency which is set through session
variable.
+ * 2. Default: std::max(48, CpuInfo::num_cores() * 2))
+ *
+ * If this is a serial operator, the max concurrency should multiply by
the number of parallel instances of the operator.
+ */
+ return (state->max_scanners_concurrency() ?
state->max_scanners_concurrency()
+ : std::max(48,
CpuInfo::num_cores() * 2) * 2) *
+ (state->query_parallel_instance_num() /
_parent->parallelism(state));
+}
+
+int ScanLocalStateBase::min_scanners_concurrency(RuntimeState* state) const {
Review Comment:
rename to min_scan_concurrency_of_scan_scheduler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]