Skip to content

[Enhancement] Add column prune support for VOlapScanNode#10615

Merged
yiguolei merged 13 commits intoapache:masterfrom
Kikyou1997:column_prune
Jul 8, 2022
Merged

[Enhancement] Add column prune support for VOlapScanNode#10615
yiguolei merged 13 commits intoapache:masterfrom
Kikyou1997:column_prune

Conversation

@Kikyou1997
Copy link
Contributor

@Kikyou1997 Kikyou1997 commented Jul 5, 2022

Proposed changes

As we don't prune column on the olap scan, doris 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 tpch tools generated data

We use tpch q13 as example:

time cost before :

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 by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions github-actions bot added area/planner Issues or PRs related to the query planner area/vectorization labels Jul 5, 2022
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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? !=

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -112,6 +112,7 @@ class VOlapScanner {
std::vector<bool> _runtime_filter_marks;

int _id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this field useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted _id_gen

Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yiguolei yiguolei added this to the v1.2 milestone Jul 8, 2022
@yiguolei yiguolei merged commit e37d294 into apache:master Jul 8, 2022
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 10, 2022
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 10, 2022
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Jul 11, 2022
eldenmoon pushed a commit to eldenmoon/incubator-doris that referenced this pull request Aug 1, 2022
eldenmoon pushed a commit to eldenmoon/incubator-doris that referenced this pull request Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/planner Issues or PRs related to the query planner area/vectorization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants