system.parts_columns

Contains information about parts and columns of MergeTree tables.

Each row describes one data part.

Columns:

  • partition (String) — The partition name. To learn what a partition is, see the description of the ALTER query.

    Formats:

    • YYYYMM for automatic partitioning by month.
    • any_string when partitioning manually.
  • name (String) — Name of the data part.

  • part_type (String) — The data part storing format.

    Possible values:

    • Wide — Each column is stored in a separate file in a filesystem.
    • Compact — All columns are stored in one file in a filesystem.

    Data storing format is controlled by the min_bytes_for_wide_part and min_rows_for_wide_part settings of the MergeTree table.

  • active (UInt8) — Flag that indicates whether the data part is active. If a data part is active, it’s used in a table. Otherwise, it’s deleted. Inactive data parts remain after merging.

  • marks (UInt64) — The number of marks. To get the approximate number of rows in a data part, multiply marks by the index granularity (usually 8192) (this hint doesn’t work for adaptive granularity).

  • rows (UInt64) — The number of rows.

  • bytes_on_disk (UInt64) — Total size of all the data part files in bytes.

  • data_compressed_bytes (UInt64) — Total size of compressed data in the data part. All the auxiliary files (for example, files with marks) are not included.

  • data_uncompressed_bytes (UInt64) — Total size of uncompressed data in the data part. All the auxiliary files (for example, files with marks) are not included.

  • marks_bytes (UInt64) — The size of the file with marks.

  • modification_time (DateTime) — The time the directory with the data part was modified. This usually corresponds to the time of data part creation.

  • remove_time (DateTime) — The time when the data part became inactive.

  • refcount (UInt32) — The number of places where the data part is used. A value greater than 2 indicates that the data part is used in queries or merges.

  • min_date (Date) — The minimum value of the date key in the data part.

  • max_date (Date) — The maximum value of the date key in the data part.

  • partition_id (String) — ID of the partition.

  • min_block_number (UInt64) — The minimum number of data parts that make up the current part after merging.

  • max_block_number (UInt64) — The maximum number of data parts that make up the current part after merging.

  • level (UInt32) — Depth of the merge tree. Zero means that the current part was created by insert rather than by merging other parts.

  • data_version (UInt64) — Number that is used to determine which mutations should be applied to the data part (mutations with a version higher than data_version).

  • primary_key_bytes_in_memory (UInt64) — The amount of memory (in bytes) used by primary key values.

  • primary_key_bytes_in_memory_allocated (UInt64) — The amount of memory (in bytes) reserved for primary key values.

  • database (String) — Name of the database.

  • table (String) — Name of the table.

  • engine (String) — Name of the table engine without parameters.

  • disk_name (String) — Name of a disk that stores the data part.

  • path (String) — Absolute path to the folder with data part files.

  • column (String) — Name of the column.

  • type (String) — Column type.

  • column_position (UInt64) — Ordinal position of a column in a table starting with 1.

  • default_kind (String) — Expression type (DEFAULT, MATERIALIZED, ALIAS) for the default value, or an empty string if it is not defined.

  • default_expression (String) — Expression for the default value, or an empty string if it is not defined.

  • column_bytes_on_disk (UInt64) — Total size of the column in bytes.

  • column_data_compressed_bytes (UInt64) — Total size of compressed data in the column, in bytes.

  • column_data_uncompressed_bytes (UInt64) — Total size of the decompressed data in the column, in bytes.

  • column_marks_bytes (UInt64) — The size of the column with marks, in bytes.

  • bytes (UInt64) — Alias for bytes_on_disk.

  • marks_size (UInt64) — Alias for marks_bytes.

Example

  1. SELECT * FROM system.parts_columns LIMIT 1 FORMAT Vertical;
  1. Row 1:
  2. ──────
  3. partition: tuple()
  4. name: all_1_2_1
  5. part_type: Wide
  6. active: 1
  7. marks: 2
  8. rows: 2
  9. bytes_on_disk: 155
  10. data_compressed_bytes: 56
  11. data_uncompressed_bytes: 4
  12. marks_bytes: 96
  13. modification_time: 2020-09-23 10:13:36
  14. remove_time: 2106-02-07 06:28:15
  15. refcount: 1
  16. min_date: 1970-01-01
  17. max_date: 1970-01-01
  18. partition_id: all
  19. min_block_number: 1
  20. max_block_number: 2
  21. level: 1
  22. data_version: 1
  23. primary_key_bytes_in_memory: 2
  24. primary_key_bytes_in_memory_allocated: 64
  25. database: default
  26. table: 53r93yleapyears
  27. engine: MergeTree
  28. disk_name: default
  29. path: /var/lib/clickhouse/data/default/53r93yleapyears/all_1_2_1/
  30. column: id
  31. type: Int8
  32. column_position: 1
  33. default_kind:
  34. default_expression:
  35. column_bytes_on_disk: 76
  36. column_data_compressed_bytes: 28
  37. column_data_uncompressed_bytes: 2
  38. column_marks_bytes: 48

See Also

Original article