Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb 历史慢日志会被读取嘛
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?
It is recommended to enable the location function, which can help you identify slow queries, making it easier to resolve them.
Take a look at the time consumed by this process and compare it with your file splitting time.
Not sure if some system tables for slow logs are occupying this file.
The parameters can be adjusted to fit your required scenario, allowing you to filter out certain system information.
The session-level parameter tidb_slow_query_file
can control which file to read and parse when querying INFORMATION_SCHEMA.SLOW_QUERY
.
Historical slow logs will be used.
This is also the reason why we can see slow queries from previous time periods on the dashboard.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.