> ## 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_* 会话设置

> ClickHouse 在 rewrite_* 自动生成分组中的会话设置。

这些设置可在 [system.settings](https://clickhouse.com/docs/zh/reference/system-tables/settings.md) 中查看，并由 [源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

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

类型

Bool

默认值

0

允许通过 [count\_distinct\_implementation](https://clickhouse.com/docs/zh/reference/settings/session-settings/count-distinct.md#count_distinct_implementation) 设置将 `countDistcintIf` 重写。

可能值：

* true — 允许。
* false — 不允许。

## rewrite\_in\_to\_join

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

类型

Bool

默认值

0

将类似 'x IN subquery' 的表达式重写为 JOIN。这可能有助于通过重排 join 顺序来优化整个查询。
