clickhouse

What is the difference between the part_type value wide and compact in clickhouse?


I want to know the difference between the part_type(a column in system.parts) value wide and compact in clickhouse and the meaning of parameter min_bytes_for_wide_part.

I want to know the difference between the part_type(a column in system.parts) value wide and compact in clickhouse and the meaning of parameter `min_bytes_for_wide_part`.


Solution

  • https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-data-storage

    Data parts can be stored in Wide or Compact format. In Wide format each column is stored in a separate file in a filesystem, in Compact format all columns are stored in one file. Compact format can be used to increase performance of small and frequent inserts.

    Data storing format is controlled by the min_bytes_for_wide_part and min_rows_for_wide_part settings of the table engine. If the number of bytes or rows in a data part is less then the corresponding setting's value, the part is stored in Compact format. Otherwise it is stored in Wide format. If none of these settings is set, data parts are stored in Wide format.