Skip to main content
Skip to main content

system.part_log

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the clusterAllReplicas function. See here for further details.

Description

The system.part_log table is created only if the part_log server setting is specified.

This table contains information about events that occurred with data parts in the MergeTree family tables, such as adding or merging data.

The system.part_log table contains the following columns:

Columns

  • hostname (LowCardinality(String)) — Hostname of the server executing the query.
  • query_id (String) — Identifier of the INSERT query that created this data part.
  • event_type (Enum8('NewPart' = 1, 'MergeParts' = 2, 'DownloadPart' = 3, 'RemovePart' = 4, 'MutatePart' = 5, 'MovePart' = 6, 'MergePartsStart' = 7, 'MutatePartStart' = 8)) — Type of the event that occurred with the data part. Can have one of the following values: NewPart — Inserting of a new data part, MergePartsStart — Merging of data parts has started, MergeParts — Merging of data parts has finished, DownloadPart — Downloading a data part, RemovePart — Removing or detaching a data part using DETACH PARTITION.MutatePartStart — Mutating of a data part has started, MutatePart — Mutating of a data part has finished, MovePart — Moving the data part from the one disk to another one.
  • merge_reason (Enum8('NotAMerge' = 1, 'RegularMerge' = 2, 'TTLDeleteMerge' = 3, 'TTLRecompressMerge' = 4, 'TTLDropMerge' = 5)) — The reason for the event with type MERGE_PARTS. Can have one of the following values: NotAMerge — The current event has the type other than MERGE_PARTS, RegularMerge — Some regular merge, TTLDeleteMerge, TTLDropMerge — Cleaning up expired data. TTLRecompressMerge — Recompressing data part with the.
  • merge_algorithm (Enum8('Undecided' = 0, 'Vertical' = 1, 'Horizontal' = 2)) — Merge algorithm for the event with type MERGE_PARTS. Can have one of the following values: Undecided, Horizontal, Vertical
  • event_date (Date) — Event date.
  • event_time (DateTime) — Event time.
  • event_time_microseconds (DateTime64(6)) — Event time with microseconds precision.
  • duration_ms (UInt64) — Duration of this operation.
  • database (String) — Name of the database the data part is in.
  • table (String) — Name of the table the data part is in.
  • table_uuid (UUID) — UUID of the table the data part belongs to.
  • part_name (String) — Name of the data part.
  • partition_id (String) — ID of the partition that the data part was inserted to. The column takes the all value if the partitioning is by tuple().
  • partition (String) — The partition name.
  • part_type (String) — The type of the part. Possible values: Wide and Compact.
  • part_storage_type (String) — The type of DataPartStorage. Possible values: Packed - all files are stored in a single blob, Full - a blob per file.
  • disk_name (String) — The disk name data part lies on.
  • path_on_disk (String) — Absolute path to the folder with data part files.
  • rows (UInt64) — The number of rows in the data part.
  • size_in_bytes (UInt64) — Size of the data part on disk in bytes.
  • merged_from (Array(String)) — An array of the source parts names which the current part was made up from.
  • bytes_uncompressed (UInt64) — Uncompressed size of the resulting part in bytes.
  • read_rows (UInt64) — The number of rows was read during the merge.
  • read_bytes (UInt64) — The number of bytes was read during the merge.
  • peak_memory_usage (UInt64) — The maximum amount of used during merge RAM
  • deduplication_block_ids (Array(String)) — An array of block IDs used for deduplication when inserting this part.
  • error (UInt16) — The error code of the occurred exception.
  • exception (String) — Text message of the occurred error.
  • mutation_ids (Array(String)) — An array of mutation IDs applied to the source part (merged_from) for the event with type MUTATE_PART_START and MUTATE_PART.
  • ProfileEvents (Map(LowCardinality(String), UInt64)) — All the profile events captured during this operation.
  • projections_duration_ms (Map(LowCardinality(String), UInt64)) — Per-projection merge/rebuild duration in milliseconds.

Aliases:

  • ProfileEvents.Names — Alias for mapKeys(ProfileEvents).
  • ProfileEvents.Values — Alias for mapValues(ProfileEvents).
  • name — Alias for part_name.

The system.part_log table is created after the first inserting data to the MergeTree table.

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
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}