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

*: introduce snapshot into analyze #24575

Merged
merged 1 commit into from
Jun 25, 2021
Merged

Conversation

eurekaka
Copy link
Contributor

@eurekaka eurekaka commented May 12, 2021

What problem does this PR solve?

First PR to fix #23453

Problem Summary:

modify_count is not as expected.

What is changed and how it works?

Proposal: RFC for a More Accurate ModifyCount

What's Changed:

  • add a column snapshot into mysql.stats_meta
  • use a snapshot to scan the table for analyze
  • introduce AnalyzeResults to wrap AnalyzeResult of a same table
  • combine dumping of histograms for a task(i.e, histograms of a table in version 2 analyze) into a single transaction, and only update mysql.stats_meta once in the analyze
  • check if newer version of stats already exists before dumping current snapshot analyze results

How it Works:

  • snapshot check when dumping analyze results would be used in later PRs to solve concurrent analyze problems

Related changes

N/A

Check List

Tests

  • Unit test

Side effects

N/A

Release note

  • Introduce snapshot into analyze

@eurekaka eurekaka added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner component/statistics component/executor labels May 12, 2021
@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 12, 2021
@github-actions github-actions bot added sig/execution SIG execution sig/sql-infra SIG: SQL Infra labels May 12, 2021
@eurekaka eurekaka force-pushed the snapshot branch 3 times, most recently from 23fdfec to 544a0a8 Compare May 12, 2021 11:41
@eurekaka
Copy link
Contributor Author

/run-check_dev_2

@eurekaka eurekaka marked this pull request as ready for review May 13, 2021 10:47
@eurekaka eurekaka requested review from a team as code owners May 13, 2021 10:47
@eurekaka eurekaka requested review from qw4990 and removed request for a team May 13, 2021 10:47
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2021
@eurekaka eurekaka force-pushed the snapshot branch 2 times, most recently from 1bed6d2 to 9b4a63d Compare May 27, 2021 07:54
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 1, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 1, 2021
@eurekaka
Copy link
Contributor Author

eurekaka commented Jun 1, 2021

/run-check_dev_2

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2021
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 12, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2021
session/bootstrap.go Outdated Show resolved Hide resolved
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • time-and-fate
  • winoros

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 25, 2021
@eurekaka
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: cad0bc6

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 25, 2021
@ti-chi-bot ti-chi-bot merged commit 149e86a into pingcap:master Jun 25, 2021
@eurekaka eurekaka deleted the snapshot branch June 25, 2021 07:18
jiajunhuang pushed a commit to jiajunhuang/tidb that referenced this pull request Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor component/statistics sig/execution SIG execution sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not very resonable behavior of the modify_count in show stats_meta.
4 participants