Skip to main content
These settings are available in system.settings and are autogenerated from source.

force_optimize_projection

Enables or disables the obligatory use of projections in SELECT queries, when projection optimization is enabled (see optimize_use_projections setting). Possible values:
  • 0 — Projection optimization is not obligatory.
  • 1 — Projection optimization is obligatory.

force_optimize_projection_name

If it is set to a non-empty string, check that this projection is used in the query at least once. Possible values:
  • string: name of projection that used in a query

force_optimize_skip_unused_shards

Enables or disables query execution if optimize_skip_unused_shards is enabled and skipping of unused shards is not possible. If the skipping is not possible and the setting is enabled, an exception will be thrown. Possible values:
  • 0 — Disabled. ClickHouse does not throw an exception.
  • 1 — Enabled. Query execution is disabled only if the table has a sharding key.
  • 2 — Enabled. Query execution is disabled regardless of whether a sharding key is defined for the table.

force_optimize_skip_unused_shards_nesting

Controls force_optimize_skip_unused_shards (hence still requires force_optimize_skip_unused_shards) depends on the nesting level of the distributed query (case when you have Distributed table that look into another Distributed table). Possible values:
  • 0 - Disabled, force_optimize_skip_unused_shards works always.
  • 1 — Enables force_optimize_skip_unused_shards only for the first level.
  • 2 — Enables force_optimize_skip_unused_shards up to the second level.
Last modified on July 23, 2026