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

planner: skip all system tables when collecting prediction columns #53443

Merged
merged 3 commits into from
May 23, 2024

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented May 21, 2024

What problem does this PR solve?

Issue Number: close #53403

Problem Summary:

What changed and how does it work?

We shouldn't collect stats usage for system tables. So in this PR, we do a check before we add them to the column map.

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.

When collecting usage statistics for tables, do not include system tables
在统计表的使用情况时,不包括系统表的信息。

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/planner SIG: Planner labels May 21, 2024
@Rustin170506 Rustin170506 changed the title planner: skip all system tables planner: skip all system tables when collecting prediction columns May 21, 2024
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

🔢 Self-check (PR reviewed by myself and ready for feedback.)

@@ -120,6 +120,36 @@ func MockInfoSchema(tbList []*model.TableInfo) InfoSchema {
bucketIdx := tableBucketIdx(tb.ID)
result.sortedTablesBuckets[bucketIdx] = append(result.sortedTablesBuckets[bucketIdx], tbl)
}
// Add a system table.
tables := []*model.TableInfo{
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should find a better way to add a system table. But right now, we only need one system table. So I guess this way is OK. But if you have any suggestions please feel free to comment.

@Rustin170506
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 21, 2024
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.7824%. Comparing base (68219b9) to head (95925cc).
Report is 24 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53443        +/-   ##
================================================
+ Coverage   72.5268%   74.7824%   +2.2556%     
================================================
  Files          1505       1505                
  Lines        429830     431775      +1945     
================================================
+ Hits         311742     322892     +11150     
+ Misses        98799      88976      -9823     
- Partials      19289      19907       +618     
Flag Coverage Δ
integration 49.2193% <87.8787%> (?)
unit 71.4753% <100.0000%> (+0.0563%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.4334% <ø> (+9.0294%) ⬆️

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 21, 2024
Copy link

ti-chi-bot bot commented May 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-21 09:55:23.96579537 +0000 UTC m=+2165477.722930946: ☑️ agreed by hawkingrei.
  • 2024-05-21 11:47:57.111986229 +0000 UTC m=+2172230.869121802: ☑️ agreed by winoros.

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented May 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, time-and-fate, winoros, zimulala

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 the approved label May 23, 2024
@Rustin170506
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit d6308af into pingcap:master May 23, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm 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.

Skip system table when collecting prediction columns
5 participants