ClickHouse/docs/en/operations/system-tables/distributed_ddl_queue.md
2021-01-07 11:10:49 -08:00

2.6 KiB

system.distributed_ddl_queue

Contains information about distributed ddl queries (ON CLUSTER queries) that were executed on a cluster.

Columns:

  • entry (String) - Query id.
  • host_name (String) - Hostname.
  • host_address (String) - IP address that the Hostname resolves to.
  • port (UInt16) - Host Port.
  • status (Enum) - Stats of the query.
  • cluster (String) - Cluster name.
  • query (String) - Query executed.
  • initiator (String) - Nod that executed the query.
  • query_start_time (Date) — Query start time.
  • query_finish_time (Date) — Query finish time.
  • query_duration_ms (UInt64) — Duration of query execution in milliseconds.
  • exception_code (Enum) - Exception code from ZooKeeper.

Example

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
host_name:         clickhouse01
host_address:      172.23.0.11
port:              9000
status:            Finished
cluster:           test_cluster
query:             CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
initiator:         clickhouse01:9000
query_start_time:  2020-12-30 13:07:51
query_finish_time: 2020-12-30 13:07:51
query_duration_ms: 6
exception_code:    ZOK

Row 2:
──────
entry:             query-0000000000
host_name:         clickhouse02
host_address:      172.23.0.12
port:              9000
status:            Finished
cluster:           test_cluster
query:             CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
initiator:         clickhouse01:9000
query_start_time:  2020-12-30 13:07:51
query_finish_time: 2020-12-30 13:07:51
query_duration_ms: 6
exception_code:    ZOK

2 rows in set. Elapsed: 0.025 sec.

Original article