You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tipb: backport NDV rate and sampled NDV summaries to release-8.5 (#410, #430) - #438
How it Works: Each cherry-pick is one commit. Fields 6 and 7 (from #407) never existed on release-8.5; they are reserved so that the field numbers stay the same as on master. scripts/proto.lock is updated for the analyze changes only, and go-tipb/analyze.pb.go is regenerated.
Related changes
PR to update pingcap/docs/pingcap/docs-cn:
Need to cherry-pick to the release branch
Summary by CodeRabbit
New Features
Added optional configuration for controlling row retention during distinct-value estimation, with validation against the existing sample rate.
Added support for recording hashes observed multiple times and tracking the number of rows used for distinct-value estimation.
Review was skipped as selected files did not have any reviewable changes.
Files ignored due to path filters: 2
go-tipb/analyze.pb.go is excluded by !**/*.pb.go
scripts/proto.lock is excluded by !**/*.lock
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 17819787-5da2-4b4f-8cd9-60c182c35ed0
Commits
Reviewing files that changed from the base of the PR and between 3af26b3 and e754349.
Files ignored due to path filters: 2
go-tipb/analyze.pb.go is excluded by !**/*.pb.go
scripts/proto.lock is excluded by !**/*.lock
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The analyze protocol adds an optional NDV sampling rate, repeated-hash storage for FMSketch, and an NDV sample count for RowSampleCollector. It also reserves two RowSampleCollector field numbers and documents sampling and count behavior.
Changes: NDV sampling protocol
Layer / File(s)
Summary
NDV sampling data contract proto/analyze.proto
AnalyzeColumnsReq adds ndv_rate and its sampling rules. FMSketch adds multi_hashset for repeated hashes. RowSampleCollector reserves fields 6 and 7 and adds ndv_sample_count, with comments defining count and scaling behavior.
The change adds NDV sampling fields; no merge-blocking risk is established.
Pre-merge checks: 4
Check name
Status
Explanation
Description check
The description follows the repository template. It fills in the problem summary, the cherry-pick scope, the list of changes (#410 and #430), and how the changes work, including the reserved fields an…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title names the backport of two changes (#410 and #430) to release-8.5 in the tipb protocol: an NDV rate field on AnalyzeColumnsReq and sampled NDV summaries in RowSampleCollector and FMSketch. Th…
Full details: Description check
Explanation
The description follows the repository template. It fills in the problem summary, the cherry-pick scope, the list of changes (#410 and #430), and how the changes work, including the reserved fields and the proto.lock and generated Go file updates. The 'Issue Number' line references issue #67449 with 'ref' rather than 'close', which is acceptable for a cherry-pick. The 'Proposal' line is omitted, which is allowed because it is marked not applicable. The 'Related changes' section keeps its template placeholders, with the docs PR line left blank and no checkbox state for the release branch note. These are minor gaps, so the description is mostly complete.
Full details: Title check
Explanation
The title names the backport of two changes (#410 and #430) to release-8.5 in the tipb protocol: an NDV rate field on AnalyzeColumnsReq and sampled NDV summaries in RowSampleCollector and FMSketch. The raw summary confirms these additions to proto/analyze.proto, and the objectives describe the same cherry-pick, so the title matches the main change. It is specific and descriptive, though it uses terms like 'backport' and PR numbers that a reader outside the team may need to look up.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit reads the fields with care New sampling rates are written there Hashes twice now find a home Counts describe the sampled roam Then hops away through protobuf air
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 6099a382-2b84-452f-b8ad-a005f166fe49
Commits
Reviewing files that changed from the base of the PR and between 5817d66 and 3af26b3.
Files ignored due to path filters: 2
go-tipb/analyze.pb.go is excluded by !**/*.pb.go
scripts/proto.lock is excluded by !**/*.lock
Files selected for processing: 1
proto/analyze.proto
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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?
Issue Number: ref pingcap/tidb#67449
Problem Summary: Cherry-pick #410 and #430 to
release-8.5, so that TiKVrelease-8.5can sample rows for NDV in full-sampling Analyze.What is changed and how it works?
What's Changed:
AnalyzeColumnsReq.ndv_rate.RowSampleCollector.ndv_sample_countandFMSketch.multi_hashset, and reserveRowSampleCollectorfields 6 and 7.How it Works: Each cherry-pick is one commit. Fields 6 and 7 (from #407) never existed on
release-8.5; they are reserved so that the field numbers stay the same as on master.scripts/proto.lockis updated for the analyze changes only, andgo-tipb/analyze.pb.gois regenerated.Related changes
pingcap/docs/pingcap/docs-cn:Summary by CodeRabbit