Will historical slow logs in TiDB be read?

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

Original topic: tidb 历史慢日志会被读取嘛

| username: Raymond

Today, I found a historical slow log in TiDB (which has already been segmented). Using the fuser command, I discovered that the TiDB server process is accessing this historical slow log for reading. However, the dashboard is not open. In what situations would the historical slow log still be read?

| username: xfworld | Original post link

It is recommended to enable the location function, which can help you identify slow queries, making it easier to resolve them.

| username: HACK | Original post link

Take a look at the time consumed by this process and compare it with your file splitting time.

| username: Raymond | Original post link

Not sure if some system tables for slow logs are occupying this file.

| username: xfworld | Original post link

The parameters can be adjusted to fit your required scenario, allowing you to filter out certain system information.

| username: 啦啦啦啦啦 | Original post link

The session-level parameter tidb_slow_query_file can control which file to read and parse when querying INFORMATION_SCHEMA.SLOW_QUERY.

| username: ablewang_xiaobo | Original post link

Historical slow logs will be used.

| username: ablewang_xiaobo | Original post link

This is also the reason why we can see slow queries from previous time periods on the dashboard.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.