-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
ref #25281
Background
TiDB has a memory table TIDB_HOT_REGIONS
that provides information about hotspot regions. But it only shows the current hotspot information. This leads to the fact that when DBAs want to query historical hotspot details, they have no way to find the corresponding hotspot information.
According to the documentation for the current TIDB_HOT_REGIONS
table, it can only provides information about recent hotspot regions calculated by PD according to the heartbeat from tikv. It is inconvenient to obtain hotspot regions of past time, and locate which store the region is. For ease of use, we can store extened hotspot region infomation in PD. The DBA can query hotspot regions within a specified period by such statement in TiDB:
SElECT * FROM information_schema.tidb_hot_regions_history WHERE update_time>='2019-04-01 00:00:00' and update_time<='2019-04-01 00:01:00';
Details
Create a new table TIDB_HOT_REGIONS_HISTORY
in the INFORMATION_SCHEMAT
schema to retrieve history hotspot regions stored by PD periodically.