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

optimize_rewrite_aggregate_function_with_if

Rewrite aggregate functions with if expression as argument when logically equivalent. For example, avg(if(cond, col, null)) can be rewritten to avgOrNullIf(cond, col). It may improve performance.

optimize_rewrite_array_exists_to_has

Rewrite arrayExists() functions to has() when logically equivalent. For example, arrayExists(x -> x = 1, arr) can be rewritten to has(arr, 1)

optimize_rewrite_has_to_in

Rewrite has functions to IN when the first argument is a constant array. For example, has([1, 2, 3], x) can be rewritten to x IN [1, 2, 3] for better performance with constant arrays

optimize_rewrite_like_perfect_affix

Rewrite LIKE expressions with perfect prefix or suffix (e.g. col LIKE 'ClickHouse%') to startsWith or endsWith functions (e.g. startsWith(col, 'ClickHouse')).

optimize_rewrite_regexp_functions

Rewrite regular expression related functions into simpler and more efficient forms

optimize_rewrite_sum_if_to_count_if

Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent
Last modified on September 16, 2026