Does the execution process of Online DDL statements include parsing and compilation of the statements?

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

Original topic: Online DDL语句执行流程中,包括对语句的解析和编译吗?

| username: yytest

Does the execution process of Online DDL statements include parsing and compilation of the statements?
Personally, I don’t think it does. What do you all think?

| username: zhaokede | Original post link

Aren’t all SQL statements supposed to be parsed?

| username: zhaokede | Original post link

During the execution of DDL statements, the input DDL statements are parsed and converted into an internal representation that the database system can understand. This process typically includes steps such as lexical analysis, syntax analysis, and semantic analysis.

| username: 这里介绍不了我 | Original post link

:joy: Statement execution is definitely necessary.

| username: hacker_77powerful | Original post link

First, lexical, syntactic, and semantic analysis must be performed. Otherwise, how can we determine whether the syntax of this DDL SQL statement is correct?

| username: 小于同学 | Original post link

Included

| username: TiDBer_QYr0vohO | Original post link

Definitely.

| username: 友利奈绪 | Original post link

Including OUs

| username: TiDBer_RjzUpGDL | Original post link

Included

| username: jiayou64 | Original post link

DDL execution process:

  1. The DDL request is sent to the TiDB cluster;

  2. The request is converted into a job and sent to the TiKV cluster;

  3. Each TiDB instance checks if it is the Owner. If not, it does nothing.

    3.1 If it is the Owner, proceed to the next step.

    3.2 Retrieve job information and update schema version information.

  4. If there are no other jobs, the current job is removed from the queue and moved to the history queue;

  5. The job can be retrieved from the history queue and the completion information is returned to the client.