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

information: Fix issue of query information_schema.columns cost too much memory when there are lots of tables in TiDB #18362

Merged
merged 12 commits into from
Jul 8, 2020

Conversation

crazycs520
Copy link
Contributor

What problem does this PR solve?

Fix issue of query information_schema.columns cost too many memory when there are lots of tables in TiDB.

What is changed and how it works?

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • PR to update pingcap/tidb-ansible:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • No

Release note

  • Fix issue of query information_schema.columns cost too many memory when there are lots of tables in TiDB.

Signed-off-by: crazycs <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520 crazycs520 added type/enhancement The issue or PR belongs to an enhancement. component/infoschema labels Jul 3, 2020
@crazycs520 crazycs520 requested a review from a team as a code owner July 3, 2020 13:31
@crazycs520 crazycs520 requested review from SunRunAway and removed request for a team July 3, 2020 13:31
@crazycs520
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Jul 3, 2020

Codecov Report

Merging #18362 into master will increase coverage by 0.1487%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #18362        +/-   ##
================================================
+ Coverage   79.4194%   79.5681%   +0.1487%     
================================================
  Files           540        540                
  Lines        144748     145621       +873     
================================================
+ Hits         114958     115868       +910     
+ Misses        20504      20491        -13     
+ Partials       9286       9262        -24     

@github-actions github-actions bot added the sig/execution SIG execution label Jul 3, 2020
@crazycs520
Copy link
Contributor Author

/run-integration-copr-test

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

Please update the PR description. What is changed and how it works?

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 6, 2020
ti-srebot
ti-srebot previously approved these changes Jul 6, 2020
Copy link
Contributor

@ti-srebot ti-srebot left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot
Copy link
Contributor

@wjhuang2016,Thanks for your review.

Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

Does the major memory consumption exist in memtableRetriever.rows? What about is.AllSchemas()? Is there any benchmark to show the problem is eased?

executor/infoschema_reader.go Outdated Show resolved Hide resolved
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 7, 2020
ti-srebot
ti-srebot previously approved these changes Jul 7, 2020
@ti-srebot
Copy link
Contributor

@djshow832,Thanks for your review.

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/rebuild

@crazycs520
Copy link
Contributor Author

/run-unit-test

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 8, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@crazycs520 merge failed.

@crazycs520
Copy link
Contributor Author

/run-unit-test

@crazycs520 crazycs520 merged commit ff94f2b into pingcap:master Jul 8, 2020
@crazycs520
Copy link
Contributor Author

/run-cherry-picker

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #18436

SunRunAway pushed a commit that referenced this pull request Jul 15, 2020
… much memory when there are lots of tables in TiDB (#18362) (#18503) (#18436)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/infoschema sig/execution SIG execution 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.

5 participants