You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/10/30 10:41:59 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #6965: optimize for single rowset reading

morningman commented on a change in pull request #6965:
URL: https://github.com/apache/incubator-doris/pull/6965#discussion_r739637673



##########
File path: be/src/olap/reader.cpp
##########
@@ -130,10 +130,16 @@ OLAPStatus Reader::init(const ReaderParams& read_params) {
                      << ", version:" << read_params.version;
         return res;
     }
-
+    // optimize for single rowset reading without do aggregation when reading all columns, 
+    // and otherwise should use _agg_key_next_row for AGG_KEYS
     if (_optimize_for_single_rowset(rs_readers)) {
-        _next_row_func = _tablet->keys_type() == AGG_KEYS ? &Reader::_direct_agg_key_next_row
-                                                          : &Reader::_direct_next_row;
+        if(_tablet->keys_type() == AGG_KEYS && _return_columns.size() == _tablet->tablet_schema().num_columns()) {
+            _next_row_func = &Reader::_direct_agg_key_next_row;
+        } else if (_tablet->keys_type() == AGG_KEYS) {
+            _next_row_func = &Reader::_agg_key_next_row;

Review comment:
       I didn't get the point.
   if `_optimize_for_single_rowset()` is true, there should be only one rowset, why we need to call `agg`?




-- 
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-unsubscribe@doris.apache.org

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



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