refactor(storage): scale clustering information diagnostics - #20411
Draft
zhyass wants to merge 2 commits into
Draft
refactor(storage): scale clustering information diagnostics#20411zhyass wants to merge 2 commits into
zhyass wants to merge 2 commits into
Conversation
Contributor
Docker Image for PR
|
zhyass
marked this pull request as draft
August 30, 2026 17:14
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 free
to 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.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
This PR makes
CLUSTERING_INFORMATIONdiagnostics scale to multi-million-block tables while preserving exact closed-interval overlap and depth semantics.CLUSTERING_STATISTICSfocused on per-block depth and remove overlap work that onlyCLUSTERING_INFORMATIONneeds.Performance comparison
Release-mode synthetic A/B benchmarks used identical generated endpoint data and validated identical checksums/results. Times are medians; lower is better. The temporary benchmark instrumentation was removed from this PR.
Linear diagnostics:
root/mainvs this PRHilbert adaptive partitioning: previous implementation vs this PR
5,383,590 rectangles, 8 workers, 3 rounds:
A separate production-scale Linear sorting A/B over 5,383,590 blocks (10,767,180 endpoints, 8 workers, 7 rounds) reduced total diagnostics time from 2,631.641 ms to 2,066.595 ms (1.27x); endpoint sorting improved from 1,487.677 ms to 931.937 ms (1.60x), while encoding and sweep time remained effectively unchanged.
Implementation notes
[min, max]layout; unstable sorting is safe because ties are grouped by encoded value.Tests
Validation performed:
cargo test -p databend-common-storages-fuse --lib(129 passed)cargo clippy -p databend-common-storages-fuse --lib --tests -- -D warningscargo test -p databend-common-storages-fuse statistics::endpoint_sort::tests --release --libcargo test -p databend-common-storages-fuse statistics::hilbert::tests --release --libcargo test -p databend-common-storages-fuse table_functions::clustering_information::tests --release --libcargo check -p databend-common-storages-fuse --libgit diff --checkFocused coverage includes independent randomized differential checks for Linear and Hilbert diagnostics, closed-boundary semantics, malformed ranges, radix ordering, request-local worker limits, and the adaptive large-input Hilbert path.
Type of change
AI assistance
This change is