Is there an SQL query to view all Region hotspots and sort them in descending order?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 有没有SQL可以查看所有Region的热点问题并降序排序

| username: 数据源的TiDB学习之路

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] Is there an SQL query to view all Region hotspot issues and sort them in descending order?
[Encountered Issues: Problem Phenomenon and Impact]
[Resource Configuration]*
[Attachments: Screenshots / Logs / Monitoring]

| username: TiDBer_21wZg5fm | Original post link

TiEM has hotspot monitoring.

| username: TiDBer_jYQINSnf | Original post link

In the information_schema, there is a table called TIDB_HOT_REGIONS which records hot regions.

| username: tidb菜鸟一只 | Original post link

You can also check the dashboard.

| username: zhaokede | Original post link


| username: zhanggame1 | Original post link

The dashboard is very convenient to use.

| username: 数据源的TiDB学习之路 | Original post link

Are you referring to the traffic visualization interface?

| username: DBAER | Original post link

Look at these two
Or the dashboard is also fine

| username: 有猫万事足 | Original post link

I strongly recommend using traffic visualization to observe hotspot situations.

This is because hotspot distribution includes both time and space dimensions. Using SQL or other charts mostly shows spatial heat at a single time slice, without including temporal heat.
Perhaps this hotspot is only slightly hot in space and not continuously hot over time, so there is no need to invest resources to solve it.

Only hotspots that are hot in both time and space need to be addressed.

| username: TiDBer_aKu9dgpb | Original post link

You can find it in the system table, and the dashboard also has hotspot monitoring.

| username: zhanggame1 | Original post link

Yes, if you want to see more details, you can use the mouse to select the hotspot section and keep looking until you see the specific region.

| username: virvle | Original post link

Dashboard Hotspot Monitoring

| username: wangkk2024 | Original post link

Impressive :+1:t2::+1:t2::+1:t2::+1:t2:

| username: dba远航 | Original post link

There is a table TIDB_HOT_REGIONS in the information_schema.

| username: TiDBer_JUi6UvZm | Original post link

I am currently looking at the dashboard.

| username: tidb狂热爱好者 | Original post link

The issue with region hotspots is actually not serious. You can see it on the heatmap.

| username: 数据库真NB | Original post link

SQL should not be used. When designing the database, it is not appropriate for the front-end application to directly query the back-end database management work. Additionally, you can check out TiDB’s monitoring tools or heatmaps.

| username: mono | Original post link

Don’t panic when things heat up. As long as the IO can handle it and the cluster runs smoothly overall, there’s no problem.

| username: QH琉璃 | Original post link


| username: stephanie | Original post link

You can check it in the heatmap. The following document might be helpful:
TiDB High Concurrency Write Scenario Best Practices | PingCAP Documentation Center