> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> System table containing information about events that occurred with data parts in the MergeTree family tables, such as adding or merging of data.

# system.part_log

<Info>
  **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](/reference/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.
</Info>

<h2 id="description">
  Description
</h2>

The `system.part_log` table is created only if the [part\_log](/reference/settings/server-settings/settings#part_log) server setting is specified.

This table contains information about events that occurred with [data parts](/reference/engines/table-engines/mergetree-family/custom-partitioning-key) in the [MergeTree](/reference/engines/table-engines/mergetree-family/mergetree) family tables, such as adding or merging data.

The `system.part_log` table contains the following columns:

<h2 id="columns">
  Columns
</h2>

* `hostname` ([LowCardinality(String)](/reference/data-types/lowcardinality)) — Hostname of the server executing the query.
* `query_id` ([String](/reference/data-types/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)](/reference/data-types/enum)) — 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](/reference/statements/alter/partition#detach-partitionpart).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)](/reference/data-types/enum)) — 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)](/reference/data-types/enum)) — Merge algorithm for the event with type MERGE\_PARTS. Can have one of the following values: Undecided, Horizontal, Vertical
* `event_date` ([Date](/reference/data-types/date)) — Event date.
* `event_time` ([DateTime](/reference/data-types/datetime)) — Event time.
* `event_time_microseconds` ([DateTime64(6)](/reference/data-types/datetime64)) — Event time with microseconds precision.
* `duration_ms` ([UInt64](/reference/data-types/int-uint)) — Duration of this operation.
* `database` ([String](/reference/data-types/string)) — Name of the database the data part is in.
* `table` ([String](/reference/data-types/string)) — Name of the table the data part is in.
* `table_uuid` ([UUID](/reference/data-types/uuid)) — UUID of the table the data part belongs to.
* `part_name` ([String](/reference/data-types/string)) — Name of the data part.
* `partition_id` ([String](/reference/data-types/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](/reference/data-types/string)) — The partition name.
* `part_type` ([String](/reference/data-types/string)) — The type of the part. Possible values: Wide and Compact.
* `part_storage_type` ([String](/reference/data-types/string)) — The type of DataPartStorage. Possible values: Packed - all files are stored in a single blob, Full - a blob per file.
* `disk_name` ([String](/reference/data-types/string)) — The disk name data part lies on.
* `path_on_disk` ([String](/reference/data-types/string)) — Absolute path to the folder with data part files.
* `rows` ([UInt64](/reference/data-types/int-uint)) — The number of rows in the data part.
* `size_in_bytes` ([UInt64](/reference/data-types/int-uint)) — Size of the data part on disk in bytes.
* `merged_from` ([Array(String)](/reference/data-types/array)) — An array of the source parts names which the current part was made up from.
* `bytes_uncompressed` ([UInt64](/reference/data-types/int-uint)) — Uncompressed size of the resulting part in bytes.
* `read_rows` ([UInt64](/reference/data-types/int-uint)) — The number of rows was read during the merge.
* `read_bytes` ([UInt64](/reference/data-types/int-uint)) — The number of bytes was read during the merge.
* `peak_memory_usage` ([UInt64](/reference/data-types/int-uint)) — The maximum amount of used during merge RAM
* `deduplication_block_ids` ([Array(String)](/reference/data-types/array)) — An array of block IDs used for deduplication when inserting this part.
* `error` ([UInt16](/reference/data-types/int-uint)) — The error code of the occurred exception.
* `exception` ([String](/reference/data-types/string)) — Text message of the occurred error.
* `mutation_ids` ([Array(String)](/reference/data-types/array)) — 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)](/reference/data-types/map)) — All the profile events captured during this operation.
* `projections_duration_ms` ([Map(LowCardinality(String), UInt64)](/reference/data-types/map)) — 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.

<h2 id="example">
  Example
</h2>

```sql theme={null}
SELECT * FROM system.part_log LIMIT 1 FORMAT Vertical;
```

```text theme={null}
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}
```
