system.part_log

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:

  • query_id (String) — Identifier of the INSERT query that created this data part.
  • event_type (Enum8) — Type of the event that occurred with the data part. Can have one of the following values:
    • NEW_PART — Inserting of a new data part.
    • MERGE_PARTS — Merging of data parts.
    • DOWNLOAD_PART — Downloading a data part.
    • REMOVE_PART — Removing or detaching a data part using DETACH PARTITION.
    • MUTATE_PART — Mutating of a data part.
    • MOVE_PART — Moving the data part from the one disk to another one.
  • event_date (Date) — Event date.
  • event_time (DateTime) — Event time.
  • event_time_microseconds (DateTime64) — Event time with microseconds precision.
  • duration_ms (UInt64) — Duration.
  • database (String) — Name of the database the data part is in.
  • table (String) — Name of the table the data part is in.
  • 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().
  • 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 in bytes.
  • merged_from (Array(String)) — An array of names of the parts which the current part was made up from (after the merge).
  • bytes_uncompressed (UInt64) — Size of uncompressed 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 (Int64) — The maximum difference between the amount of allocated and freed memory in context of this thread.
  • error (UInt16) — The code number of the occurred error.
  • exception (String) — Text message of the occurred error.

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

Example

  1. SELECT * FROM system.part_log LIMIT 1 FORMAT Vertical;
  1. Row 1:
  2. ──────
  3. query_id: 983ad9c7-28d5-4ae1-844e-603116b7de31
  4. event_type: NewPart
  5. event_date: 2021-02-02
  6. event_time: 2021-02-02 11:14:28
  7. event_time_microseconds: 2021-02-02 11:14:28.861919
  8. duration_ms: 35
  9. database: default
  10. table: log_mt_2
  11. part_name: all_1_1_0
  12. partition_id: all
  13. path_on_disk: db/data/default/log_mt_2/all_1_1_0/
  14. rows: 115418
  15. size_in_bytes: 1074311
  16. merged_from: []
  17. bytes_uncompressed: 0
  18. read_rows: 0
  19. read_bytes: 0
  20. peak_memory_usage: 0
  21. error: 0
  22. exception: