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: support tracking column cmsketch #35135

Merged
merged 29 commits into from
Jun 17, 2022

Conversation

Yisaer
Copy link
Contributor

@Yisaer Yisaer commented Jun 2, 2022

Signed-off-by: yisaer [email protected]

What problem does this PR solve?

Issue Number: ref #34052

Problem Summary:

What is changed and how it works?

  1. support tracking column cmsketch memory in statsCache

Check List

Tests

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

statscache test report

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 2, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • chrysan
  • xuyifangreeneyes

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-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 2, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jun 2, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@Yisaer Yisaer changed the title support tracking column cmsketch statistics: support tracking column cmsketch Jun 2, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 2, 2022

/run-check_title

Signed-off-by: yisaer <[email protected]>
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 6, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jun 6, 2022

@Yisaer Yisaer closed this Jun 6, 2022
@Yisaer Yisaer reopened this Jun 6, 2022
Signed-off-by: yisaer <[email protected]>

make loaded atomic

Signed-off-by: yisaer <[email protected]>
Signed-off-by: yisaer <[email protected]>
Signed-off-by: yisaer <[email protected]>

add size metrics

Signed-off-by: yisaer <[email protected]>

Revert "add size metrics"

This reverts commit 05b06a3f4f3ad98ae3f6ca389db2fc8ccc193dc4.
@Yisaer Yisaer marked this pull request as ready for review June 9, 2022 05:18
@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 Jun 9, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 13, 2022

/run-unit-test

func (c *Column) DropEvicted() {
if c.StatsVer < Version2 {
c.CMSketch = nil
c.Loaded = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "Loaded means if the histogram, the topn and the cm sketch are loaded fully". Before the pr, we assume either all three are loaded or none of the three are loaded. Now we break the assumption. It may bring some problems. For example, (*Column).IsLoaded returns c.Loaded || c.notNullCount() > 0. It seems that we assume c.Loaded is always equal to c.notNullCount() > 0 and will remove c.notNullCount() > 0 in the future. Now if the cm sketch is evicted in ver1 case, c.Loaded is false while c.notNullCount() > 0 is true. cc @time-and-fate

Copy link
Contributor Author

@Yisaer Yisaer Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will revise loaded in next pr

Copy link
Member

@time-and-fate time-and-fate Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xuyifangreeneyes is correct.
There're mainly two usages of IsLoaded:

  1. help to check if we can use the non-pseudo estimation logic for this Column.
  2. help to check if stats in this Column needs loading.

And of course, they should be essentially the same thing before this PR.
It seems that they become different in this PR, so we may need to introduce a new field or change IsLoaded to represent more states to handle this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the revised loaded updated in #35361

Signed-off-by: yisaer <[email protected]>
@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 17, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 532e2df

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 17, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/run-unit-test

@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/run-build

@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/run-mysql-test

1 similar comment
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/run-mysql-test

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jun 17, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 1b8a804

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 17, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/run-all-tests

@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/run-unit-test

Signed-off-by: yisaer <[email protected]>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jun 17, 2022
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 17, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: ff4158d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 17, 2022
@ti-chi-bot ti-chi-bot merged commit 9652651 into pingcap:master Jun 17, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jun 17, 2022

TiDB MergeCI notify

✅ Well Done! New fixed [2] after this pr merged.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-common-test ✅ all 11 tests passed 25 min Fixed
idc-jenkins-ci/integration-cdc-test ✅ all 34 tests passed 24 min Fixed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 13 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 13 min Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 9 min 16 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 8 min 56 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 8 min 54 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 48 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 47 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants