Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 分析表出错是怎么回事
【TiDB Environment】Production Environment
【TiDB Version】6.1
【Encountered Problem】
MySQL [exchange]> Analyze table
→ ex_order_total;
ERROR 1317 (70100): Query execution was interrupted
【Reproduction Path】What operations were performed to cause the problem
【Problem Phenomenon and Impact】
【Attachments】
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.
What operations did you perform that caused the problem?
I fixed it myself. I was afraid of developers messing around, so I set a maximum execution time. Now I have set the maximum execution time to 0, which solved the problem.
Have you set the max_execution_time?
Analyze table ex_order_total;
Error
set session max_execution_time=0;
Analyze table ex_order_total;
Executed successfully
Unlike MySQL, the max_execution_time in TiDB also applies to DDL. You can control the SQL execution time by configuring session-level variables in the application’s connection string.
How can I make the DDL take effect? I’m about to start cursing.
Official explanation: max_execution_time
currently applies to all types of statements, not just SELECT
statements, unlike MySQL (which only applies to SELECT
statements). The actual precision is at the 100ms level, rather than a more accurate millisecond level.
max_execution_time is effective for DDL but will not interrupt it. The previous answers were unclear.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.