v.1.1.54310New Feature

Custom Partitioning Key for MergeTree Table Engines

Custom partitioning key for the MergeTree family of table engines.
Introduces a feature allowing users to define a custom partitioning key for tables using the MergeTree family of engines in ClickHouse.

Why it matters

This feature enables more flexible and fine-grained control over data partitioning in MergeTree tables. It helps solve problems related to default partitioning schemes that may not fit specific data distribution or query optimization needs, improving performance and manageability of large datasets.

How to use it

When creating or altering a MergeTree family table, users can specify a custom partition key expression using the new syntax PARTITION BY <expression>. This expression determines how data is partitioned, allowing optimization for query patterns and storage. For example:
CREATE TABLE example_table ( ... ) ENGINE = MergeTree() PARTITION BY toYYYYMM(custom_date_column) ORDER BY id;