-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[feature](partition prune) support remove predicates that are always true after partition prune in list partition #57169
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
[feature](partition prune) support remove predicates that are always true after partition prune in list partition #57169
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-DS: Total hot run time: 190630 ms |
ClickBench: Total hot run time: 30.51 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
67a10c5 to
f95f6dd
Compare
|
run buildall |
TPC-DS: Total hot run time: 189897 ms |
ClickBench: Total hot run time: 28.68 s |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
|
run performance |
TPC-H: Total hot run time: 35603 ms |
ClickBench: Total hot run time: 29.91 s |
|
run buildall |
ClickBench: Total hot run time: 28.01 s |
|
run buildall |
TPC-DS: Total hot run time: 190730 ms |
ClickBench: Total hot run time: 27.75 s |
|
run nonConcurrent |
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
FE Regression Coverage ReportIncrement line coverage |
| partitionSlots, filter.getPredicate(), nameToPartitionItem, ctx, | ||
| PartitionTableType.EXTERNAL, sortedPartitionRanges)); | ||
| PartitionTableType.EXTERNAL, sortedPartitionRanges); | ||
| List<String> prunedPartitions = new ArrayList<>(res.first); |
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.
we support prune predicates for the external table in the future
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
FE UT Coverage ReportIncrement line coverage |
ClickBench: Total hot run time: 27.84 s |
FE Regression Coverage ReportIncrement line coverage |
|
run nonConcurrent |
|
PR approved by at least one committer and no changes requested. |
|
这个pr会导致统计信息推导出问题.因为我们并不是所有表都收集的partition的行数. 所以如果我们10个分区裁剪了9个,但因为没有partition的行数,那么估行时,我们会认为table输出了全部行,而不是部分行. |
…true after partition prune in list partition (apache#57169) Problem Summary: After partition pruning on a list-partitioned table, the partitioning key predicates used for pruning are often redundant within the remaining partitions, leading to unnecessary column scan and computation. Given a table: CREATE TABLE sales ( id INT, region VARCHAR(10) ) PARTITION BY LIST (region) ( PARTITION p_north VALUES IN ('bj', 'tj'), PARTITION p_south VALUES IN ('gz', 'sz') ); query: SELECT * FROM sales WHERE region IN ('bj', 'tj'); Plan Before: -> TableReader(Partition p_north) -> TableScan(Filter: region in ('bj', 'tj')) Plan After: -> TableReader(Partition p_north) -> TableScan() // Filter is removed
…prune predicate after partition prune (apache#57688) Add session variable skip_prune_predicate to skip prune predicate after partition prune. Related PR: apache#57169
…ache#57817) Related PR: apache#57169 Problem Summary: Previous pr only skip prune predicate when run delete command, forget to skip prune predicate when explain delete stmt. To solve this problem, this pr skip prune predicate when explain delete stmt and add some cases for update and delete.
…true after partition prune in list partition (apache#57169) ### What problem does this PR solve? Problem Summary: After partition pruning on a list-partitioned table, the partitioning key predicates used for pruning are often redundant within the remaining partitions, leading to unnecessary column scan and computation. Given a table: CREATE TABLE sales ( id INT, region VARCHAR(10) ) PARTITION BY LIST (region) ( PARTITION p_north VALUES IN ('bj', 'tj'), PARTITION p_south VALUES IN ('gz', 'sz') ); query: SELECT * FROM sales WHERE region IN ('bj', 'tj'); Plan Before: -> TableReader(Partition p_north) -> TableScan(Filter: region in ('bj', 'tj')) Plan After: -> TableReader(Partition p_north) -> TableScan() // Filter is removed
…prune predicate after partition prune (apache#57688) Add session variable skip_prune_predicate to skip prune predicate after partition prune. Related PR: apache#57169
…ache#57817) Related PR: apache#57169 Problem Summary: Previous pr only skip prune predicate when run delete command, forget to skip prune predicate when explain delete stmt. To solve this problem, this pr skip prune predicate when explain delete stmt and add some cases for update and delete.
…true after partition prune in list partition (apache#57169) Problem Summary: After partition pruning on a list-partitioned table, the partitioning key predicates used for pruning are often redundant within the remaining partitions, leading to unnecessary column scan and computation. Given a table: CREATE TABLE sales ( id INT, region VARCHAR(10) ) PARTITION BY LIST (region) ( PARTITION p_north VALUES IN ('bj', 'tj'), PARTITION p_south VALUES IN ('gz', 'sz') ); query: SELECT * FROM sales WHERE region IN ('bj', 'tj'); Plan Before: -> TableReader(Partition p_north) -> TableScan(Filter: region in ('bj', 'tj')) Plan After: -> TableReader(Partition p_north) -> TableScan() // Filter is removed
…prune predicate after partition prune (apache#57688) Add session variable skip_prune_predicate to skip prune predicate after partition prune. Related PR: apache#57169
…ache#57817) Related PR: apache#57169 Problem Summary: Previous pr only skip prune predicate when run delete command, forget to skip prune predicate when explain delete stmt. To solve this problem, this pr skip prune predicate when explain delete stmt and add some cases for update and delete.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
After partition pruning on a list-partitioned table, the partitioning key predicates used for pruning are often redundant within the remaining partitions, leading to unnecessary column scan and computation.
Given a table:
Plan Before:
Plan After:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)