HappenLee commented on code in PR #45952:
URL: https://github.com/apache/doris/pull/45952#discussion_r1900372190


##########
be/src/vec/common/sort/partition_sorter.cpp:
##########
@@ -52,7 +52,12 @@ PartitionSorter::PartitionSorter(VSortExecExprs& 
vsort_exec_exprs, int limit, in
           _has_global_limit(has_global_limit),
           _partition_inner_limit(partition_inner_limit),
           _top_n_algorithm(top_n_algorithm),
-          _previous_row(previous_row) {}
+          _previous_row(previous_row) {
+    if (_has_global_limit) {
+        // only need row number if has global limit, so we change algorithm 
directly
+        _top_n_algorithm = TopNAlgorithm::ROW_NUMBER;

Review Comment:
   seems the work better do in FE in plan node



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to