yiguolei commented on code in PR #58073:
URL: https://github.com/apache/doris/pull/58073#discussion_r2562529484


##########
be/src/pipeline/exec/file_scan_operator.cpp:
##########
@@ -31,6 +31,39 @@
 
 namespace doris::pipeline {
 #include "common/compile_check_begin.h"
+
+int FileScanLocalState::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 file scanners for each FileScanLocalState is 
determined by:
+     * 1. User specified max_file_scanners_concurrency which is set through 
session variable.
+     * 2. Default: std::max(512, CpuInfo::num_cores() * 10)
+     *
+     * If this is a serial operator, the max concurrency should multiply by 
the number of parallel instances of the operator.
+     */
+    return (state->max_file_scanners_concurrency() ? 
state->max_file_scanners_concurrency()
+                                                   : std::max(512, 
CpuInfo::num_cores() * 10) * 2) *
+           (state->query_parallel_instance_num() / 
_parent->parallelism(state));
+}
+
+int FileScanLocalState::min_scanners_concurrency(RuntimeState* state) const {
+    /*
+     * The min concurrency of scanners for each ScanLocalStateBase is 
determined by:
+     * 1. User specified min_scan_concurrency_of_scan_scheduler which is set 
through session variable.
+     * 2. Default: 2 * 
state->get_query_ctx()->get_remote_scan_scheduler()->get_max_threads()
+     */
+    return state->min_scan_concurrency_of_scan_scheduler()

Review Comment:
   min_scan_concurrency_of_scan_scheduler > 0



-- 
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]

Reply via email to