store/helper: fill data in the information.tidb_hot_table for partitioned table (#14331) #16726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cherry-pick #14331 to release-3.0
What problem does this PR solve?
INFORMATION.TIDB_HOT_TABLE
should take the partitioned table into consideration.What is changed and how it works?
A partitioned table is not handled properly in tidb_hot_table.
After this change, we can get the correct information:
Note, 151 and 150 are both belong to sbtest3, and the table name column is displayed as
sbtest3(p1)
andsbtest3(p0)
to indicate they are partitions.Check List
Tests
Mock the data is hard, the old code is not really unit tested.
I use a real tikv cluster and check the result.
B.T.W, a bug is fixed, pd returns something like this:
From the PD result we can see
flow_bytes
is a float, not uint. @disksing @nolouchRelated changes
Release note