We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem: select * from t where k=1 union all select * from t where k=3;
select * from t where k=1 union all select * from t where k=3;
should convert to:
select * from t where k=1 or k=3;
to reduce scanners
Reproduce Steps: 1、create table:
CREATE TABLE `t` ( `k` int NULL, `v` int NULL ) ENGINE=OLAP DUPLICATE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS AUTO PROPERTIES ( "replication_allocation" = "tag.location.default: 1");
2、add data: insert into t values(1,2),(3,4);
insert into t values(1,2),(3,4);
3、explain union all SQL
> explain shape plan select * from t where k=1 union all select * from t where k=3; +--------------------------------------------------------+ | Explain String(Nereids Planner) | +--------------------------------------------------------+ | PhysicalResultSink | | --PhysicalDistribute[DistributionSpecGather] | | ----PhysicalUnion | | ------PhysicalDistribute[DistributionSpecExecutionAny] | | --------filter((t.k = 1)) | | ----------PhysicalOlapScan[t] | | ------PhysicalDistribute[DistributionSpecExecutionAny] | | --------filter((t.k = 3)) | | ----------PhysicalOlapScan[t] | +--------------------------------------------------------+
4、explain equal SQL:
> explain shape plan select * from t where k=1 or k=3; +----------------------------------------------+ | Explain String(Nereids Planner) | +----------------------------------------------+ | PhysicalResultSink | | --PhysicalDistribute[DistributionSpecGather] | | ----filter(k IN (1, 3)) | | ------PhysicalOlapScan[t] | +----------------------------------------------+
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Search before asking
Description
Problem:
select * from t where k=1 union all select * from t where k=3;
should convert to:
select * from t where k=1 or k=3;
to reduce scanners
Reproduce Steps:
1、create table:
2、add data:
insert into t values(1,2),(3,4);
3、explain union all SQL
4、explain equal SQL:
Solution
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: