Issues in the Execution Flow of DDL Statements

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

Original topic: DDL 语句的执行流程问题

| username: yytest

  1. DDL statements cannot be executed in parallel in TiDB.
  2. At the same time, only one TiDB Server can execute DDL statements.

I would like to ask, which of the above two statements is correct and which is incorrect?

| username: 友利奈绪 | Original post link

For the above two sentences:

  1. DDL statements cannot be executed in parallel in TiDB. This statement is incorrect. In TiDB, multiple DDL statements can be executed in parallel. TiDB supports concurrent execution of multiple DDL statements, which can improve the system’s processing capacity and efficiency. When executing parallel DDL statements, TiDB schedules and executes them based on priority and resource availability.
  2. At any given moment, only one TiDB Server can execute DDL statements. This statement is correct. In TiDB’s architecture, each TiDB Server instance runs independently, and each instance can execute DDL statements. However, in a TiDB cluster, at any given moment, only one TiDB Server is responsible for coordinating and executing DDL statements. This ensures the correctness and consistency of DDL operations, avoiding competition and conflicts between multiple TiDB Servers.

In summary, multiple DDL statements can be executed in parallel in TiDB, but at any given moment, only one TiDB Server is responsible for executing and coordinating the execution order and results of DDL statements.

| username: yytest | Original post link

Thank you for your guidance, teacher!

| username: 友利奈绪 | Original post link

You’re too kind.

| username: TiDBer_vJGTQABF | Original post link

1 wrong 2 right. You can execute add index and other DDL statements simultaneously.

| username: 小于同学 | Original post link

The second one is correct.

| username: Jack-li | Original post link

The second one is correct.

| username: TiDBer_QYr0vohO | Original post link

The second one is correct, the first one is wrong.

| username: yytest | Original post link

Indeed, it is mistake 2.

| username: zhaokede | Original post link

DDL statements cannot be executed in parallel in TiDB. This is correct.
At the same time, only one TiDB Server can execute DDL statements. This is also correct.
The original text of the exercise in course 302 is “can”.

| username: zhaokede | Original post link

This is the classroom quiz for the chapter “SQL Execution Process in TiDB Database” from the course “Advanced System Management of TiDB [TiDB v5] (302) Lesson 05”.

| username: jiayou64 | Original post link

At any given moment, only one TiDB server acting as the owner handles DDL operations, but the index DDL in the index queue and the jobs in the job queue can be executed in parallel by the owner.

| username: TiDBer_q2eTrp5h | Original post link

DDL statements cannot be executed in parallel in TiDB.
At any given time, only one TiDB Server can execute DDL statements.