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

optimize_move_to_prewhere

Enables or disables automatic PREWHERE optimization in SELECT queries. Works only for *MergeTree tables. Possible values:
  • 0 — Automatic PREWHERE optimization is disabled.
  • 1 — Automatic PREWHERE optimization is enabled.

optimize_move_to_prewhere_if_final

Enables or disables automatic PREWHERE optimization in SELECT queries with FINAL modifier. Only conditions that depend on the sorting key alone and are deterministic within the query are moved, so the result of FINAL is not affected. Works only for *MergeTree tables. Possible values:
  • 0 — Automatic PREWHERE optimization in SELECT queries with FINAL modifier is disabled.
  • 1 — Automatic PREWHERE optimization in SELECT queries with FINAL modifier is enabled.
See Also
Last modified on September 26, 2026