6.5 DDL Operations Are Very Slow

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

Original topic: 6.5 DDL操作非常慢

| username: Hacker_6ASfgBFe

【TiDB Environment】Testing Environment
【TiDB Version】6.5.8
After upgrading TiDB from 5.4 to 6.5, performing DDL operations has become very slow.

| username: Billmay表妹 | Original post link

[Resource Allocation] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page.
Please send this.

| username: TiDBer_0p0BD6le | Original post link

You can execute admin show ddl jobs to check the status of DDL and see if it is progressing.

| username: 小龙虾爱大龙虾 | Original post link

If the truncate operation is slow, it might be due to MDL locks. You can start troubleshooting from this point: 元数据锁 | PingCAP 文档中心

| username: Hacker_6ASfgBFe | Original post link

I checked, the status is queueing.

| username: wakaka | Original post link

There may be concurrent DDL operations. You need to check the DDL statements during the same time period, not just this one.

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

TiDB, high-end machine (16C+ 64G+) + NVMe independent disk, independently deployed according to the documentation, solves more than 99% of the problems.

| username: TiDBer_QYr0vohO | Original post link

Check the DDL status and see if there are any other DDLs during the same time period.

| username: DBAER | Original post link

It could also be caused by the MDL lock, if it’s a higher version of TiDB.

| username: tidb菜鸟一只 | Original post link

First, check this table: select * from mysql.tidb_mdl_view

| username: zhaokede | Original post link

admin show ddl jobs

| username: xiaoqiao | Original post link

Any progress?

| username: QH琉璃 | Original post link

What is the reason?

| username: TiDBer_JUi6UvZm | Original post link

The result of admin show ddl jobs is what?

| username: Hacker_6ASfgBFe | Original post link

This table cannot be queried, it keeps getting stuck, even limit 1 doesn’t work, and TiDB directly restarted.

| username: Hacker_6ASfgBFe | Original post link

The image you provided is not visible. Please provide the text you need translated.

| username: shigp_TIDBER | Original post link

Reasons for slow DDL: 1. Check if there is a DDL lock; 2. Check if small table caching is enabled for this table.

| username: 舞动梦灵 | Original post link

If truncating is slow, check if there is a lock on the table. Normally, this issue shouldn’t occur. You can cancel the execution and try again after a while.

| username: mono | Original post link

I also upgraded from 5.4 to 6.5, and the improvement in DDL performance is quite noticeable. Your issue is likely due to not checking for any ongoing DDL operations before the upgrade.

| username: wakaka | Original post link

Under normal circumstances, is the synced truncate execution fast? I see the three table names above are the same, right?