Why does TiDB report an error when creating an index?

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

Original topic: 为啥tidb 创建索引的时候报无法创建

| username: tidb狂热爱好者

【TiDB Usage Environment】Production Environment / Testing / PoC
【TiDB Version】6.3.0
【Reproduction Path】What operations were performed when the issue occurred
Unable to create index
Error occurs upon creation

【Encountered Issue: Issue Phenomenon and Impact】
【Resource Configuration】
【Attachments: Screenshots/Logs/Monitoring】

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

MySQL [futs]> create index idx_bid_user_id_contract on futs.co_new_trade(bid_user_id,contract_type,created_at);
ERROR 8214 (HY000): Cancelled DDL job
MySQL [futs]> create index idx_ask_user_id_contract on futs.co_new_trade(ask_user_id,contract_type,created_at);
ERROR 8214 (HY000): Cancelled DDL job

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

Solved the problem by myself
set session max_execution_time=0;

| username: zhimadi | Original post link

I know this one, bro taught me before. :rofl:

set @@global.MAX_EXECUTION_TIME=10000
| username: 胡杨树旁 | Original post link

Is this taking too long to create the index?

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

Yes, the creation time is greater than the maximum execution time.

| username: system | Original post link

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