Uh oh!
There was an error while loading. Please reload this page.
[fix](nereids) fix prune tablets twice - #53403
Merged
Merged
Conversation
hello-stephen
commented
Jul 16, 2025
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
924060929
commented
Jul 16, 2025
ContributorAuthor
run buildall |
morrySnow
previously approved these changes
Jul 16, 2025
Contributor
PR approved by at least one committer and no changes requested. |
Contributor
PR approved by anyone and no changes requested. |
doris-robot
commented
Jul 16, 2025
TPC-H: Total hot run time: 33875 ms |
doris-robot
commented
Jul 16, 2025
TPC-DS: Total hot run time: 185143 ms |
doris-robot
commented
Jul 16, 2025
ClickBench: Total hot run time: 32.33 s |
hello-stephen
commented
Jul 16, 2025
Contributor
FE UT Coverage ReportIncrement line coverage |
924060929
commented
Jul 17, 2025
ContributorAuthor
run buildall |
924060929
commented
Jul 17, 2025
ContributorAuthor
run buildall |
1 similar comment
924060929
commented
Jul 17, 2025
ContributorAuthor
run buildall |
doris-robot
commented
Jul 17, 2025
TPC-H: Total hot run time: 33638 ms |
doris-robot
commented
Jul 17, 2025
TPC-DS: Total hot run time: 186222 ms |
doris-robot
commented
Jul 17, 2025
ClickBench: Total hot run time: 32.09 s |
924060929
commented
Jul 17, 2025
ContributorAuthor
run buildall |
924060929force-pushed
the
fix-prune-tablets
branch
from
July 17, 2025 12:18
3942eae to
f2f9c6aCompare924060929
commented
Jul 17, 2025
ContributorAuthor
run buildall |
doris-robot
commented
Jul 17, 2025
TPC-H: Total hot run time: 33921 ms |
doris-robot
commented
Jul 17, 2025
TPC-DS: Total hot run time: 186907 ms |
doris-robot
commented
Jul 17, 2025
ClickBench: Total hot run time: 32.53 s |
starocean999
approved these changes
Jul 23, 2025
Contributor
PR approved by at least one committer and no changes requested. |
morrySnow
approved these changes
Jul 24, 2025
Uh oh!
There was an error while loading. Please reload this page.
w41ter pushed a commit
to w41ter/incubator-doris
that referenced
this pull request
Jul 30, 2025
### What problem does this PR solve? fix prune tablets twice first in the PruneOlapScanTablet, second in the OlapTableNode.computeTabletInfo. we should skip prune tablets in OlapTableNode
RoanHeNaN pushed a commit
to RoanHeNaN/doris
that referenced
this pull request
Aug 4, 2025
### What problem does this PR solve? fix prune tablets twice first in the PruneOlapScanTablet, second in the OlapTableNode.computeTabletInfo. we should skip prune tablets in OlapTableNode
Larborator pushed a commit
to Larborator/doris
that referenced
this pull request
May 28, 2026
…utionPrune apache#53403 short-circuited `distributionPrune` to return the entire `nereidsPrunedTabletIds` set when running under Nereids. However, the caller `computeTabletInfo` invokes `distributionPrune` inside a per-partition loop and then iterates the returned ids, calling `MaterializedIndex.getTablet(id)` on each. When `nereidsPrunedTabletIds` contains tablets across many partitions, every per-partition iteration walks the entire global set and does a `getTablet` hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (`tabletIdsInOrder`, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the `sampleTabletIds` path and the empty-set fallback are untouched.
16 tasks
Larborator pushed a commit
to Larborator/doris
that referenced
this pull request
May 28, 2026
…tributionPrune apache#53403 short-circuited `distributionPrune` to return the entire `nereidsPrunedTabletIds` set when running under Nereids. However, the caller `computeTabletInfo` invokes `distributionPrune` inside a per-partition loop and then iterates the returned ids, calling `MaterializedIndex.getTablet(id)` on each. When `nereidsPrunedTabletIds` contains tablets across many partitions, every per-partition iteration walks the entire global set and does a `getTablet` hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (`tabletIdsInOrder`, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the `sampleTabletIds` path and the empty-set fallback are untouched.
3 tasks
Larborator pushed a commit
to Larborator/doris
that referenced
this pull request
May 28, 2026
…tributionPrune apache#53403 short-circuited `distributionPrune` to return the entire `nereidsPrunedTabletIds` set when running under Nereids. However, the caller `computeTabletInfo` invokes `distributionPrune` inside a per-partition loop and then iterates the returned ids, calling `MaterializedIndex.getTablet(id)` on each. When `nereidsPrunedTabletIds` contains tablets across many partitions, every per-partition iteration walks the entire global set and does a `getTablet` hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (`tabletIdsInOrder`, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the `sampleTabletIds` path and the empty-set fallback are untouched. Also cache the `selectedTable.getTablet(id)` result in the caller's loop so the lookup runs once per id instead of twice.
morrySnow pushed a commit
that referenced
this pull request
Jun 2, 2026
…tributionPrune (#63851) ### What problem does this PR solve? #53403 short-circuited distributionPrune to return the entire nereidsPrunedTabletIds set when running under Nereids. However, the caller computeTabletInfo invokes distributionPrune inside a per-partition loop and then iterates the returned ids, calling MaterializedIndex.getTablet(id) on each. When nereidsPrunedTabletIds contains tablets across many partitions, every per-partition iteration walks the entire global set and does a getTablet hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (tabletIdsInOrder, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the sampleTabletIds path and the empty-set fallback are untouched. Issue Number: close#63854 Related PR: #53403 Problem Summary: Plan time of OlapScan queries with many partitions and many globally pruned tablets degrades quadratically due to redundant per-partition iterations over the global pruned tablet set in OlapScanNode.distributionPrune. Restore per-partition complexity by filtering the global set down to the current partition's tablets before returning. Co-authored-by: zhousimin <zhousimin@kuaishou.com>
github-actionsBot
pushed a commit
that referenced
this pull request
Jun 2, 2026
…tributionPrune (#63851) ### What problem does this PR solve? #53403 short-circuited distributionPrune to return the entire nereidsPrunedTabletIds set when running under Nereids. However, the caller computeTabletInfo invokes distributionPrune inside a per-partition loop and then iterates the returned ids, calling MaterializedIndex.getTablet(id) on each. When nereidsPrunedTabletIds contains tablets across many partitions, every per-partition iteration walks the entire global set and does a getTablet hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (tabletIdsInOrder, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the sampleTabletIds path and the empty-set fallback are untouched. Issue Number: close#63854 Related PR: #53403 Problem Summary: Plan time of OlapScan queries with many partitions and many globally pruned tablets degrades quadratically due to redundant per-partition iterations over the global pruned tablet set in OlapScanNode.distributionPrune. Restore per-partition complexity by filtering the global set down to the current partition's tablets before returning. Co-authored-by: zhousimin <zhousimin@kuaishou.com>
github-actionsBot
pushed a commit
that referenced
this pull request
Jun 2, 2026
…tributionPrune (#63851) ### What problem does this PR solve? #53403 short-circuited distributionPrune to return the entire nereidsPrunedTabletIds set when running under Nereids. However, the caller computeTabletInfo invokes distributionPrune inside a per-partition loop and then iterates the returned ids, calling MaterializedIndex.getTablet(id) on each. When nereidsPrunedTabletIds contains tablets across many partitions, every per-partition iteration walks the entire global set and does a getTablet hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (tabletIdsInOrder, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the sampleTabletIds path and the empty-set fallback are untouched. Issue Number: close#63854 Related PR: #53403 Problem Summary: Plan time of OlapScan queries with many partitions and many globally pruned tablets degrades quadratically due to redundant per-partition iterations over the global pruned tablet set in OlapScanNode.distributionPrune. Restore per-partition complexity by filtering the global set down to the current partition's tablets before returning. Co-authored-by: zhousimin <zhousimin@kuaishou.com>
zhaorongsheng pushed a commit
to zhaorongsheng/doris
that referenced
this pull request
Jun 4, 2026
…tributionPrune (apache#63851) ### What problem does this PR solve? apache#53403 short-circuited distributionPrune to return the entire nereidsPrunedTabletIds set when running under Nereids. However, the caller computeTabletInfo invokes distributionPrune inside a per-partition loop and then iterates the returned ids, calling MaterializedIndex.getTablet(id) on each. When nereidsPrunedTabletIds contains tablets across many partitions, every per-partition iteration walks the entire global set and does a getTablet hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (tabletIdsInOrder, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the sampleTabletIds path and the empty-set fallback are untouched. Issue Number: closeapache#63854 Related PR: apache#53403 Problem Summary: Plan time of OlapScan queries with many partitions and many globally pruned tablets degrades quadratically due to redundant per-partition iterations over the global pruned tablet set in OlapScanNode.distributionPrune. Restore per-partition complexity by filtering the global set down to the current partition's tablets before returning. Co-authored-by: zhousimin <zhousimin@kuaishou.com>
morrySnow pushed a commit
that referenced
this pull request
Aug 31, 2026
…tributionPrune (#63851) ### What problem does this PR solve? #53403 short-circuited distributionPrune to return the entire nereidsPrunedTabletIds set when running under Nereids. However, the caller computeTabletInfo invokes distributionPrune inside a per-partition loop and then iterates the returned ids, calling MaterializedIndex.getTablet(id) on each. When nereidsPrunedTabletIds contains tablets across many partitions, every per-partition iteration walks the entire global set and does a getTablet hash lookup on ids that belong to other partitions (which are then filtered out by the null check), yielding O(partitionNum * globalPrunedSize) lookups. The short-circuit also copies the full HashSet into a new ArrayList once per partition. Filter the global set down to the current partition's tablet ids (tabletIdsInOrder, already prepared by the caller) before returning. The result is identical to what the caller's null-check would have produced, so behavior is unchanged; only the redundant lookups and copies are eliminated. The non-Nereids path, the sampleTabletIds path and the empty-set fallback are untouched. Issue Number: close#63854 Related PR: #53403 Problem Summary: Plan time of OlapScan queries with many partitions and many globally pruned tablets degrades quadratically due to redundant per-partition iterations over the global pruned tablet set in OlapScanNode.distributionPrune. Restore per-partition complexity by filtering the global set down to the current partition's tablets before returning. Co-authored-by: zhousimin <zhousimin@kuaishou.com>
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What problem does this PR solve?
fix prune tablets twice
first in the PruneOlapScanTablet, second in the OlapTableNode.computeTabletInfo.
we should skip prune tablets in OlapTableNode
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)