This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 4ca9fabd122 branch-4.0: [chore](be) remove cpu limit since it is 
useless #58860 (#58911)
4ca9fabd122 is described below

commit 4ca9fabd12214aefdfb9a7eca86960bc5d4d38c5
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Dec 11 10:33:19 2025 +0800

    branch-4.0: [chore](be) remove cpu limit since it is useless #58860 (#58911)
    
    Cherry-picked from #58860
    
    Co-authored-by: yiguolei <[email protected]>
---
 be/src/pipeline/exec/olap_scan_operator.cpp |  4 +---
 be/src/pipeline/exec/scan_operator.cpp      | 29 +++++++++--------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/be/src/pipeline/exec/olap_scan_operator.cpp 
b/be/src/pipeline/exec/olap_scan_operator.cpp
index 7918ce8d7da..2cf9167d659 100644
--- a/be/src/pipeline/exec/olap_scan_operator.cpp
+++ b/be/src/pipeline/exec/olap_scan_operator.cpp
@@ -449,8 +449,6 @@ Status 
OlapScanLocalState::_init_scanners(std::list<vectorized::ScannerSPtr>* sc
     }
 
     bool enable_parallel_scan = state()->enable_parallel_scan();
-    bool has_cpu_limit = state()->query_options().__isset.resource_limit &&
-                         
state()->query_options().resource_limit.__isset.cpu_limit;
 
     // The flag of preagg's meaning is whether return pre agg data(or partial 
agg data)
     // PreAgg ON: The storage layer returns partially aggregated data without 
additional processing. (Fast data reading)
@@ -458,7 +456,7 @@ Status 
OlapScanLocalState::_init_scanners(std::list<vectorized::ScannerSPtr>* sc
     // And the user send a query like select userid,count(*) from base table 
group by userid.
     // then the storage layer do not need do aggregation, it could just return 
the partial agg data, because the compute layer will do aggregation.
     // PreAgg OFF: The storage layer must complete pre-aggregation and return 
fully aggregated data. (Slow data reading)
-    if (enable_parallel_scan && !p._should_run_serial && !has_cpu_limit &&
+    if (enable_parallel_scan && !p._should_run_serial &&
         p._push_down_agg_type == TPushAggOp::NONE &&
         (_storage_no_merge() || p._olap_scan_node.is_preaggregation)) {
         std::vector<OlapScanRange*> key_ranges;
diff --git a/be/src/pipeline/exec/scan_operator.cpp 
b/be/src/pipeline/exec/scan_operator.cpp
index 31ce83989e6..06c22afdb02 100644
--- a/be/src/pipeline/exec/scan_operator.cpp
+++ b/be/src/pipeline/exec/scan_operator.cpp
@@ -55,7 +55,6 @@
 namespace doris::pipeline {
 
 #include "common/compile_check_begin.h"
-const static int32_t ADAPTIVE_PIPELINE_TASK_SERIAL_READ_ON_LIMIT_DEFAULT = 
10000;
 
 #define RETURN_IF_PUSH_DOWN(stmt, status)    \
     if (pdt == PushDownType::UNACCEPTABLE) { \
@@ -1272,29 +1271,19 @@ Status ScanOperatorX<LocalStateType>::init(const 
TPlanNode& tnode, RuntimeState*
         topn_filter_source_node_ids = tnode.topn_filter_source_node_ids;
     }
 
-    // The first branch is kept for compatibility with the old version of the 
FE
-    if 
(!query_options.__isset.enable_adaptive_pipeline_task_serial_read_on_limit) {
-        if (!tnode.__isset.conjuncts || tnode.conjuncts.empty()) {
-            // Which means the request could be fullfilled in a single segment 
iterator request.
+    // Which means the request could be fullfilled in a single segment 
iterator request.
+    // the unique_table has a condition of delete_sign = 0 awalys, so it's not 
have plan for one instance to scan table,
+    // now add some check for unique_table let running only one instance for 
select limit n.
+    if (query_options.enable_adaptive_pipeline_task_serial_read_on_limit) {
+        
DCHECK(query_options.__isset.adaptive_pipeline_task_serial_read_on_limit);
+        if (!tnode.__isset.conjuncts || tnode.conjuncts.empty() ||
+            (tnode.conjuncts.size() == 1 && tnode.__isset.olap_scan_node &&
+             tnode.olap_scan_node.keyType == TKeysType::UNIQUE_KEYS)) {
             if (tnode.limit > 0 &&
-                tnode.limit <= 
ADAPTIVE_PIPELINE_TASK_SERIAL_READ_ON_LIMIT_DEFAULT) {
+                tnode.limit <= 
query_options.adaptive_pipeline_task_serial_read_on_limit) {
                 _should_run_serial = true;
             }
         }
-    } else {
-        // The set of enable_adaptive_pipeline_task_serial_read_on_limit
-        // is checked in previous branch.
-        if (query_options.enable_adaptive_pipeline_task_serial_read_on_limit) {
-            
DCHECK(query_options.__isset.adaptive_pipeline_task_serial_read_on_limit);
-            if (!tnode.__isset.conjuncts || tnode.conjuncts.empty() ||
-                (tnode.conjuncts.size() == 1 && tnode.__isset.olap_scan_node &&
-                 tnode.olap_scan_node.keyType == TKeysType::UNIQUE_KEYS)) {
-                if (tnode.limit > 0 &&
-                    tnode.limit <= 
query_options.adaptive_pipeline_task_serial_read_on_limit) {
-                    _should_run_serial = true;
-                }
-            }
-        }
     }
 
     return Status::OK();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to