# DDL Execution - Cont'd

![`smart`](DDLExecution02_aa_005_20220512.png)

-----------------------------------------------------------
Below is an introduction to the queue in TiKV:

`Job Queue` is a persistent queue data structure in TiKV for storing unexecuted Jobs, but it does not contain `Add Index` jobs, because the Jobs for adding indexes are put in the `Add Index Queue`, and each TiDB cluster only has one.

`Add Index Queue` is persistent in TiKV, and each TiDB cluster only has one.

Jobs in both the `Job Queue` and `Add Index Queue` can be executed in parallel.

`Job History Queue` is a persistent data structure in TiKV that stores the queue of Jobs that have been processed, and each TiDB cluster only has one.

Therefore, the Worker process will take out the first unprocessed Job from both the `Job Queue` and `Add Index Queue` in parallel, and after execution, put the Job into the `Job History Queue`fir query.

When Job is executing, it will go through the states of `none`, `delete only`, `write only`, `write reorganization`, `delete reorganization`, and `public`.
