Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

correlated_subqueries_* session settings

These settings are available in system.settings and are autogenerated from source.

correlated_subqueries_default_join_kind

Type
DecorrelationJoinKind
Default
right
Version history
VersionDefault valueComment
25.11rightNew setting. Default join kind for decorrelated query plan.
25.10rightNew setting. Default join kind for decorrelated query plan.

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
Version history
VersionDefault valueComment
25.71New setting to correlated subquery planning optimization.

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
Version history
VersionDefault valueComment
26.11Use in-memory buffer for input of correlated subqueries by default.

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

Navigation