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
Version history
| Version | Default value | Comment |
|---|---|---|
| 26.4 | 1 | Enable arrayExists to has rewrite optimization by default, now that type compatibility is checked before rewriting. |
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
Version history
| Version | Default value | Comment |
|---|---|---|
| 26.6 | 1 | New setting |
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
Version history
| Version | Default value | Comment |
|---|---|---|
| 25.10 | 1 | New setting |
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
Version history
| Version | Default value | Comment |
|---|---|---|
| 25.8 | 1 | A new setting |
Rewrite regular expression related functions into simpler and more efficient forms
optimize_rewrite_sum_if_to_count_if
Version history
| Version | Default value | Comment |
|---|---|---|
| 24.4 | 1 | Only available for the analyzer, where it works correctly |
Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent