distributed_ddl_queue 시스템 테이블
distributed_ddl_queue 시스템 테이블
distributed_ddl_queue 시스템 테이블은 클러스터에서 실행된 분산 ddl 쿼리(ON CLUSTER 절)에 대한 정보를 담고 있어요.
출처: 문서
본문
Description (설명)
클러스터에서 실행된 분산 ddl 쿼리(ON CLUSTER 절)에 대한 정보를 담고 있어요.
Columns (열)
entry(String) — 쿼리 id.entry_version(Nullable(UInt8)) — 항목의 버전.initiator_host(Nullable(String)) — DDL 작업을 시작한 호스트.initiator_port(Nullable(UInt16)) — 초기자(initiator)가 사용한 포트.cluster(String) — 클러스터 이름. 결정되지 않았으면 비어 있음.query(String) — 실행된 쿼리.settings(Map(String, String)) — DDL 작업에 사용된 설정.query_create_time(DateTime) — 쿼리 생성 시간.host(Nullable(String)) — 호스트 이름.port(Nullable(UInt16)) — 호스트 포트.status(Nullable(Enum8(‘Inactive’ = 0, ‘Active’ = 1, ‘Finished’ = 2, ‘Removing’ = 3, ‘Unknown’ = 4))) — 쿼리의 상태.exception_code(Nullable(UInt16)) — 예외 코드.exception_text(Nullable(String)) — 예외 메시지.query_finish_time(Nullable(DateTime)) — 쿼리 종료 시간.query_duration_ms(Nullable(UInt64)) — 쿼리 실행 기간(밀리초).
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
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.