Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

information-schema: add the description about hot region statistical cycle #16395

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ DESC tidb_hot_regions_history;
* KEY_RATE:该 Region 内读写的 Key 数量。
* QUERY_RATE:该 Region 内读写的 Query 数量。

对于读热点,`FLOW_BYTES`、`KEY_RATE` 和 `QUERY_RATE` 字段的统计周期均为一个 Store 心跳周期,由 TiKV 的配置 [`pd-store-heartbeat-tick-interval`](/tikv-configuration-file.md#pd-store-heartbeat-tick-interval) 控制;对于写热点,除了 `QUERY_RATE` 字段的统计周期仍为一个 Store 心跳周期,`FLOW_BYTES` 和 `KEY_RATE` 字段均为一个 Region 心跳周期,由 TiKV 的配置 [`pd-heartbeat-tick-interval`](/tikv-configuration-file.md#pd-heartbeat-tick-interval) 控制。
JmPotato marked this conversation as resolved.
Show resolved Hide resolved

> **注意:**
>
> `TIDB_HOT_REGIONS_HISTORY` 表的 `UPDATE_TIME`、`REGION_ID`、`STORE_ID`、`PEER_ID`、`IS_LEARNER`、`IS_LEADER`、`TYPE` 字段会下推到 PD 服务器执行。所以为了降低使用该表的开销,必须指定搜索时间范围,然后尽可能地指定更多的条件。例如 `select * from tidb_hot_regions_history where store_id = 11 and update_time > '2020-05-18 20:40:00' and update_time < '2020-05-18 21:40:00' and type='write'`。
Expand Down
2 changes: 2 additions & 0 deletions information-schema/information-schema-tidb-hot-regions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ DESC tidb_hot_regions;
* MAX_HOT_DEGREE:该 Region 的最大热度。
* REGION_COUNT:所在实例的热点 Region 数量。
* FLOW_BYTES:该 Region 内读写的字节数量。

对于读热点,`FLOW_BYTES` 字段的统计周期为一个 Store 心跳周期,由 TiKV 的配置 [`pd-store-heartbeat-tick-interval`](/tikv-configuration-file.md#pd-store-heartbeat-tick-interval) 控制;对于写热点,`FLOW_BYTES` 字段则为一个 Region 心跳周期,由 TiKV 的配置 [`pd-heartbeat-tick-interval`](/tikv-configuration-file.md#pd-heartbeat-tick-interval) 控制。
JmPotato marked this conversation as resolved.
Show resolved Hide resolved
Loading