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: BinarySearchRemoveVal should use decoded val instead of encoded #59131

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

winoros
Copy link
Member

@winoros winoros commented Jan 22, 2025

What problem does this PR solve?

Issue Number: close #59130

Problem Summary:

What changed and how does it work?

The function used the wrong val as its parameter.
As a result, when the column is not string type. The function BinaryRemoveVal actually removes nothing.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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

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

修复合并全局统计信息时,直方图构造结果可能变大的问题
Fix the issue that the global histogram might be larger than expected when merging partition table's global statistics.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 22, 2025
Encoded: b,
Count: 2,
}
data1.RemoveVals([]TopNMeta{tmp})
Copy link
Member Author

Choose a reason for hiding this comment

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

The RemoveVals is actually the wrong one.
But, now that it is only used in stats v1.
I decide not to change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

decide to remove it?

@winoros winoros added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.8625%. Comparing base (837b1f5) to head (728689e).
Report is 12 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59131        +/-   ##
================================================
+ Coverage   73.0925%   73.8625%   +0.7700%     
================================================
  Files          1684       1714        +30     
  Lines        466350     476320      +9970     
================================================
+ Hits         340867     351822     +10955     
+ Misses       104548     102858      -1690     
- Partials      20935      21640       +705     
Flag Coverage Δ
integration 45.8695% <66.6666%> (?)
unit 72.4376% <77.7777%> (+0.1514%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 45.3462% <ø> (+0.0258%) ⬆️

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 22, 2025
Copy link

ti-chi-bot bot commented Jan 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, hawkingrei

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 23, 2025
Copy link

ti-chi-bot bot commented Jan 23, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-22 13:04:28.694274574 +0000 UTC m=+272396.025193978: ☑️ agreed by hawkingrei.
  • 2025-01-23 02:23:31.766759302 +0000 UTC m=+320339.097678707: ☑️ agreed by AilinKid.

@winoros
Copy link
Member Author

winoros commented Jan 23, 2025

/retest

1 similar comment
@winoros
Copy link
Member Author

winoros commented Jan 23, 2025

/retest

@ti-chi-bot ti-chi-bot bot merged commit 41c3b01 into pingcap:master Jan 23, 2025
25 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #59161.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 23, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong stats of TestIssues24349
4 participants