system.part_log 시스템 테이블

system.part_log 시스템 테이블

system.part_log 테이블은 part_log 서버 설정이 지정된 경우에만 생성돼요. 이 테이블에는 MergeTree 계열 테이블의 데이터 파트 에서 발생한 이벤트(예: 데이터 추가 또는 병합)에 대한 정보가 들어 있어요.

출처: 문서

본문

ClickHouse Cloud에서의 조회 — 이 시스템 테이블의 데이터는 ClickHouse Cloud에서 각 노드에 로컬로 저장돼요. 따라서 모든 데이터의 완전한 뷰를 얻으려면 clusterAllReplicas 함수가 필요해요. 자세한 내용은 여기 를 참고하세요.

Description

system.part_log 테이블은 part_log 서버 설정이 지정된 경우에만 생성돼요. 이 테이블에는 MergeTree 계열 테이블의 데이터 파트 에서 발생한 이벤트(예: 데이터 추가 또는 병합)에 대한 정보가 들어 있어요. system.part_log 테이블은 다음 열을 포함해요. 이 테이블은 언제든지 안전하게 truncate 하거나 drop 할 수 있어요.

Columns

  • hostname (LowCardinality(String)) — 쿼리를 실행한 서버의 호스트 이름이에요.

  • clickhouse_version (LowCardinality(String)) — 이 행을 만든 ClickHouse 서버의 버전이에요.

  • system_processor (LowCardinality(String)) — 이 행을 만든 ClickHouse 서버의 CPU 아키텍처예요.

  • query_id (String) — 이 데이터 파트를 만든 INSERT 쿼리의 식별자예요.

  • event_type (Enum8(‘NewPart’ = 1, ‘MergeParts’ = 2, ‘DownloadPart’ = 3, ‘RemovePart’ = 4, ‘MutatePart’ = 5, ‘MovePart’ = 6, ‘MergePartsStart’ = 7, ‘MutatePartStart’ = 8)) — 데이터 파트에서 발생한 이벤트의 유형이에요. 다음 값 중 하나를 가질 수 있어요: NewPart — 새 데이터 파트 삽입, MergePartsStart — 데이터 파트 병합 시작, MergeParts — 데이터 파트 병합 완료, DownloadPart — 데이터 파트 다운로드, RemovePart — DETACH PARTITION 을 사용한 데이터 파트 제거 또는 분리. MutatePartStart — 데이터 파트 돌연변이 시작, MutatePart — 데이터 파트 돌연변이 완료, MovePart — 데이터 파트를 한 디스크에서 다른 디스크로 이동.

  • merge_reason (Enum8(‘NotAMerge’ = 1, ‘RegularMerge’ = 2, ‘TTLDeleteMerge’ = 3, ‘TTLRecompressMerge’ = 4, ‘TTLDropMerge’ = 5)) — MERGE_PARTS 유형 이벤트의 이유예요. 다음 값 중 하나를 가질 수 있어요: NotAMerge — 현재 이벤트가 MERGE_PARTS 외의 유형이에요, RegularMerge — 일반 병합, TTLDeleteMerge, TTLDropMerge — 만료된 데이터 정리, TTLRecompressMerge — 데이터 파트 재압축.

  • merge_algorithm (Enum8(‘Undecided’ = 0, ‘Vertical’ = 1, ‘Horizontal’ = 2)) — MERGE_PARTS 유형 이벤트의 병합 알고리즘이에요. 다음 값 중 하나를 가질 수 있어요: Undecided, Horizontal, Vertical.

  • event_date (Date) — 이벤트 날짜예요.

  • event_time (DateTime) — 이벤트 시간이에요.

  • event_time_microseconds (DateTime64(6)) — 마이크로초 정밀도의 이벤트 시간이에요.

  • duration_ms (UInt64) — 이 작업의 지속 시간이에요.

  • database (String) — 데이터 파트가 있는 데이터베이스의 이름이에요.

  • table (String) — 데이터 파트가 있는 테이블의 이름이에요.

  • table_uuid (UUID) — 데이터 파트가 속한 테이블의 UUID예요.

  • part_name (String) — 데이터 파트의 이름이에요.

  • partition_id (String) — 데이터 파트가 삽입된 파티션의 ID예요. 파티셔닝이 tuple() 로 되어 있으면 이 열은 all 값을 가져요.

  • partition (String) — 파티션 이름이에요.

  • part_type (String) — 파트의 유형이에요. 가능한 값: Wide 및 Compact.

  • part_storage_type (String) — DataPartStorage 의 유형이에요. 가능한 값: Packed - 대부분의 파트 파일이 단일 아카이브에 저장되고(프로젝션과 txn_version.txt 같은 일부 서비스 파일은 별도로 기록돼요), Full - 각 파일이 별도로 저장돼요.

  • disk_name (String) — 데이터 파트가 놓여 있는 디스크 이름이에요.

  • path_on_disk (String) — 데이터 파트 파일이 있는 폴더의 절대 경로예요.

  • rows (UInt64) — 데이터 파트의 행 수예요.

  • size_in_bytes (UInt64) — 디스크에서 데이터 파트의 크기(바이트)예요.

  • merged_from (Array(String)) — 현재 파트를 구성한 소스 파트 이름 배열이에요.

  • bytes_uncompressed (UInt64) — 결과 파트의 압축되지 않은 크기(바이트)예요.

  • read_rows (UInt64) — 병합 중 읽은 행 수예요.

  • read_bytes (UInt64) — 병합 중 읽은 바이트 수예요.

  • peak_memory_usage (UInt64) — 병합 중 사용된 최대 RAM 양이에요.

  • deduplication_block_ids (Array(String)) — 이 파트를 삽입할 때 중복 제거에 사용된 블록 ID 배열이에요.

  • error (UInt16) — 발생한 예외의 오류 코드예요.

  • exception (String) — 발생한 오류의 텍스트 메시지예요.

  • mutation_ids (Array(String)) — MUTATE_PART_START 및 MUTATE_PART 유형 이벤트에 대해 소스 파트(merged_from)에 적용된 돌연변이 ID 배열이에요.

  • ProfileEvents (Map(LowCardinality(String), UInt64)) — 이 작업 중 캡처된 모든 프로파일 이벤트예요.

  • projections_duration_ms (Map(LowCardinality(String), UInt64)) — 프로젝션별 병합/재구축 지속 시간(밀리초)이에요.

