What to do when an analysis table error occurs

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

Original topic: 分析表出错是怎么回事

| username: tidb狂热爱好者

【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.

| username: Billmay表妹 | Original post link

What operations did you perform that caused the problem?

| username: tidb狂热爱好者 | Original post link

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.

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

Have you set the max_execution_time?

| username: tidb狂热爱好者 | Original post link

Analyze table ex_order_total;
Error
set session max_execution_time=0;
Analyze table ex_order_total;
Executed successfully

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

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.

| username: tidb狂热爱好者 | Original post link

How can I make the DDL take effect? I’m about to start cursing.

| username: cs58_dba | Original post link

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.

| username: tidb狂热爱好者 | Original post link

max_execution_time is effective for DDL but will not interrupt it. The previous answers were unclear.

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.