Skip to content

proto: add NDV rate to analyze request#410

Merged
0xPoe merged 1 commit into
pingcap:masterfrom
0xPoe:issue-67449-ndv-rate
May 15, 2026
Merged

proto: add NDV rate to analyze request#410
0xPoe merged 1 commit into
pingcap:masterfrom
0xPoe:issue-67449-ndv-rate

Conversation

@0xPoe
Copy link
Copy Markdown
Member

@0xPoe 0xPoe commented May 11, 2026

Ref pingcap/tidb#67449

What changed

  • Add optional AnalyzeColumnsReq.ndv_rate for NDV sampling rate.
  • Regenerate Go bindings for the new field.
  • Update protolock metadata.

Tests

make check

0xPoe added a commit to 0xPoe/tikv that referenced this pull request May 14, 2026
…tches

Add row-level Bernoulli sampling to the table scan executor so ANALYZE can build distinct-value sketches from a subset of rows. The sampling rate is taken from the new AnalyzeColumnsReq.ndv_rate field (pingcap/tipb#410); when it is unset, the scanner keeps every row.

Build an F1 (singleton) sketch alongside the FM sketch and report it with sketch_sample_count in the row collector. Null counts and total sizes are rescaled from the sampled rows back to the full row count.

Signed-off-by: 0xPoe <techregister@pm.me>
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 15, 2026

Thanks for your review! 💚 💙 💜 💛 ❤️

@0xPoe 0xPoe merged commit a4d204a into pingcap:master May 15, 2026
4 checks passed
@0xPoe 0xPoe deleted the issue-67449-ndv-rate branch May 15, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants