# DDL Execution
__*job queue*__
__*Add index queue*__
__*history queue*__

![left](./student-guide/diagram/DDLExecution02_aa_002_20220512.png)

------------------------------------------------------------
Persistent in the queue. Here's a look at the queues in TiKV:

Job queue: is a queue data structure for persisting unexecuted jobs in TiKV, but it does not contain add index jobs, that is, indexed jobs, because indexed jobs will be placed in the add index queue. Each TiDB database has only one.

Jobs in the job queue and Add index queue can be executed in parallel.

Add index queue: is a persistent add index job in TiKV, that is, a job queue data structure that is indexed. There is only one per TiDB database. Jobs in the Add index queue and job queue can be executed in parallel.

Job history queue: is a queue data structure in TiKV that persistently stores jobs that have been processed. Each TiDB database has only one.

Therefore, the worker process will take the first unexecuted job from the job queue and the Add index queue in parallel to execute it, and after execution is complete, place the job in the job history queue for query.

When a job is executed, it will go through none, delete only, write only, write reorganization (delete reorganization), and public to ensure that the DDL statement does not lock the table. You can refer to the detailed principle: http://static.googleusercontent.com/media/research.google.com/zh-CN//pubs/archive/41376.pdf