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

> データの追加やマージなど、MergeTree family テーブルのデータパーツで発生したイベントに関する情報を含むシステムテーブル。

# system.part_log

<Info>
  **ClickHouse Cloud でのクエリ**

  このシステムテーブルのデータは、ClickHouse Cloud の各ノードにローカルに保持されています。したがって、すべてのデータを完全に把握するには、`clusterAllReplicas` 関数を使用する必要があります。詳細については、[こちら](/ja/reference/system-tables/overview#system-tables-in-clickhouse-cloud)を参照してください。
</Info>

<div id="description">
  ## 説明
</div>

`system.part_log` テーブルは、[part\_log](/ja/reference/settings/server-settings/settings#part_log) サーバー設定が指定されている場合にのみ作成されます。

このテーブルには、[MergeTree](/ja/reference/engines/table-engines/mergetree-family/mergetree) ファミリーのテーブルにある [データパーツ](/ja/reference/engines/table-engines/mergetree-family/custom-partitioning-key) に対して発生したイベント (データの追加やマージなど) に関する情報が含まれています。

`system.part_log` テーブルには、次のカラムが含まれています：

<div id="columns">
  ## カラム
</div>

* `hostname` ([LowCardinality(String)](/ja/reference/data-types/lowcardinality)) — クエリを実行しているサーバーのホスト名です。
* `query_id` ([String](/ja/reference/data-types/string)) — このデータパートを作成した INSERT クエリの識別子。
* `event_type` ([Enum8('NewPart' = 1, 'MergeParts' = 2, 'DownloadPart' = 3, 'RemovePart' = 4, 'MutatePart' = 5, 'MovePart' = 6, 'MergePartsStart' = 7, 'MutatePartStart' = 8)](/ja/reference/data-types/enum)) — データパーツで発生したイベントの種類。次のいずれかの値を取ります: NewPart — 新しいデータパーツの挿入、MergePartsStart — データパーツのマージが開始された、MergeParts — データパーツのマージが完了した、DownloadPart — データパーツのダウンロード、RemovePart — [DETACH PARTITION](/ja/reference/statements/alter/partition#detach-partitionpart) を使用したデータパーツの削除またはデタッチ。MutatePartStart — データパーツの変更が開始された、MutatePart — データパーツの変更が完了した、MovePart — データパーツをあるディスクから別のディスクへ移動する。
* `merge_reason` ([Enum8('NotAMerge' = 1, 'RegularMerge' = 2, 'TTLDeleteMerge' = 3, 'TTLRecompressMerge' = 4, 'TTLDropMerge' = 5)](/ja/reference/data-types/enum)) — MERGE\_PARTS 型のイベントが発生した理由です。取り得る値は次のとおりです: NotAMerge — 現在のイベントの型は MERGE\_PARTS ではありません。RegularMerge — 通常のマージです。TTLDeleteMerge、TTLDropMerge — 有効期限切れのデータのクリーンアップです。TTLRecompressMerge — データパートの再圧縮です。
* `merge_algorithm` ([Enum8('Undecided' = 0, 'Vertical' = 1, 'Horizontal' = 2)](/ja/reference/data-types/enum)) — タイプが MERGE\_PARTS のイベントのマージアルゴリズム。取り得る値は次のいずれかです: Undecided、Horizontal、Vertical
* `event_date` ([Date](/ja/reference/data-types/date)) — イベント日付。
* `event_time` ([DateTime](/ja/reference/data-types/datetime)) — イベントの時刻。
* `event_time_microseconds` ([DateTime64(6)](/ja/reference/data-types/datetime64)) — マイクロ秒精度のイベント時刻。
* `duration_ms` ([UInt64](/ja/reference/data-types/int-uint)) — この操作の継続時間。
* `database` ([String](/ja/reference/data-types/string)) — data part が属するデータベース名。
* `table` ([String](/ja/reference/data-types/string)) — データパートが属するテーブルの名前。
* `table_uuid` ([UUID](/ja/reference/data-types/uuid)) — そのデータパートが属するテーブルの UUID。
* `part_name` ([String](/ja/reference/data-types/string)) — データパート名。
* `partition_id` ([String](/ja/reference/data-types/string)) — データパートが挿入された先のパーティションの ID です。パーティション化に `tuple()` が使用されている場合、このカラムは `all` の値を取ります。
* `partition` ([String](/ja/reference/data-types/string)) — パーティションの名前。
* `part_type` ([String](/ja/reference/data-types/string)) — パーツの種類。設定可能な値: wide パーツ、compact パーツ。
* `part_storage_type` ([String](/ja/reference/data-types/string)) — DataPartStorage の種類。設定可能な値: Packed - すべてのファイルが 1 つのブロブに保存されます。Full - 各ファイルがそれぞれ 1 つのブロブに保存されます。
* `disk_name` ([String](/ja/reference/data-types/string)) — データパートが格納されているディスク名。
* `path_on_disk` ([String](/ja/reference/data-types/string)) — データパートのファイルが格納されているフォルダーへの絶対パス。
* `rows` ([UInt64](/ja/reference/data-types/int-uint)) — データパート内の行数。
* `size_in_bytes` ([UInt64](/ja/reference/data-types/int-uint)) — ディスク上のデータ part のサイズ (バイト単位) 。
* `merged_from` ([Array(String)](/ja/reference/data-types/array)) — 現在のパーツの元になったソースパーツ名の配列。
* `bytes_uncompressed` ([UInt64](/ja/reference/data-types/int-uint)) — 生成されたパートの非圧縮サイズ (バイト単位) 。
* `read_rows` ([UInt64](/ja/reference/data-types/int-uint)) — マージ中に読み取られた行数。
* `read_bytes` ([UInt64](/ja/reference/data-types/int-uint)) — マージ中に読み込まれたバイト数。
* `peak_memory_usage` ([UInt64](/ja/reference/data-types/int-uint)) — merge 中に使用された RAM の最大使用量
* `deduplication_block_ids` ([Array(String)](/ja/reference/data-types/array)) — このパートの挿入時に重複排除で使用される block ID の配列。
* `error` ([UInt16](/ja/reference/data-types/int-uint)) — 発生した例外のエラーコードです。
* `exception` ([String](/ja/reference/data-types/string)) — 発生したエラーのメッセージ。
* `mutation_ids` ([Array(String)](/ja/reference/data-types/array)) — 型が MUTATE\_PART\_START および MUTATE\_PART のイベントで、ソースパート (merged\_from) に適用された mutation ID の配列。
* `ProfileEvents` ([Map(LowCardinality(String), UInt64)](/ja/reference/data-types/map)) — この操作で収集されたすべてのプロファイルイベント。
* `projections_duration_ms` ([Map(LowCardinality(String), UInt64)](/ja/reference/data-types/map)) — 各プロジェクションのマージ/再構築に要した時間 (ミリ秒) 。

**別名:**

* `ProfileEvents.Names` — `mapKeys(ProfileEvents)` の別名
* `ProfileEvents.Values` — `mapValues(ProfileEvents)` の別名
* `name` — `part_name` の別名

`system.part_log` テーブルは、`MergeTree` テーブルに初めてデータが挿入された後に作成されます。

<div id="example">
  ## 例
</div>

```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 -- 329万
size_in_bytes:           438968542 -- 4億3897万
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 -- 13億7000万
read_rows:               3285726 -- 329万
read_bytes:              1429206946 -- 14億3000万
peak_memory_usage:       303611887 -- 3億361万
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}
```
