> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# optimize_redundant_* session settings

> ClickHouse session settings in the optimize_redundant_* generated group.

These settings are available in [system.settings](https://clickhouse.com/docs/reference/system-tables/settings.md) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## optimize\_redundant\_comparisons

Type

Bool

Default

1

Detect conflicting and redundant comparison conditions on the same expression within AND chains. For example, `a < 1 AND a > 5` would be rewritten to `false`. A contradiction between two `equals` on the same expression (for example, `a = 1 AND a = 2`) is detected independently of this setting.

## optimize\_redundant\_functions\_in\_order\_by

Type

Bool

Default

1

Remove functions from ORDER BY if its argument is also in ORDER BY
