Storage: Fix DataTypePtr is not shared as expected (#9939)#9952
Conversation
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JaySon-Huang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
@ti-chi-bot: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions 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 ti-community-infra/tichi repository. |
…ngcap#9952) close pingcap#9947 Storage: Fix DataTypePtr is not shared as expected * Introduce a class `DataTypePtrCache` and manage the shared cache of `DataTypePtr` instances. * Introduce `DataTypeFactory::getOrSet(const ASTPtr & ast)` and try to find the cache with data type name as "ast->range.first, ast->range.second" logging: Turn the logging level of "updateTableColumnInfo" into debug because that could cause lots of logging when restarting tiflash Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
This is an automated cherry-pick of #9939
What problem does this PR solve?
Issue Number: close #9947
Problem Summary:
There are about 13,000 tables with 60 enum column in each table, turning into 780,000 DataTypeEnum instances. They takes about 4GB memory.
What is changed and how it works?
before_share_enum.svg.zip
after_share_enum.svg.zip
Check List
Tests
Side effects
Documentation
Release note