-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(optimizer): cherry-pick support better predicate pushdown for ta…
…ble scan (#19934) Co-authored-by: Xinhao Xu <[email protected]>
- Loading branch information
Showing
14 changed files
with
1,622 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
statement ok | ||
create table t1(v1 int, v2 int, v3 int); | ||
|
||
statement ok | ||
insert into t1 values(1,1,1),(1,2,1),(1,2,2),(1,3,1),(1,3,2),(1,3,3); | ||
|
||
statement ok | ||
create materialized view mv1 as select * from t1 order by v1 asc, v2 desc, v3 asc; | ||
|
||
statement ok | ||
create materialized view mv2 as select * from t1 order by v1 desc, v2 desc, v3 desc; | ||
|
||
statement ok | ||
create materialized view mv3 as select * from t1 order by v1 asc, v2 asc, v3 asc; | ||
|
||
query III | ||
select * from mv1 where (v1,v2,v3) > (1,3,1) order by v3; | ||
---- | ||
1 3 2 | ||
1 3 3 | ||
|
||
query III | ||
select * from mv2 where (v1,v2,v3) > (1,3,1) order by v3; | ||
---- | ||
1 3 2 | ||
1 3 3 | ||
|
||
query III | ||
select * from mv3 where (v1,v2,v3) > (1,3,1) order by v3; | ||
---- | ||
1 3 2 | ||
1 3 3 | ||
|
||
query III | ||
select * from mv1 where (v1,v2,v3) < (1,3,1) order by v1,v2,v3; | ||
---- | ||
1 1 1 | ||
1 2 1 | ||
1 2 2 | ||
|
||
query III | ||
select * from mv2 where (v1,v2,v3) < (1,3,1) order by v1,v2,v3; | ||
---- | ||
1 1 1 | ||
1 2 1 | ||
1 2 2 | ||
|
||
query III | ||
select * from mv3 where (v1,v2,v3) < (1,3,1) order by v1,v2,v3; | ||
---- | ||
1 1 1 | ||
1 2 1 | ||
1 2 2 | ||
|
||
statement ok | ||
drop materialized view mv3; | ||
|
||
statement ok | ||
drop materialized view mv2; | ||
|
||
statement ok | ||
drop materialized view mv1; | ||
|
||
statement ok | ||
drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.