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 2022/07/05 07:55:14 UTC

[GitHub] [doris] Kikyou1997 opened a new pull request, #10615: [Enhancement] Add column prune support for VOlapScanNode

Kikyou1997 opened a new pull request, #10615:
URL: https://github.com/apache/doris/pull/10615

   # Proposed changes
   
   As we don't do column prune on the olap scan, there always serialize a lot of uneccesary column in multi BE scenes which cause a huge impact on the performance.
   
   ## Problem Summary:
   
   Env: 1FE 3BE
   Data Size: 1G
   
   We use tpch q13 as example:
   
   before time cost:
   
   0.99
   0.95
   0.98
   1.11
   1.04
   
   after this commit:
   
   0.74
   0.67
   0.71
   0.74
   0.68
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (No)
   2. Has unit tests been added: (No)
   3. Has document been added or modified: (No Need)
   4. Does it need to update dependencies: (No)
   5. Are there any changes that cannot be rolled back: (No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


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


[GitHub] [doris] Kikyou1997 commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
Kikyou1997 commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916412786


##########
be/src/vec/exec/volap_scan_node.cpp:
##########
@@ -1833,4 +1842,12 @@ Status VOlapScanNode::get_hints(TabletSharedPtr table, const TPaloScanRange& sca
     return Status::OK();
 }
 
+void VOlapScanNode::init_output_slots() {
+    for (const auto& slot_desc : _tuple_desc->slots()) {
+        _output_slot_flags.emplace_back(_output_slot_ids.empty() ||
+                                        std::find(_output_slot_ids.begin(), _output_slot_ids.end(),
+                                                  slot_desc->id()) != _output_slot_ids.end());

Review Comment:
   Only when the slot_desc 's against output_slot_ids exists, the flag could be true



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


[GitHub] [doris] Kikyou1997 commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
Kikyou1997 commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916406967


##########
be/src/vec/exec/volap_scanner.h:
##########
@@ -112,6 +112,7 @@ class VOlapScanner {
     std::vector<bool> _runtime_filter_marks;
 
     int _id;

Review Comment:
   I think it would be helpful when debugging, cause the id of volapscanner always be -1 now, maybe  it should be marked as compile in  debug only...



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


[GitHub] [doris] yiguolei commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916405258


##########
be/src/vec/exec/volap_scan_node.cpp:
##########
@@ -1649,6 +1650,14 @@ Status VOlapScanNode::get_next(RuntimeState* state, Block* block, bool* eos) {
             std::lock_guard<std::mutex> l(_free_blocks_lock);
             _free_blocks.emplace_back(materialized_block);
         }
+
+        auto columns = block->get_columns();
+        auto slots = _tuple_desc->slots();
+        for (int i = 0; i < slots.size(); i++) {
+            if (!_output_slot_flags[i]) {
+                (*std::move(columns[i])).assume_mutable()->clear();

Review Comment:
   std::move(columns[i])->



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


[GitHub] [doris] yiguolei merged pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #10615:
URL: https://github.com/apache/doris/pull/10615


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


[GitHub] [doris] yiguolei commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916405004


##########
be/src/vec/exec/volap_scan_node.cpp:
##########
@@ -1833,4 +1842,12 @@ Status VOlapScanNode::get_hints(TabletSharedPtr table, const TPaloScanRange& sca
     return Status::OK();
 }
 
+void VOlapScanNode::init_output_slots() {
+    for (const auto& slot_desc : _tuple_desc->slots()) {
+        _output_slot_flags.emplace_back(_output_slot_ids.empty() ||
+                                        std::find(_output_slot_ids.begin(), _output_slot_ids.end(),
+                                                  slot_desc->id()) != _output_slot_ids.end());

Review Comment:
   why? !=



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


[GitHub] [doris] Kikyou1997 commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
Kikyou1997 commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916408153


##########
be/src/vec/exec/volap_scan_node.cpp:
##########
@@ -1649,6 +1650,14 @@ Status VOlapScanNode::get_next(RuntimeState* state, Block* block, bool* eos) {
             std::lock_guard<std::mutex> l(_free_blocks_lock);
             _free_blocks.emplace_back(materialized_block);
         }
+
+        auto columns = block->get_columns();
+        auto slots = _tuple_desc->slots();
+        for (int i = 0; i < slots.size(); i++) {
+            if (!_output_slot_flags[i]) {
+                (*std::move(columns[i])).assume_mutable()->clear();

Review Comment:
   done



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


[GitHub] [doris] yiguolei commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916405707


##########
be/src/vec/exec/volap_scanner.h:
##########
@@ -112,6 +112,7 @@ class VOlapScanner {
     std::vector<bool> _runtime_filter_marks;
 
     int _id;

Review Comment:
   is this  field useful?



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


[GitHub] [doris] Kikyou1997 commented on a diff in pull request #10615: [Enhancement] Add column prune support for VOlapScanNode

Posted by GitBox <gi...@apache.org>.
Kikyou1997 commented on code in PR #10615:
URL: https://github.com/apache/doris/pull/10615#discussion_r916412255


##########
be/src/vec/exec/volap_scanner.h:
##########
@@ -112,6 +112,7 @@ class VOlapScanner {
     std::vector<bool> _runtime_filter_marks;
 
     int _id;

Review Comment:
   deleted _id_gen



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