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

infoschema_v2: replace SchemaTableInfos in fetchShowStatsExtended #55687

Conversation

fzzf678
Copy link
Contributor

@fzzf678 fzzf678 commented Aug 27, 2024

What problem does this PR solve?

Issue Number: ref #55394

Problem Summary:

What changed and how does it work?

In fetchShowStatsExtended , we traverse all dbs to find tables with partition and pass them to appendTableForStatsExtended. Now, the process of traversal can be replace by ListTablesWithSpecialAttribute.

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.
    Just replace old loop logical with semantically equivalent function, use the exists cases check result is enough.

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.

Use `ListTablesWithSpecialAttribute` to get tables which has partition.

@ti-chi-bot ti-chi-bot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 27, 2024
Copy link

ti-chi-bot bot commented Aug 27, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign winkyao for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 27, 2024
Copy link

tiprow bot commented Aug 27, 2024

Hi @fzzf678. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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-sigs/prow repository.

@fzzf678
Copy link
Contributor Author

fzzf678 commented Aug 27, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Aug 27, 2024
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.7859%. Comparing base (290dc46) to head (add99ba).
Report is 74 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55687        +/-   ##
================================================
+ Coverage   72.9295%   74.7859%   +1.8563%     
================================================
  Files          1581       1582         +1     
  Lines        442365     442666       +301     
================================================
+ Hits         322615     331052      +8437     
+ Misses        99938      91341      -8597     
- Partials      19812      20273       +461     
Flag Coverage Δ
integration 49.1101% <0.0000%> (?)
unit 71.8664% <64.7058%> (-0.1337%) ⬇️

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

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 52.1593% <ø> (+6.7045%) ⬆️

@fzzf678
Copy link
Contributor Author

fzzf678 commented Aug 27, 2024

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 27, 2024
for _, tblInfo := range tables {
pi := tblInfo.GetPartitionInfo()
// Extended statistics for partitioned table is not supported now.
if pi != nil {
Copy link
Contributor Author

@fzzf678 fzzf678 Aug 27, 2024

Choose a reason for hiding this comment

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

Exclude partition table after get all table infos

}

for _, db := range is.AllSchemaNames() {
simpleTblInfos, err := is.SchemaSimpleTableInfos(ctx, db)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Get simple table infos,then exclude partition tables,and then get tableInfo one by one

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 6, 2024
Copy link

ti-chi-bot bot commented Sep 6, 2024

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-sigs/prow repository.

@fzzf678 fzzf678 closed this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant