v.25.12New Feature

Projection level settings

Introduce projection-level settings, exposed through the new WITH SETTINGS clause in ALTER TABLE ... ADD PROJECTION. These settings allow projections to override certain MergeTree storage parameters (e.g. index_granularity, index_granularity_bytes) on a per-projection basis. #90158 (Amos Bird).
Introduces projection-level settings via the new WITH SETTINGS clause in ALTER TABLE ... ADD PROJECTION, allowing projections to override specific MergeTree storage parameters such as index_granularity and index_granularity_bytes.

Why it matters

This feature enables finer control over MergeTree projection configurations by allowing users to set storage parameters individually per projection. It solves the problem of uniform storage settings across all projections, enhancing optimization and adaptability for different query workloads and storage patterns.

How to use it

When adding a projection to a table, use the new WITH SETTINGS clause within the ALTER TABLE ... ADD PROJECTION statement to specify desired parameters. For example:

ALTER TABLE table_name ADD PROJECTION projection_name
AS SELECT ...
WITH SETTINGS index_granularity = 8192, index_granularity_bytes = 1048576

This overrides the default MergeTree settings only for the specified projection.