> ## 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.

# rewrite_* session settings

> ClickHouse session settings in the rewrite_* 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).

## rewrite\_count\_distinct\_if\_with\_count\_distinct\_implementation

Type

Bool

Default

0

Allows you to rewrite `countDistcintIf` with [count\_distinct\_implementation](https://clickhouse.com/docs/reference/settings/session-settings/count-distinct.md#count_distinct_implementation) setting.

Possible values:

* true — Allow.
* false — Disallow.

## rewrite\_in\_to\_join

[Experimental feature](https://clickhouse.com/docs/reference/settings/beta-and-experimental-features.md#experimental-features)

Type

Bool

Default

0

Rewrite expressions like 'x IN subquery' to JOIN. This might be useful for optimizing the whole query with join reordering.
