## 模块 4: 通过 ADMIN PAUSE DDL 避免 DDL 任务对于负载的影响

### 步骤 1. 用四个终端连接到 TiUP 控制机器

+ 通过点击以下链接打开四个 SSH 连接到你的实验虚拟机：
  + [终端 1](ssh://monitor1-ssh#1)
  + [终端 2](ssh://monitor1-ssh#2)
  + [终端 3](ssh://monitor1-ssh#3)
  + [终端 4](ssh://monitor1-ssh#4)

+ 现在你将有四个活动的终端会话。

### 步骤 2. 通过 `tiup bench` 启动负载

+ 在[终端 1](ssh://monitor1-ssh#1) 上，通过 `tiup bench` 启动负载，模拟 20 个会话并发访问数据库的 4 个 WAREHOUSE 中的数据，持续时间为 15 分钟。关于如何对 TiDB 进行 TPC-C 测试，请参考：<https://docs.pingcap.com/zh/tidb/stable/benchmark-tidb-using-tpcc/#如何对-tidb-进行-tpc-c-测试>

> [!TIP]
> 请注意，`步骤 2` 开始后，请在 15 分钟内完成 `步骤 4` 之前的内容，否则将无法得到正确的结果。

  ```bash
  export PATH="$PATH:/home/ec2-user/.tiup/bin"
  tiup bench tpcc -H ${HOST_DB1_PRIVATE_IP},${HOST_DB2_PRIVATE_IP} -P 4000 -D tpcc --warehouses 4 --threads 20 --time 15m run
  ```

  ```output
  [Current] DELIVERY - Takes(s): 9.8, Count: 213, TPM: 1306.6, Sum(ms): 18520.5, Avg(ms): 87.0, 50th(ms): 79.7, 90th(ms): 134.2, 95th(ms): 151.0, 99th(ms): 243.3, 99.9th(ms): 302.0, Max(ms): 302.0
  [Current] NEW_ORDER - Takes(s): 9.8, Count: 2256, TPM: 13760.7, Sum(ms): 79851.6, Avg(ms): 35.4, 50th(ms): 29.4, 90th(ms): 62.9, 95th(ms): 79.7, 99th(ms): 109.1, 99.9th(ms): 151.0, Max(ms): 167.8
  [Current] ORDER_STATUS - Takes(s): 9.8, Count: 188, TPM: 1148.2, Sum(ms): 1647.7, Avg(ms): 8.8, 50th(ms): 7.9, 90th(ms): 13.6, 95th(ms): 16.3, 99th(ms): 24.1, 99.9th(ms): 24.1, Max(ms): 24.1
  [Current] PAYMENT - Takes(s): 9.9, Count: 2080, TPM: 12643.3, Sum(ms): 90919.6, Avg(ms): 43.7, 50th(ms): 37.7, 90th(ms): 88.1, 95th(ms): 104.9, 99th(ms): 142.6, 99.9th(ms): 167.8, Max(ms): 184.5
  [Current] STOCK_LEVEL - Takes(s): 9.7, Count: 183, TPM: 1130.6, Sum(ms): 4273.2, Avg(ms): 23.3, 50th(ms): 14.2, 90th(ms): 46.1, 95th(ms): 75.5, 99th(ms): 159.4, 99.9th(ms): 176.2, Max(ms): 176.2
  [Current] DELIVERY - Takes(s): 10.0, Count: 234, TPM: 1408.4, Sum(ms): 20728.7, Avg(ms): 88.6, 50th(ms): 71.3, 90th(ms): 142.6, 95th(ms): 167.8, 99th(ms): 285.2, 99.9th(ms): 335.5, Max(ms): 335.5
  ...
  ```

+ 登录 [Grafana 监控](http://${LAB:HOST_MONITOR1_PUBLIC_IP}:3000)，建议保留本步骤中打开的监控页面，并设置监控时间范围为最近 5 分钟，同时将刷新频率改为 5 秒。

  ![70%](https://lab-static.pingcap.com/images/2025/7/26/9c787410ab425dd7eb7e7297cc46711ec63ccc22.png)

+ 在 [Grafana 监控](http://${LAB:HOST_MONITOR1_PUBLIC_IP}:3000)，进入`Home`，然后选择`tidb-demo`，接着选择`tidb-demo-TiDB-Summary`， 打开 `Query Summary` 标签， 在 `Query Summary` 标签下可以看到 `Duration` 面板用于监控从客户端网络请求发送到 TiDB，到 TiDB 执行结束后返回给客户端的时间。`Command Per Second` 面板用于监控 TiDB 按照执行结果成功或失败来统计每秒处理的命令数。可通过 `Duration` 面板和`Command Per Second` 面板了解到当前数据库的处理能力是否受到 DDL 任务的影响。

  ![70%](https://lab-static.pingcap.com/images/2025/7/27/abc6e85f974919917c1bc040b7548820fe9d6cb9.png)

+ 等待 2 分钟，我们可以发现数据库的负载处理时间已经稳定，可以进入下个步骤。

  ![70%](https://lab-static.pingcap.com/images/2025/7/27/6f4ffcdd8f9d17ed4a74708ca496a6c64bb541d8.png)

### 步骤 3. 为表添加索引并修改列的属性

+ 在[终端 2](ssh://monitor1-ssh#2) 上，连接到 TiDB 服务器实例。

  ```bash
  mysql -h ${HOST_TIPROXY1_PRIVATE_IP} --port 6000 -u root
  ```

  ```output
  mysql> 
  ```

+ 为表 `test.ddl_test3` 添加索引，并修改 `content` 列的属性。注意：不要等待该命令结束。

  ```sql
  ALTER TABLE test.ddl_test3 ADD INDEX idx_content_updated_at(content, updated_at);ALTER TABLE test.ddl_test3 MODIFY `content` VARCHAR(32) DEFAULT '0000000000' COMMENT 'content';
  ```

+ 在[终端 3](ssh://monitor1-ssh#3) 上，连接到 TiDB 服务器实例。

  ```bash
  mysql -h ${HOST_TIPROXY1_PRIVATE_IP} --port 6000 -u root
  ```

  ```output
  mysql> 
  ```

+ 为表 `test.ddl_test4` 添加索引，并修改 `content` 列的属性。注意：不要等待该命令结束。在此实验中，为表 `test.ddl_test3` 和表 `test.ddl_test4` 修改 `content` 列的属性操作大概会持续 4 分钟，所以请在 4 分钟内开始 `步骤 4` ，否则可能无法得到正确结果。

  ```sql
  ALTER TABLE test.ddl_test4 ADD INDEX idx_content_updated_at(content, updated_at);ALTER TABLE test.ddl_test4 MODIFY `content` VARCHAR(32) DEFAULT '0000000000' COMMENT 'content';
  ```

+ 在`tidb-demo-TiDB-Summary` 的 `Query Summary` 标签中可以看到 `Duration` 面板开始上升，`Command Per Second` 面板开始下降，说明数据库的处理能力受到 DDL 任务的影响，用户体验可能下降。

  ![70%](https://lab-static.pingcap.com/images/2025/7/27/f9100e0672b94b8336fc969ebb1c28bbd639cc1f.png)

### 步骤 4. 使用 `ADMIN PAUSE DDL` 暂停 DDL 任务

+ 在[终端 4](ssh://monitor1-ssh#4) 上，连接到 TiDB 服务器实例。

  ```bash
  mysql -h ${HOST_TIPROXY1_PRIVATE_IP} --port 6000 -u root
  ```

  ```output
  mysql> 
  ```

+ 通过命令 `ADMIN SHOW DDL JOBS` 找到上一步骤执行的 DDL 任务的 `JOB_ID`，例子中 `JOB_ID` 为 `175` 和 `176`， `STATE` 为 `running` 和 `queueing`， 表示该 DDL 任务正在运行。请注意，你的输出可能和例子中不同。

  ```sql
  ADMIN SHOW DDL JOBS;
  ```

  ```output
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  | JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE      | SCHEMA_STATE         | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME                   | STATE         | COMMENTS    |
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  |    175 | test    | ddl_test3  | modify column | write reorganization |         2 |      114 |         0 | 2025-07-27 04:44:56.336000 | 2025-07-27 04:44:56.386000 | NULL                       | running       |             |
  |    176 | test    | ddl_test4  | add index     | none                 |         2 |      116 |         0 | 2025-07-27 04:45:08.285000 | NULL                       | NULL                       | queueing      |             |
  |    174 | test    | ddl_test3  | add index     | public               |         2 |      114 |   4194304 | 2025-07-27 04:44:35.936000 | 2025-07-27 04:44:35.985000 | 2025-07-27 04:44:49.036000 | synced        | ingest, DXF |
  |    173 | test    | ddl_test2  | modify column | none                 |         2 |      112 |         0 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:36:30.036000 | rollback done |             |
  |    172 | test    | ddl_test2  | add index     | public               |         2 |      112 |   4194304 | 2025-07-27 04:34:35.636000 | 2025-07-27 04:34:35.685000 | 2025-07-27 04:34:45.486000 | synced        | ingest, DXF |
  |    171 | test    | ddl_test1  | modify column | public               |         2 |      110 |   4194304 | 2025-07-27 04:25:52.786000 | 2025-07-27 04:25:52.835000 | 2025-07-27 04:33:03.786000 | synced        |             |
  |    170 | test    | ddl_test1  | add index     | public               |         2 |      110 |   4194304 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:51.086000 | synced        | ingest, DXF |
  |    169 | tpcc    | item       | create table  | public               |       118 |      168 |         0 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.135000 | synced        |             |
  |    167 | tpcc    | stock      | create table  | public               |       118 |      162 |         0 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.636000 | synced        |             |
  |    161 | tpcc    | order_line | create table  | public               |       118 |      156 |         0 | 2025-07-27 04:22:39.036000 | 2025-07-27 04:22:39.086000 | 2025-07-27 04:22:39.086000 | synced        |             |
  |    155 | tpcc    | orders     | create table  | public               |       118 |      150 |         0 | 2025-07-27 04:22:38.536000 | 2025-07-27 04:22:38.536000 | 2025-07-27 04:22:38.585000 | synced        |             |
  |    149 | tpcc    | new_order  | create table  | public               |       118 |      144 |         0 | 2025-07-27 04:22:38.036000 | 2025-07-27 04:22:38.036000 | 2025-07-27 04:22:38.086000 | synced        |             |
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  12 rows in set (0.02 sec)
  ```

+ 通过命令 `ADMIN PAUSE DDL JOBS` 和 DDL 任务的 `JOB_ID` 暂停上一步骤中执行的 2 个 DDL 任务。请注意，下面代码中的 `JOB_ID` 需要根据学习者自己的环境指定，可能不是 `175` 和 `176`。

  ```sql
  ADMIN PAUSE DDL JOBS 175,176;
  ```

  ```output
  +--------+------------+
  | JOB_ID | RESULT     |
  +--------+------------+
  | 175    | successful |
  | 176    | successful |
  +--------+------------+
  2 rows in set (0.01 sec)
  ```

+ 通过命令 `ADMIN SHOW DDL JOBS` 检查 2 个 DDL 任务的状态，例子中 `JOB_ID` 为 `175` 和 `176`，`STATE` 为 `pausing` 和 `pausing` 表示已经暂停。请注意，你的输出可能和例子中不同。

  ```sql
  ADMIN SHOW DDL JOBS;
  ```

  ```output
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  | JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE      | SCHEMA_STATE         | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME                   | STATE         | COMMENTS    |
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  |    175 | test    | ddl_test3  | modify column | write reorganization |         2 |      114 |         0 | 2025-07-27 04:44:56.336000 | 2025-07-27 04:44:56.386000 | NULL                       | pausing       |             |
  |    176 | test    | ddl_test4  | add index     | none                 |         2 |      116 |         0 | 2025-07-27 04:45:08.285000 | NULL                       | NULL                       | pausing       |             |
  |    174 | test    | ddl_test3  | add index     | public               |         2 |      114 |   4194304 | 2025-07-27 04:44:35.936000 | 2025-07-27 04:44:35.985000 | 2025-07-27 04:44:49.036000 | synced        | ingest, DXF |
  |    173 | test    | ddl_test2  | modify column | none                 |         2 |      112 |         0 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:36:30.036000 | rollback done |             |
  |    172 | test    | ddl_test2  | add index     | public               |         2 |      112 |   4194304 | 2025-07-27 04:34:35.636000 | 2025-07-27 04:34:35.685000 | 2025-07-27 04:34:45.486000 | synced        | ingest, DXF |
  |    171 | test    | ddl_test1  | modify column | public               |         2 |      110 |   4194304 | 2025-07-27 04:25:52.786000 | 2025-07-27 04:25:52.835000 | 2025-07-27 04:33:03.786000 | synced        |             |
  |    170 | test    | ddl_test1  | add index     | public               |         2 |      110 |   4194304 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:51.086000 | synced        | ingest, DXF |
  |    169 | tpcc    | item       | create table  | public               |       118 |      168 |         0 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.135000 | synced        |             |
  |    167 | tpcc    | stock      | create table  | public               |       118 |      162 |         0 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.636000 | synced        |             |
  |    161 | tpcc    | order_line | create table  | public               |       118 |      156 |         0 | 2025-07-27 04:22:39.036000 | 2025-07-27 04:22:39.086000 | 2025-07-27 04:22:39.086000 | synced        |             |
  |    155 | tpcc    | orders     | create table  | public               |       118 |      150 |         0 | 2025-07-27 04:22:38.536000 | 2025-07-27 04:22:38.536000 | 2025-07-27 04:22:38.585000 | synced        |             |
  |    149 | tpcc    | new_order  | create table  | public               |       118 |      144 |         0 | 2025-07-27 04:22:38.036000 | 2025-07-27 04:22:38.036000 | 2025-07-27 04:22:38.086000 | synced        |             |
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  12 rows in set (0.01 sec)
  ```

+ 等待一段时间，在`tidb-demo-TiDB-Summary` 的 `Query Summary` 标签中可以看到 `Duration` 面板开始下降，`Command Per Second` 面板开始上升，说明数据库的处理能力不再受到 DDL 任务的影响。

  ![70%](https://lab-static.pingcap.com/images/2025/7/27/7e5ab6935439206d1947a1ff45a0f978ae0dfba7.png)

+ 在[终端 1](ssh://monitor1-ssh#1) 上，等待 TPC-C 测试结束，或者使用 <kbd>Ctrl</kbd>+<kbd>C</kbd> 中止测试。

  ```output
  ...
  [Summary] DELIVERY - Takes(s): 599.8, Count: 10974, TPM: 1097.8, Sum(ms): 1172026.8, Avg(ms): 106.9, 50th(ms): 92.3, 90th(ms): 176.2, 95th(ms): 218.1, 99th(ms): 335.5, 99.9th(ms): 671.1, Max(ms): 1342.2
  [Summary] NEW_ORDER - Takes(s): 599.8, Count: 124031, TPM: 12406.2, Sum(ms): 4598542.0, Avg(ms): 37.1, 50th(ms): 29.4, 90th(ms): 67.1, 95th(ms): 88.1, 99th(ms): 142.6, 99.9th(ms): 285.2, Max(ms): 1073.7
  [Summary] NEW_ORDER_ERR - Takes(s): 599.8, Count: 6, TPM: 0.6, Sum(ms): 166.6, Avg(ms): 27.8, 50th(ms): 23.1, 90th(ms): 37.7, 95th(ms): 60.8, 99th(ms): 60.8, 99.9th(ms): 60.8, Max(ms): 60.8
  [Summary] ORDER_STATUS - Takes(s): 599.8, Count: 10975, TPM: 1097.8, Sum(ms): 98169.0, Avg(ms): 8.9, 50th(ms): 7.9, 90th(ms): 14.2, 95th(ms): 17.8, 99th(ms): 29.4, 99.9th(ms): 65.0, Max(ms): 260.0
  [Summary] PAYMENT - Takes(s): 599.9, Count: 118543, TPM: 11856.6, Sum(ms): 5758996.8, Avg(ms): 48.6, 50th(ms): 39.8, 90th(ms): 96.5, 95th(ms): 117.4, 99th(ms): 167.8, 99.9th(ms): 302.0, Max(ms): 1040.2
  [Summary] PAYMENT_ERR - Takes(s): 599.9, Count: 9, TPM: 0.9, Sum(ms): 539.4, Avg(ms): 59.7, 50th(ms): 37.7, 90th(ms): 113.2, 95th(ms): 151.0, 99th(ms): 151.0, 99.9th(ms): 151.0, Max(ms): 151.0
  [Summary] STOCK_LEVEL - Takes(s): 599.7, Count: 11074, TPM: 1107.9, Sum(ms): 276158.1, Avg(ms): 24.9, 50th(ms): 21.0, 90th(ms): 44.0, 95th(ms): 52.4, 99th(ms): 79.7, 99.9th(ms): 142.6, Max(ms): 226.5
  [Summary] STOCK_LEVEL_ERR - Takes(s): 599.7, Count: 1, TPM: 0.1, Sum(ms): 4.1, Avg(ms): 3.9, 50th(ms): 4.2, 90th(ms): 4.2, 95th(ms): 4.2, 99th(ms): 4.2, 99.9th(ms): 4.2, Max(ms): 4.2
  tpmC: 12406.2, tpmTotal: 27566.3, efficiency: 24117.9%
  ```

### 步骤 5. 使用 `ADMIN RESUME DDL` 恢复 DDL 任务

+ 在[终端 4](ssh://monitor1-ssh#4) 上，连接到 TiDB 服务器实例。

  ```bash
  mysql -h ${HOST_TIPROXY1_PRIVATE_IP} --port 6000 -u root
  ```

  ```output
  mysql> 
  ```

+ 通过命令 `ADMIN RESUME DDL JOBS` 和 DDL 任务的 `JOB_ID` 恢复上一步骤中被暂停的 2 个 DDL 任务。请注意，下面代码中的 `JOB_ID` 需要根据参与者自己的环境指定，可能不是 `175` 和 `176`。

  ```sql
  ADMIN RESUME DDL JOBS 175, 176;
  ```

  ```output
  +--------+------------+
  | JOB_ID | RESULT     |
  +--------+------------+
  | 175    | successful |
  | 176    | successful |
  +--------+------------+
  2 rows in set (0.00 sec)
  ```

+ 通过命令 `ADMIN SHOW DDL JOBS` 检查 DDL 任务的状态，例子中 `JOB_ID` 为 `175` 和 `176`，`STATE` 为 `queueing` 和 `queueing` 表示已经恢复运行。请注意，你的输出可能和例子中不同。

  ```sql
  ADMIN SHOW DDL JOBS;
  ```

  ```output
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  | JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE      | SCHEMA_STATE         | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME                   | STATE         | COMMENTS    |
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  |    175 | test    | ddl_test3  | modify column | write reorganization |         2 |      114 |         0 | 2025-07-27 04:44:56.336000 | 2025-07-27 04:44:56.386000 | NULL                       | queueing      |             |
  |    176 | test    | ddl_test4  | add index     | none                 |         2 |      116 |         0 | 2025-07-27 04:45:08.285000 | 2025-07-27 04:50:45.286000 | NULL                       | queueing      |             |
  |    174 | test    | ddl_test3  | add index     | public               |         2 |      114 |   4194304 | 2025-07-27 04:44:35.936000 | 2025-07-27 04:44:35.985000 | 2025-07-27 04:44:49.036000 | synced        | ingest, DXF |
  |    173 | test    | ddl_test2  | modify column | none                 |         2 |      112 |         0 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:36:30.036000 | rollback done |             |
  |    172 | test    | ddl_test2  | add index     | public               |         2 |      112 |   4194304 | 2025-07-27 04:34:35.636000 | 2025-07-27 04:34:35.685000 | 2025-07-27 04:34:45.486000 | synced        | ingest, DXF |
  |    171 | test    | ddl_test1  | modify column | public               |         2 |      110 |   4194304 | 2025-07-27 04:25:52.786000 | 2025-07-27 04:25:52.835000 | 2025-07-27 04:33:03.786000 | synced        |             |
  |    170 | test    | ddl_test1  | add index     | public               |         2 |      110 |   4194304 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:51.086000 | synced        | ingest, DXF |
  |    169 | tpcc    | item       | create table  | public               |       118 |      168 |         0 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.135000 | synced        |             |
  |    167 | tpcc    | stock      | create table  | public               |       118 |      162 |         0 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.636000 | synced        |             |
  |    161 | tpcc    | order_line | create table  | public               |       118 |      156 |         0 | 2025-07-27 04:22:39.036000 | 2025-07-27 04:22:39.086000 | 2025-07-27 04:22:39.086000 | synced        |             |
  |    155 | tpcc    | orders     | create table  | public               |       118 |      150 |         0 | 2025-07-27 04:22:38.536000 | 2025-07-27 04:22:38.536000 | 2025-07-27 04:22:38.585000 | synced        |             |
  |    149 | tpcc    | new_order  | create table  | public               |       118 |      144 |         0 | 2025-07-27 04:22:38.036000 | 2025-07-27 04:22:38.036000 | 2025-07-27 04:22:38.086000 | synced        |             |
  +--------+---------+------------+---------------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  12 rows in set (0.02 sec)
  ```

### 步骤 6. 等待 DDL 任务执行结束

+ 在 [终端 2](ssh://monitor1-ssh#2) 上，等待 DDL 任务执行结束。

  ```output
  Query OK, 0 rows affected (16.28 sec)

  Query OK, 0 rows affected (18 min 48.04 sec)
  ```

+ 在 [终端 3](ssh://monitor1-ssh#3) 上，等待 DDL 任务执行结束。

  ```output
  Query OK, 0 rows affected (20 min 30.99 sec)

  Query OK, 0 rows affected (3 min 51.02 sec)
  ```

+ 在[终端 4](ssh://monitor1-ssh#2) 上，通过命令 `ADMIN SHOW DDL JOBS` 检查 DDL 任务的状态，例子中 `JOB_ID` 为 `175` 和 `176`，`STATE` 为 `synced` 和 `synced` 表示已经执行完成。请注意，你的输出可能和例子中不同。

  ```sql
  ADMIN SHOW DDL JOBS;
  ```

  ```output
  +--------+---------+------------+---------------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  | JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE      | SCHEMA_STATE | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME                   | STATE         | COMMENTS    |
  +--------+---------+------------+---------------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  |    177 | test    | ddl_test4  | modify column | public       |         2 |      116 |   7142699 | 2025-07-27 04:55:03.086000 | 2025-07-27 04:55:03.136000 | 2025-07-27 04:59:05.536000 | synced        |             |
  |    176 | test    | ddl_test4  | add index     | public       |         2 |      116 |   4194304 | 2025-07-27 04:45:08.285000 | 2025-07-27 04:50:45.286000 | 2025-07-27 04:54:51.086000 | synced        | ingest, DXF |
  |    175 | test    | ddl_test3  | modify column | public       |         2 |      114 |   4194304 | 2025-07-27 04:44:56.336000 | 2025-07-27 04:44:56.386000 | 2025-07-27 04:54:11.236000 | synced        |             |
  |    174 | test    | ddl_test3  | add index     | public       |         2 |      114 |   4194304 | 2025-07-27 04:44:35.936000 | 2025-07-27 04:44:35.985000 | 2025-07-27 04:44:49.036000 | synced        | ingest, DXF |
  |    173 | test    | ddl_test2  | modify column | none         |         2 |      112 |         0 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:34:49.586000 | 2025-07-27 04:36:30.036000 | rollback done |             |
  |    172 | test    | ddl_test2  | add index     | public       |         2 |      112 |   4194304 | 2025-07-27 04:34:35.636000 | 2025-07-27 04:34:35.685000 | 2025-07-27 04:34:45.486000 | synced        | ingest, DXF |
  |    171 | test    | ddl_test1  | modify column | public       |         2 |      110 |   4194304 | 2025-07-27 04:25:52.786000 | 2025-07-27 04:25:52.835000 | 2025-07-27 04:33:03.786000 | synced        |             |
  |    170 | test    | ddl_test1  | add index     | public       |         2 |      110 |   4194304 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:39.136000 | 2025-07-27 04:25:51.086000 | synced        | ingest, DXF |
  |    169 | tpcc    | item       | create table  | public       |       118 |      168 |         0 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.086000 | 2025-07-27 04:22:40.135000 | synced        |             |
  |    167 | tpcc    | stock      | create table  | public       |       118 |      162 |         0 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.586000 | 2025-07-27 04:22:39.636000 | synced        |             |
  +--------+---------+------------+---------------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+---------------+-------------+
  10 rows in set (0.01 sec)
  ```

  + 本模块到此结束。
