All Products
Search
Document Center

PolarDB:SHOW DDL

Last Updated:Mar 28, 2026

In PolarDB-X, every DDL statement runs as a DDL job. Use SHOW DDL to inspect active and recent DDL jobs in your instance.

Syntax

SHOW [FULL] DDL;

Example

The following example shows the output of SHOW DDL\G for a paused ALTER TABLE job. The BACKFILL_PROGRESS and PHY_DDL_PROGRESS fields reflect different internal sub-phases, so their values can differ from the overall PROGRESS.

SHOW DDL\G;
*************************** 1. row ***************************
           JOB_ID: 1359947811109470208
    OBJECT_SCHEMA: d1
      OBJECT_NAME: t2
           ENGINE: DAG
         DDL_TYPE: ALTER_TABLE
            STATE: PAUSED
BACKFILL_PROGRESS: 0%
 PHY_DDL_PROGRESS: 100%
         PROGRESS: 20%
       START_TIME: 2021-08-05 11:01:25.291
         END_TIME: 2021-08-05 11:02:27.020
 ELAPSED_TIME(MS): 61729
      PHY_PROCESS:
       CANCELABLE: true
1 row in set (0.03 sec)

Response parameters

ParameterDescription
JOB_IDThe unique ID of the DDL job. A 64-bit signed integer of the LONG data type.
OBJECT_SCHEMAThe schema name of the object on which the DDL job is performed.
OBJECT_NAMEThe name of the object on which the DDL job is performed — for example, the table name for a CREATE TABLE or ALTER TABLE job.
ENGINEThe engine type for the DDL job. Default value: DAG.
DDL_TYPEThe type of the DDL job, such as CREATE_TABLE or ALTER_TABLE.
STATEThe current state of the DDL job. Valid values: QUEUED, RUNNING, COMPLETED, ROLLBACK_RUNNING, ROLLBACK_COMPLETED, PAUSED. See DDL job states for state transitions.
BACKFILL_PROGRESSThe progress of data backfilling within the DDL job.
PHY_DDL_PROGRESSThe progress of batch physical DDL statements being executed within the DDL job.
PROGRESSThe overall progress of the DDL job.
START_TIMEThe time at which the DDL job started.
END_TIMEThe time at which the DDL job ended.
ELAPSED_TIME(MS)The time elapsed since the DDL job started, in milliseconds.
PHY_PROCESSThe state of physical DDL statements currently being executed.
CANCELABLEWhether the DDL job can be canceled using CANCEL DDL. true means the job is cancelable.

DDL job states

The STATE field reflects the current phase of a DDL job. The following diagram shows how states transition:

456789

Under normal conditions, a DDL job progresses through: QUEUEDRUNNINGCOMPLETED.

If an exception occurs, the job may be automatically rolled back: QUEUEDRUNNINGROLLBACK_RUNNINGROLLBACK_COMPLETED.

What's next

  • To cancel a cancelable DDL job (CANCELABLE: true), run CANCEL DDL.