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

# correlated_subqueries_* session settings

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

## correlated\_subqueries\_default\_join\_kind

Type

DecorrelationJoinKind

Default

right

Controls the kind of joins in the decorrelated query plan. The default value is `right`, which means that decorrelated plan will contain RIGHT JOINs with subquery input on the right side.

Possible values:

* `left` - Decorrelation process will produce LEFT JOINs and input table will appear on the left side.
* `right` - Decorrelation process will produce RIGHT JOINs and input table will appear on the right side.

When the subquery input is shared through an in-memory buffer (see `correlated_subqueries_use_in_memory_buffer`), `right` is used regardless of this setting, because only that layout evaluates the buffer writer before its reader. The join kind is an internal detail of the decorrelated plan and does not change the result.

## correlated\_subqueries\_substitute\_equivalent\_expressions

Type

Bool

Default

1

Use filter expressions to inference equivalent expressions and substitute them instead of creating a CROSS JOIN.

## correlated\_subqueries\_use\_in\_memory\_buffer

Type

Bool

Default

1

Use in-memory buffer for correlated subquery input to avoid its repeated evaluation.
