-
Notifications
You must be signed in to change notification settings - Fork 644
feat(optimizer): index accelerating TopN
#7726
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
398d938
mimic logical_scan
y-wei 4bf7616
let topn using index, first trial
y-wei ff9d519
remove useless code
y-wei 4a9efc6
remove useless code
y-wei 93ef95c
solve the order problem
y-wei 3d6798d
have default any order
y-wei f9fcc0a
rename and replace with input()
y-wei baf8e6c
add license
y-wei 495fa8e
using index_table.pk rather than index_items
y-wei 978a480
Merge branch 'topn_acc' of github.com:ClearloveWei/risingwave_e into …
y-wei 616dc8a
update planner test
y-wei fbd1b3d
add e2e tests
y-wei 3e7679e
seq_scan_node specifies chunk size at executor
y-wei ff4eaa8
check and dashboard prost
y-wei 5e51615
support primary key
y-wei 8265643
format
y-wei e277ee8
make chunk_size optional, replace satisfies with supersets
y-wei 37ce43c
apply s2p mapping before comparing index and topn order
y-wei fc94781
translate index column_idx to topn_col_idx
y-wei cb87843
workaround for optional in proto
y-wei 8f352b3
check
y-wei aeb41e4
replace required to output and include it in the primary key part
y-wei e7cb28d
apply optimization iff predicate is always true
y-wei f537a4f
Merge branch 'main' into topn_acc
y-wei cd261db
update planner test
y-wei 260834c
Merge branch 'main' into topn_acc
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,47 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
create table t(x int, y int); | ||
|
||
statement ok | ||
create index idx on t(x); | ||
|
||
statement ok | ||
insert into t values (100, 3), (1, 0), (2, 3), (3, 4), (5, 4); | ||
|
||
query II | ||
select * from t order by x limit 1; | ||
---- | ||
1 0 | ||
|
||
query II | ||
select * from t order by x limit 3; | ||
---- | ||
1 0 | ||
2 3 | ||
3 4 | ||
|
||
statement ok | ||
create table t1(x int primary key, y int); | ||
|
||
statement ok | ||
insert into t1 values (100, 3), (1, 0), (2, 3), (3, 4), (5, 4); | ||
|
||
query II | ||
select * from t1 order by x limit 1; | ||
---- | ||
1 0 | ||
|
||
query II | ||
select * from t1 order by x limit 3; | ||
---- | ||
1 0 | ||
2 3 | ||
3 4 | ||
|
||
statement ok | ||
drop table t; | ||
|
||
statement ok | ||
drop table t1; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using an
Option
here? If it'sNone
, then the batch executor will follow the value from the config, so that we don't need to hard code a1024
here.TIPS: wrap a primitive into a new message will make it
optional
in proto3 like this:risingwave/proto/stream_plan.proto
Lines 632 to 634 in 9e1ff93