-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[opt](nereids) use binary search to prune partitions #44586
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
98f7178 to
5db0287
Compare
|
run buildall |
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/MultiColumnBound.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/MultiColumnBound.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/apache/doris/nereids/rules/expression/rules/PartitionItemToRange.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/apache/doris/nereids/rules/expression/rules/SortedPartitionRanges.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/PartitionPruner.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/doris/nereids/rules/expression/rules/PartitionPredicateToRange.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneOlapScanPartition.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/PartitionPruner.java
Show resolved
Hide resolved
5db0287 to
3674062
Compare
|
run buildall |
3674062 to
5bd7802
Compare
|
run buildall |
|
|
run buildall |
|
|
run buildall |
|
|
run buildall |
|
bafd5fb to
3b878fc
Compare
|
run buildall |
3b878fc to
264f436
Compare
|
run buildall |
TPC-H: Total hot run time: 39878 ms |
TPC-DS: Total hot run time: 196789 ms |
ClickBench: Total hot run time: 33.33 s |
264f436 to
197aa64
Compare
|
run buildall |
TPC-H: Total hot run time: 40019 ms |
|
run buildall |
TPC-H: Total hot run time: 40120 ms |
TPC-DS: Total hot run time: 190521 ms |
ClickBench: Total hot run time: 32.06 s |
|
PR approved by at least one committer and no changes requested. |
|
run buildall |
TPC-H: Total hot run time: 39820 ms |
TPC-DS: Total hot run time: 190328 ms |
ClickBench: Total hot run time: 32.55 s |
use binary search to speed up prune partitions. test: datetime partition column which range from 2020-07-02 to 2024-11-13, one date for one partition, query one partition for example `dt = '2024-01-02'`, this pr can speed up from QPS 160 to QPS 610
Followup #44586 Enable binary search partition pruning optimization for Hive external tables. This PR adds binary search partition pruning support for Hive tables by: - Adding `getSortedPartitionRanges()` method to `ExternalTable` base class - Maintaining sorted partition ranges directly in `HivePartitionValues` for cache lifecycle consistency - Overriding `getSortedPartitionRanges()` in `HMSExternalTable` to provide sorted ranges **Performance improvement (20000 partitions, 1000 queries):** - Binary search enabled: **4.548 seconds** - Binary search disabled: **12.849 seconds** - **~2.8x faster**
Followup #44586 Enable binary search partition pruning optimization for Hive external tables. This PR adds binary search partition pruning support for Hive tables by: - Adding `getSortedPartitionRanges()` method to `ExternalTable` base class - Maintaining sorted partition ranges directly in `HivePartitionValues` for cache lifecycle consistency - Overriding `getSortedPartitionRanges()` in `HMSExternalTable` to provide sorted ranges **Performance improvement (20000 partitions, 1000 queries):** - Binary search enabled: **4.548 seconds** - Binary search disabled: **12.849 seconds** - **~2.8x faster**
Followup apache#44586 Enable binary search partition pruning optimization for Hive external tables. This PR adds binary search partition pruning support for Hive tables by: - Adding `getSortedPartitionRanges()` method to `ExternalTable` base class - Maintaining sorted partition ranges directly in `HivePartitionValues` for cache lifecycle consistency - Overriding `getSortedPartitionRanges()` in `HMSExternalTable` to provide sorted ranges **Performance improvement (20000 partitions, 1000 queries):** - Binary search enabled: **4.548 seconds** - Binary search disabled: **12.849 seconds** - **~2.8x faster**
Followup #44586 Enable binary search partition pruning optimization for Hive external tables. This PR adds binary search partition pruning support for Hive tables by: - Adding `getSortedPartitionRanges()` method to `ExternalTable` base class - Maintaining sorted partition ranges directly in `HivePartitionValues` for cache lifecycle consistency - Overriding `getSortedPartitionRanges()` in `HMSExternalTable` to provide sorted ranges **Performance improvement (20000 partitions, 1000 queries):** - Binary search enabled: **4.548 seconds** - Binary search disabled: **12.849 seconds** - **~2.8x faster**
Followup apache#44586 Enable binary search partition pruning optimization for Hive external tables. This PR adds binary search partition pruning support for Hive tables by: - Adding `getSortedPartitionRanges()` method to `ExternalTable` base class - Maintaining sorted partition ranges directly in `HivePartitionValues` for cache lifecycle consistency - Overriding `getSortedPartitionRanges()` in `HMSExternalTable` to provide sorted ranges **Performance improvement (20000 partitions, 1000 queries):** - Binary search enabled: **4.548 seconds** - Binary search disabled: **12.849 seconds** - **~2.8x faster**
What problem does this PR solve?
use binary search to speed up prune partitions.
test: datetime partition column which range from 2020-07-02 to 2024-11-13, one date for one partition, query one partition for example
dt = '2024-01-02', this pr can speed up from QPS 160 to QPS 610TODO:
date_add(dt, 1) = '2024-01-02;Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)