Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug](sort) disable 2phase read for sort by expressions exclude slotref #16460

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

eldenmoon
Copy link
Member

create table tbl1 (k1 varchar(100), k2 string) distributed by hash(k1) buckets 1 properties("replication_num" = "1");

insert into tbl1 values(1, "alice");

select cast(k1 as INT) as id from tbl1 order by id limit 2;

The above query could pass checkEnableTwoPhaseRead since the order by element is SlotRef but actually it's an function call expr

Proposed changes

Issue Number: close #xxx

Problem summary

Describe your changes.

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • 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 kind/test labels Feb 7, 2023
@hello-stephen
Copy link
Contributor

hello-stephen commented Feb 7, 2023

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 33.65 seconds
load time: 477 seconds
storage size: 17170595130 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230207052840_clickbench_pr_91177.html

```
create table tbl1 (k1 varchar(100), k2 string) distributed by hash(k1) buckets 1 properties("replication_num" = "1");

insert into tbl1 values(1, "alice");

select cast(k1 as INT) as id from tbl1 order by id limit 2;
```

The above query could pass `checkEnableTwoPhaseRead` since the order by element is SlotRef but actually it's an function call expr
Copy link
Contributor

@Gabriel39 Gabriel39 left a comment

Choose a reason for hiding this comment

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

LGTM

@Gabriel39 Gabriel39 merged commit 1d0fdff into apache:master Feb 7, 2023
YangShaw pushed a commit to YangShaw/doris that referenced this pull request Feb 17, 2023
…ef (apache#16460)

```
create table tbl1 (k1 varchar(100), k2 string) distributed by hash(k1) buckets 1 properties("replication_num" = "1");

insert into tbl1 values(1, "alice");

select cast(k1 as INT) as id from tbl1 order by id limit 2;
```

The above query could pass `checkEnableTwoPhaseRead` since the order by element is SlotRef but actually it's an function call expr
morrySnow added a commit that referenced this pull request Apr 21, 2023
add two phase read topn opt, the legacy planner's PR are:
- #15642
- #16460
- #16848

TODO:
we forbid limit(sort(project(scan))) since be core when plan has a project on the scan.
we need to remove this restirction after we fix be bug
gnehil pushed a commit to gnehil/doris that referenced this pull request Apr 21, 2023
add two phase read topn opt, the legacy planner's PR are:
- apache#15642
- apache#16460
- apache#16848

TODO:
we forbid limit(sort(project(scan))) since be core when plan has a project on the scan.
we need to remove this restirction after we fix be bug
xiaokang pushed a commit to xiaokang/doris that referenced this pull request Apr 22, 2023
add two phase read topn opt, the legacy planner's PR are:
- apache#15642
- apache#16460
- apache#16848

TODO:
we forbid limit(sort(project(scan))) since be core when plan has a project on the scan.
we need to remove this restirction after we fix be bug
Reminiscent pushed a commit to Reminiscent/doris that referenced this pull request May 15, 2023
add two phase read topn opt, the legacy planner's PR are:
- apache#15642
- apache#16460
- apache#16848

TODO:
we forbid limit(sort(project(scan))) since be core when plan has a project on the scan.
we need to remove this restirction after we fix be bug
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 kind/test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants