Skip to content
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

statistics: introduce sampling by rate #27359

Closed
wants to merge 3 commits into from

Conversation

winoros
Copy link
Member

@winoros winoros commented Aug 18, 2021

What problem does this PR solve?

Issue Number: close #27187, close #26547, for #27357

Problem Summary:

Introduce the sampling by rate by implementing the traditional bernoulli sampling tech.

What is changed and how it works?

Proposal: To be added

What's Changed:

Modify the parser in pingcap/parser#1314 to support the new analyze option.
Modify the tipb in pingcap/tipb#236 to support passing sampling rate to tikv.

We implement the Bernoulli sampling in a very simple way

for each element:
	if the rng > sample_rate:
		continue
	add the current row into the samples.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Support collecting samples by sampling rate for ANALYZE OPTION

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 18, 2021
@winoros
Copy link
Member Author

winoros commented Aug 18, 2021

Note that this pr would be split into small ones for review.
This pr contains all changes when we're doing experiments.

@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 12, 2021
@ti-chi-bot
Copy link
Member

@winoros: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 17, 2021
@winoros winoros closed this Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/execution SIG execution size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
2 participants