Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TIDB 支持SQL过载保护功能么
[TiDB Usage Environment] Production Environment
[TiDB Version] v6.1.7
[Encountered Problem: Problem Phenomenon and Impact] Business SQL takes too long to execute [e.g., inaccurate execution plan, SQL writing issues leading to excessive row retrieval], consuming a lot of TiDB resources. Does TiDB currently support the feature of automatically killing requests after the query request exceeds a specified execution time?
You can set max_execution_time to limit the maximum execution time. You can search for max_execution_time for more details, and it can be used to limit a specific SQL query, etc.
Reference:
You can directly set this parameter on the tidbserver. Executing show global variables like 'max_execution_time';
will show that the current default is 0.
You can set the maximum memory usage for each query.
Sometimes setting the maximum memory usage for each query may not take effect, please be aware when using it.
I feel that the max_execution_time parameter is more reliable.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.