> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Системная таблица, содержащая информацию о распределённых DDL-запросах (запросах, использующих предложение ON CLUSTER), выполненных в кластере.

# system.distributed_ddl_queue

<div id="description">
  ## Описание
</div>

Содержит информацию о [распределённых DDL-запросах (предложение ON CLUSTER)](/ru/reference/statements/distributed-ddl), выполненных в кластере.

<div id="columns">
  ## Столбцы
</div>

* `entry` ([String](/ru/reference/data-types)) — Query id.
* `entry_version` ([Nullable(UInt8)](/ru/reference/data-types)) — Версия записи.
* `initiator_host` ([Nullable(String)](/ru/reference/data-types)) — Хост, инициировавший DDL-операцию.
* `initiator_port` ([Nullable(UInt16)](/ru/reference/data-types)) — Порт, используемый инициатором.
* `cluster` ([String](/ru/reference/data-types)) — Имя кластера, пустое, если не определено.
* `query` ([String](/ru/reference/data-types)) — Выполненный запрос.
* `settings` ([Map(String, String)](/ru/reference/data-types)) — Настройки, использованные в DDL-операции.
* `query_create_time` ([DateTime](/ru/reference/data-types)) — Время создания запроса.
* `host` ([Nullable(String)](/ru/reference/data-types)) — Имя хоста.
* `port` ([Nullable(UInt16)](/ru/reference/data-types)) — Порт хоста.
* `status` ([Nullable(Enum8('Inactive' = 0, 'Active' = 1, 'Finished' = 2, 'Removing' = 3, 'Unknown' = 4))](/ru/reference/data-types)) — Статус запроса.
* `exception_code` ([Nullable(UInt16)](/ru/reference/data-types)) — Код исключения.
* `exception_text` ([Nullable(String)](/ru/reference/data-types)) — Текст исключения.
* `query_finish_time` ([Nullable(DateTime)](/ru/reference/data-types)) — Время завершения запроса.
* `query_duration_ms` ([Nullable(UInt64)](/ru/reference/data-types)) — Длительность выполнения запроса (в миллисекундах).

<div id="example">
  ## Пример
</div>

```sql theme={null}
SELECT *
FROM system.distributed_ddl_queue
WHERE cluster = 'test_cluster'
LIMIT 2
FORMAT Vertical

Query id: f544e72a-6641-43f1-836b-24baa1c9632a

Row 1:
──────
entry:             query-0000000000
entry_version:     5
initiator_host:    clickhouse01
initiator_port:    9000
cluster:           test_cluster
query:             CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
settings:          {'max_threads':'16','use_uncompressed_cache':'0'}
query_create_time: 2023-09-01 16:15:14
host:              clickhouse-01
port:              9000
status:            Finished
exception_code:    0
exception_text:    
query_finish_time: 2023-09-01 16:15:14
query_duration_ms: 154

Row 2:
──────
entry:             query-0000000001
entry_version:     5
initiator_host:    clickhouse01
initiator_port:    9000
cluster:           test_cluster
query:             CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
settings:          {'max_threads':'16','use_uncompressed_cache':'0'}
query_create_time: 2023-09-01 16:15:14
host:              clickhouse-01
port:              9000
status:            Finished
exception_code:    630
exception_text:    Code: 630. DB::Exception: Cannot drop or rename test_db, because some tables depend on it:
query_finish_time: 2023-09-01 16:15:14
query_duration_ms: 154

2 rows in set. Elapsed: 0.025 sec.
```
