v.25.12New Feature
Projection level settings
Introduce projection-level settings, exposed through the newWITH SETTINGSclause inALTER 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).
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 newWITH 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 = 1048576This overrides the default MergeTree settings only for the specified projection.