Questions about the log.expensive-threshold configuration item and the tidb_expensive_query_time_threshold system variable

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

Original topic: 关于log.expensive-threshold配置项与tidb_expensive_query_time_threshold系统变量的疑问

| username: OnTheRoad

In the document “Online Modify TiDB Configuration”, it is described as follows:

image
The TiDB configuration parameter log.expensive-threshold corresponds to the system variable tidb_expensive_query_time_threshold.

However, in the TiDB configuration parameter documentation, the description of log.expensive-threshold refers to the number of rows, as follows:

The description of the system variable tidb_expensive_query_time_threshold refers to time, as follows:

Questions are as follows:

  1. In the document “Online Modify TiDB Configuration”, is the description that log.expensive-threshold corresponds to the system variable tidb_expensive_query_time_threshold inaccurate?
  2. The document describes that when the number of query rows exceeds log.expensive-threshold, the [EXPENSIVE_QUERY] log will be recorded. However, according to feedback from multiple TiDB users, this configuration parameter does not work. Only when mem-quota-query (tidb_mem_quota_query) or tidb_expensive_query_time_threshold is triggered, the [EXPENSIVE_QUERY] log will be recorded.

Could the official team please confirm the above two questions?

| username: tiancaiamao | Original post link

The log.expensive-threshold parameter no longer works in the new version.

Before the changes in this PR, log.expensive-threshold would log [EXPENSIVE_QUERY] if the optimizer phase determined that the result rows might exceed 1000.
After the changes, this behavior was mistakenly removed. The corresponding documentation was not updated in time, so currently, the log.expensive-threshold configuration is useless.

In the section, it should also be a documentation error; log.expensive-threshold does not correspond to tidb_expensive_query_time_threshold.

| username: tiancaiamao | Original post link

Submitted a PR to fix it.

| username: system | Original post link

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