별칭(Aliases):

  • ProfileEvents.NamesmapKeys(ProfileEvents) 의 별칭이에요.

  • ProfileEvents.ValuesmapValues(ProfileEvents) 의 별칭이에요.

  • namepart_name 의 별칭이에요.

system.part_log 테이블은 MergeTree 테이블에 처음 데이터를 삽입한 후에 생성돼요.

Example

SELECT * FROM system.part_log LIMIT 1 FORMAT Vertical;
Row 1:
──────
hostname:                clickhouse.eu-central1.internal
query_id:
event_type:              MergeParts
merge_reason:            RegularMerge
merge_algorithm:         Vertical
event_date:              2025-07-19
event_time:              2025-07-19 23:54:19
event_time_microseconds: 2025-07-19 23:54:19.710761
duration_ms:             2158
database:                default
table:                   github_events
table_uuid:              1ad33424-f5f5-402b-ac03-ec82282634ab
part_name:               all_1_7_1
partition_id:            all
partition:               tuple()
part_type:               Wide
part_storage_type:       Full
disk_name:               default
path_on_disk:            ./data/store/1ad/1ad33424-f5f5-402b-ac03-ec82282634ab/all_1_7_1/
rows:                    3285726 -- 3.29 million
size_in_bytes:           438968542 -- 438.97 million
merged_from:             ['all_1_1_0','all_2_2_0','all_3_3_0','all_4_4_0','all_5_5_0','all_6_6_0','all_7_7_0']
bytes_uncompressed:      1373137767 -- 1.37 billion
read_rows:               3285726 -- 3.29 million
read_bytes:              1429206946 -- 1.43 billion
peak_memory_usage:       303611887 -- 303.61 million
error:                   0
exception:
mutation_ids:
ProfileEvents:           {'FileOpen':703,'ReadBufferFromFileDescriptorRead':3824,'ReadBufferFromFileDescriptorReadBytes':439601681,'WriteBufferFromFileDescriptorWrite':592,'WriteBufferFromFileDescriptorWriteBytes':438988500,'ReadCompressedBytes':439601681,'CompressedReadBufferBlocks':6314,'CompressedReadBufferBytes':1539835748,'OpenedFileCacheHits':50,'OpenedFileCacheMisses':484,'OpenedFileCacheMicroseconds':222,'IOBufferAllocs':1914,'IOBufferAllocBytes':319810140,'ArenaAllocChunks':8,'ArenaAllocBytes':131072,'MarkCacheMisses':7,'CreatedReadBufferOrdinary':534,'DiskReadElapsedMicroseconds':139058,'DiskWriteElapsedMicroseconds':51639,'AnalyzePatchRangesMicroseconds':28,'ExternalProcessingFilesTotal':1,'RowsReadByMainReader':170857759,'WaitMarksLoadMicroseconds':988,'LoadedMarksFiles':7,'LoadedMarksCount':14,'LoadedMarksMemoryBytes':728,'Merge':2,'MergeSourceParts':14,'MergedRows':3285733,'MergedColumns':4,'GatheredColumns':51,'MergedUncompressedBytes':1429207058,'MergeTotalMilliseconds':2158,'MergeExecuteMilliseconds':2155,'MergeHorizontalStageTotalMilliseconds':145,'MergeHorizontalStageExecuteMilliseconds':145,'MergeVerticalStageTotalMilliseconds':2008,'MergeVerticalStageExecuteMilliseconds':2006,'MergeProjectionStageTotalMilliseconds':5,'MergeProjectionStageExecuteMilliseconds':4,'MergingSortedMilliseconds':7,'GatheringColumnMilliseconds':56,'ContextLock':2091,'PartsLockHoldMicroseconds':77,'PartsLockWaitMicroseconds':1,'RealTimeMicroseconds':2157475,'CannotWriteToWriteBufferDiscard':36,'LogTrace':6,'LogDebug':59,'LoggerElapsedNanoseconds':514040,'ConcurrencyControlSlotsGranted':53,'ConcurrencyControlSlotsAcquired':53}