설명
system.part_log 테이블은 part_log 서버 설정이 지정된 경우에만 생성됩니다.
이 테이블에는 데이터 추가나 머지와 같이 MergeTree 엔진 계열 테이블의 데이터 파트에서 발생한 이벤트 정보가 포함됩니다.
system.part_log 테이블에는 다음 컬럼이 포함됩니다:
컬럼
hostname(LowCardinality(String)) — 쿼리를 실행하는 server의 호스트명입니다.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, Verticalevent_date(Date) — 이벤트 날짜.event_time(DateTime) — 이벤트 발생 시간입니다.event_time_microseconds(DateTime64(6)) — 마이크로초 단위 정밀도의 이벤트 시간입니다.duration_ms(UInt64) — 이 작업의 소요 시간입니다.database(String) — 데이터 파트가 속한 데이터베이스의 이름입니다.table(String) — data part가 속한 테이블 이름입니다.table_uuid(UUID) — 데이터 파트(data part)가 속한 테이블의 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) — data part가 저장된 디스크 이름입니다.path_on_disk(String) — data part 파일이 저장된 폴더의 절대 경로입니다.rows(UInt64) — 데이터 파트에 있는 행 수입니다.size_in_bytes(UInt64) — 디스크에 저장된 데이터 파트의 크기(바이트 단위)입니다.merged_from(배열(String)) — 현재 파트를 구성한 원본 파트 이름들의 배열입니다.bytes_uncompressed(UInt64) — 결과 part의 바이트 단위 압축되지 않은 크기입니다.read_rows(UInt64) — 머지 중에 읽은 행 수입니다.read_bytes(UInt64) — 머지 중에 읽은 바이트 수입니다.peak_memory_usage(UInt64) — 머지 중 사용된 RAM의 최대 사용량deduplication_block_ids(Array(String)) — 이 part를 삽입할 때 중복 제거에 사용되는 block ID의 배열입니다.error(UInt16) — 발생한 예외에 대한 오류 코드입니다.exception(String) — 발생한 오류에 대한 텍스트 메시지입니다.mutation_ids(Array(String)) — 유형이 MUTATE_PART_START 및 MUTATE_PART인 이벤트에서 원본 파트(merged_from)에 적용된 mutation ID의 배열입니다.ProfileEvents(Map(LowCardinality(String), UInt64)) — 이 작업 중에 수집된 모든 프로파일 이벤트입니다.projections_duration_ms(Map(LowCardinality(String), UInt64)) — 프로젝션별 머지/재구축에 걸린 시간(밀리초)입니다.
별칭:
ProfileEvents.Names—mapKeys(ProfileEvents)를 가리키는 별칭입니다.ProfileEvents.Values—mapValues(ProfileEvents)를 가리키는 별칭입니다.name—part_name을 가리키는 별칭입니다.
MergeTree 테이블에 처음으로 데이터를 삽입한 후 system.part_log 테이블이 생성됩니다.
예시
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}