# System Reads And Writes Hotspots

+ Statistics current reads and writes hotlist:
```
SELECT db_name,
       TABLE_NAME,
       index_name,
       TYPE, 
       sum(FLOW_BYTES), 
       count(1),
       group_concat(h.REGION_ID),
       count(DISTINCT p.store_id),
       group_concat(p.store_id)
FROM TIDB_HOT_REGIONS h
JOIN TIKV_REGION_PEERS p ON h.region_id = p.region_id
AND p.IS_LEADER=1
GROUP BY db_name,
         TABLE_NAME,
         Index_name,
         TYPE;
```
------------------------------------------------------------
System reads and writes hot queries
The TIDB_HOT_REGIONS system table provides statistical information about which regions have been visited the most.
By viewing TIDB_HOT_REGIONS, combined with TIKV_REGION_PEERS, you can clearly locate which TiKV servers the hotspots are specifically affecting.
Statistics current reads and writes hot table
```
SELECT db_name,
       TABLE_NAME,
       index_name,
       TYPE, -- 读写热点分类
       sum(FLOW_BYTES), -- 每分钟流量
       count(1),
       group_concat(REGION_ID),
       count(DISTINCT p.store_id),
       group_concat(p.store_id)
FROM TIDB_HOT_REGIONS h
JOIN tikv_region_peers p ON h.region_id = p.region_id
AND p.IS_LEADER=1
GROUP BY db_name,
         TABLE_NAME,
         Index_name,
         TYPE;
```
