メインコンテンツへスキップ
メインコンテンツへスキップ

system.part_log

ClickHouse Cloud でのクエリ実行

このシステムテーブルのデータは、ClickHouse Cloud の各ノードにローカルに格納されています。そのため、すべてのデータを包括的に確認するには、clusterAllReplicas 関数を使用する必要があります。詳細についてはこちらを参照してください。

説明

system.part_log テーブルは、part_log サーバー設定が指定されている場合にのみ作成されます。

このテーブルには、データの追加やマージなど、MergeTree ファミリーテーブルのデータパーツで発生したイベントに関する情報が含まれています。

system.part_log テーブルには次のカラムが含まれます:

カラム

  • hostname (LowCardinality(String)) — クエリを実行しているサーバーのホスト名。
  • 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)) — type が 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) — part のタイプです。設定可能な値: Wide および Compact。
  • part_storage_type (String) — DataPartStorage のタイプ。設定可能な値: Packed - すべてのファイルが 1 つのブロブに格納される、Full - ファイルごとに 1 つのブロブが格納される。
  • 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)) — type が MUTATE_PART_START および MUTATE_PART のイベントで、ソースパート (merged_from) に適用された mutation ID の配列。
  • ProfileEvents (Map(LowCardinality(String), UInt64)) — この操作中に記録されたすべての profile events。
  • projections_duration_ms (Map(LowCardinality(String), UInt64)) — プロジェクションごとのマージ/再構築にかかった時間 (ミリ秒) 。

別名:

  • ProfileEvents.NamesmapKeys(ProfileEvents) のエイリアスです。
  • ProfileEvents.ValuesmapValues(ProfileEvents) のエイリアスです。
  • namepart_name のエイリアスです。

system.part_log テーブルは、MergeTree テーブルに最初のデータを挿入した後に作成されます。

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}