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

# enable_* session settings

> ClickHouse session settings in the enable_* generated group.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

export const ExperimentalBadge = () => {
  return <div className="experimentalBadge">
            <div className="experimentalIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.25" d="M5.5 2H10.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M9.50015 2V6.19625L13.4283 12.7425C13.4738 12.8183 13.4985 12.9049 13.4996 12.9934C13.5008 13.0818 13.4785 13.169 13.435 13.246C13.3914 13.323 13.3283 13.3871 13.2519 13.4317C13.1755 13.4764 13.0886 13.4999 13.0002 13.5H3.00015C2.91164 13.5 2.8247 13.4766 2.74822 13.432C2.67174 13.3874 2.60847 13.3233 2.56487 13.2463C2.52126 13.1693 2.49889 13.082 2.50004 12.9935C2.50119 12.905 2.52582 12.8184 2.5714 12.7425L6.50015 6.19625V2" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M4.47656 9.56754C5.30344 9.41254 6.47656 9.47942 7.99969 10.25C10.0153 11.2707 11.4216 11.0569 12.2184 10.7282" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            Experimental feature. <u><a href="/docs/docs/beta-and-experimental-features#experimental-features">Learn more.</a></u>
        </div>;
};

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

<h2 id="enable_adaptive_memory_spill_scheduler">
  enable\_adaptive\_memory\_spill\_scheduler
</h2>

<ExperimentalBadge />

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.2"},{"label": "0"},{"label": "New setting. Enable spill memory data into external storage adaptively."}]}]} />

Trigger processor to spill data into external storage adpatively. grace join is supported at present.

<h2 id="enable_add_distinct_to_in_subqueries">
  enable\_add\_distinct\_to\_in\_subqueries
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "0"},{"label": "New setting to reduce the size of temporary tables transferred for distributed IN subqueries."}]}]} />

Enable `DISTINCT` in `IN` subqueries. This is a trade-off setting: enabling it can greatly reduce the size of temporary tables transferred for distributed IN subqueries and significantly speed up data transfer between shards, by ensuring only unique values are sent.
However, enabling this setting adds extra merging effort on each node, as deduplication (DISTINCT) must be performed. Use this setting when network transfer is a bottleneck and the additional merging cost is acceptable.

<h2 id="enable_automatic_decision_for_merging_across_partitions_for_final">
  enable\_automatic\_decision\_for\_merging\_across\_partitions\_for\_final
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.2"},{"label": "1"},{"label": "New setting"}]}]} />

If set, ClickHouse will automatically enable this optimization when the partition key expression is deterministic and all columns used in the partition key expression are included in the primary key.
This automatic derivation ensures that rows with the same primary key values will always belong to the same partition, making it safe to avoid cross-partition merges.

<h2 id="enable_early_constant_folding">
  enable\_early\_constant\_folding
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

Enable query optimization where we analyze function and subqueries results and rewrite query if there are constants there

<h2 id="enable_extended_results_for_datetime_functions">
  enable\_extended\_results\_for\_datetime\_functions
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

Enables or disables returning results of type `Date32` with extended range (compared to type `Date`)
or `DateTime64` with extended range (compared to type `DateTime`).

Possible values:

* `0` — Functions return `Date` or `DateTime` for all types of arguments.
* `1` — Functions return `Date32` or `DateTime64` for `Date32` or `DateTime64` arguments and `Date` or `DateTime` otherwise.

The table below shows the behavior of this setting for various date-time functions.

| Function                  | `enable_extended_results_for_datetime_functions = 0`                             | `enable_extended_results_for_datetime_functions = 1`                                                                     |
| ------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `toStartOfYear`           | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfISOYear`        | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfQuarter`        | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfMonth`          | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfWeek`           | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toLastDayOfWeek`         | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toLastDayOfMonth`        | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toMonday`                | Returns `Date` or `DateTime`                                                     | Returns `Date`/`DateTime` for `Date`/`DateTime` input<br />Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfDay`            | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |
| `toStartOfHour`           | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |
| `toStartOfFifteenMinutes` | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |
| `toStartOfTenMinutes`     | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |
| `toStartOfFiveMinutes`    | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |
| `toStartOfMinute`         | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |
| `timeSlot`                | Returns `DateTime`<br />*Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input<br />Returns `DateTime64` for `Date32`/`DateTime64` input                 |

<h2 id="enable_full_text_index">
  enable\_full\_text\_index
</h2>

**Aliases**: `allow_experimental_full_text_index`

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.2"},{"label": "1"},{"label": "The text index is now GA"}]}, {"id": "row-2","items": [{"label": "25.12"},{"label": "0"},{"label": "Text index was moved to Beta."}]}]} />

If set to true, allow using the text index.

<h2 id="enable_global_with_statement">
  enable\_global\_with\_statement
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "21.2"},{"label": "1"},{"label": "Propagate WITH statements to UNION queries and all subqueries by default"}]}]} />

Propagate WITH statements to UNION queries and all subqueries

<h2 id="enable_hdfs_pread">
  enable\_hdfs\_pread
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.4"},{"label": "1"},{"label": "New setting."}]}]} />

Enable or disables pread for HDFS files. By default, `hdfsPread` is used. If disabled, `hdfsRead` and `hdfsSeek` will be used to read hdfs files.

<h2 id="enable_http_compression">
  enable\_http\_compression
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.10"},{"label": "1"},{"label": "It should be beneficial in general"}]}]} />

Enables or disables data compression in the response to an HTTP request.

For more information, read the [HTTP interface description](/docs/concepts/features/interfaces/http).

Possible values:

* 0 — Disabled.
* 1 — Enabled.

<h2 id="enable_identifier_resolve_cache">
  enable\_identifier\_resolve\_cache
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.6"},{"label": "1"},{"label": "New setting to control the identifier resolution cache in the query analyzer"}]}]} />

Enable the identifier resolution cache in the query analyzer. The cache shares resolved alias nodes to prevent AST explosion when the same alias is referenced multiple times. Set to false to disable caching if incorrect results are suspected.

<h2 id="enable_job_stack_trace">
  enable\_job\_stack\_trace
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "0"},{"label": "The setting was disabled by default to avoid performance overhead."}]}, {"id": "row-2","items": [{"label": "24.11"},{"label": "0"},{"label": "Enables collecting stack traces from job's scheduling. Disabled by default to avoid performance overhead."}]}]} />

Output stack trace of a job creator when job results in exception. Disabled by default to avoid performance overhead.

<h2 id="enable_lazy_columns_replication">
  enable\_lazy\_columns\_replication
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.11"},{"label": "1"},{"label": "Enable lazy columns replication in JOIN and ARRAY JOIN by default"}]}, {"id": "row-2","items": [{"label": "25.10"},{"label": "0"},{"label": "Add a setting to enable lazy columns replication in JOIN and ARRAY JOIN"}]}]} />

Enables lazy columns replication in JOIN and ARRAY JOIN, it allows to avoid unnecessary copy of the same rows multiple times in memory.

<h2 id="enable_materialized_cte">
  enable\_materialized\_cte
</h2>

<ExperimentalBadge />

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.3"},{"label": "0"},{"label": "New setting"}]}]} />

Enable materialized common table expressions, it will be preferred over enable\_global\_with\_statement

<h2 id="enable_memory_bound_merging_of_aggregation_results">
  enable\_memory\_bound\_merging\_of\_aggregation\_results
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

Enable memory bound merging strategy for aggregation.

<h2 id="enable_multiple_prewhere_read_steps">
  enable\_multiple\_prewhere\_read\_steps
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

Move more conditions from WHERE to PREWHERE and do reads from disk and filtering in multiple steps if there are multiple conditions combined with AND

<h2 id="enable_named_columns_in_function_tuple">
  enable\_named\_columns\_in\_function\_tuple
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.7"},{"label": "0"},{"label": "Generate named tuples in function tuple() when all names are unique and can be treated as unquoted identifiers."}]}, {"id": "row-2","items": [{"label": "24.10"},{"label": "0"},{"label": "Disabled pending usability improvements"}]}]} />

Generate named tuples in function tuple() when all names are unique and can be treated as unquoted identifiers.

<h2 id="enable_order_by_all">
  enable\_order\_by\_all
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

Enables or disables sorting with `ORDER BY ALL` syntax, see [ORDER BY](/docs/reference/statements/select/order-by).

Possible values:

* 0 — Disable ORDER BY ALL.
* 1 — Enable ORDER BY ALL.

**Example**

Query:

```sql theme={null}
CREATE TABLE TAB(C1 Int, C2 Int, ALL Int) ENGINE=Memory();

INSERT INTO TAB VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);

SELECT * FROM TAB ORDER BY ALL; -- returns an error that ALL is ambiguous

SELECT * FROM TAB ORDER BY ALL SETTINGS enable_order_by_all = 0;
```

Result:

```text theme={null}
┌─C1─┬─C2─┬─ALL─┐
│ 20 │ 20 │  10 │
│ 30 │ 10 │  20 │
│ 10 │ 20 │  30 │
└────┴────┴─────┘
```

<h2 id="enable_parallel_blocks_marshalling">
  enable\_parallel\_blocks\_marshalling
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "true"},{"label": "A new setting"}]}]} />

Affects only distributed queries. If enabled, blocks will be (de)serialized and (de)compressed on pipeline threads (i.e. with higher parallelism that what we have by default) before/after sending to the initiator.

<h2 id="enable_parsing_to_custom_serialization">
  enable\_parsing\_to\_custom\_serialization
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.10"},{"label": "1"},{"label": "New setting"}]}]} />

If true then data can be parsed directly to columns with custom serialization (e.g. Sparse) according to hints for serialization got from the table.

<h2 id="enable_producing_buckets_out_of_order_in_aggregation">
  enable\_producing\_buckets\_out\_of\_order\_in\_aggregation
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.9"},{"label": "1"},{"label": "New setting"}]}]} />

Allow memory-efficient aggregation (see `distributed_aggregation_memory_efficient`) to produce buckets out of order.
It may improve performance when aggregation bucket sizes are skewed by letting a replica to send buckets with higher id-s to the initiator while it is still processing some heavy buckets with lower id-s.
The downside is potentially higher memory usage.

<h2 id="enable_reads_from_query_cache">
  enable\_reads\_from\_query\_cache
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

If turned on, results of `SELECT` queries are retrieved from the [query cache](/docs/concepts/features/performance/caches/query-cache).

Possible values:

* 0 - Disabled
* 1 - Enabled

<h2 id="enable_s3_requests_logging">
  enable\_s3\_requests\_logging
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

Enable very explicit logging of S3 requests. Makes sense for debug only.

<h2 id="enable_scalar_subquery_optimization">
  enable\_scalar\_subquery\_optimization
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "19.18"},{"label": "1"},{"label": "Prevent scalar subqueries from (de)serializing large scalar values and possibly avoid running the same subquery more than once"}]}]} />

If it is set to true, prevent scalar subqueries from (de)serializing large scalar values and possibly avoid running the same subquery more than once.

<h2 id="enable_scopes_for_with_statement">
  enable\_scopes\_for\_with\_statement
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.7"},{"label": "1"},{"label": "New setting for backward compatibility with the old analyzer."}]}, {"id": "row-2","items": [{"label": "25.6"},{"label": "1"},{"label": "New setting for backward compatibility with the old analyzer."}]}, {"id": "row-3","items": [{"label": "25.5"},{"label": "1"},{"label": "New setting for backward compatibility with the old analyzer."}]}, {"id": "row-4","items": [{"label": "25.4"},{"label": "1"},{"label": "New setting for backward compatibility with the old analyzer."}]}]} />

If disabled, declarations in parent WITH cluases will behave the same scope as they declared in the current scope.

Note that this is a compatibility setting for the analyzer to allow running some invalid queries that old analyzer could execute.

<h2 id="enable_sharding_aggregator">
  enable\_sharding\_aggregator
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.6"},{"label": "0"},{"label": "New setting to enable sharded `GROUP BY` optimization that distributes rows across threads by hashing the grouping key, so each thread aggregates a disjoint subset of keys without a merge phase; this is efficient for high cardinality keys with evenly distributed data."}]}]} />

Enables sharded `GROUP BY` optimization that distributes rows across threads by hashing the grouping key, so each thread aggregates a disjoint subset of keys without a merge phase.

This is efficient for high-cardinality keys with evenly distributed data, but may suffer from highly skewed key distributions or queries with very few distinct keys.

Possible values:

* 0 — Sharded aggregation optimization is disabled.
* 1 — Sharded aggregation optimization is enabled.

<h2 id="enable_shared_storage_snapshot_in_query">
  enable\_shared\_storage\_snapshot\_in\_query
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "0"},{"label": "A new setting to share storage snapshot in query"}]}, {"id": "row-2","items": [{"label": "25.12"},{"label": "1"},{"label": "Enable share storage snapshot in query by default"}]}]} />

If enabled, all subqueries within a single query will share the same StorageSnapshot for each table.
This ensures a consistent view of the data across the entire query, even if the same table is accessed multiple times.

This is required for queries where internal consistency of data parts is important. Example:

```sql theme={null}
SELECT
    count()
FROM events
WHERE (_part, _part_offset) IN (
    SELECT _part, _part_offset
    FROM events
    WHERE user_id = 42
)
```

Without this setting, the outer and inner queries may operate on different data snapshots, leading to incorrect results.

<Note>
  Enabling this setting disables the optimization which removes unnecessary data parts from snapshots once the planning stage is complete.
  As a result, long-running queries may hold onto obsolete parts for their entire duration, delaying part cleanup and increasing storage pressure.

  This setting currently applies only to tables from the MergeTree family.
</Note>

Possible values:

* 0 - Disabled
* 1 - Enabled

<h2 id="enable_sharing_sets_for_mutations">
  enable\_sharing\_sets\_for\_mutations
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

Allow sharing set objects build for IN subqueries between different tasks of the same mutation. This reduces memory usage and CPU consumptio

<h2 id="enable_streaming_queries">
  enable\_streaming\_queries
</h2>

<ExperimentalBadge />

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.6"},{"label": "0"},{"label": "New setting"}]}]} />

Allow `SELECT ... FROM t STREAM [CURSOR '{...}']` continuous queries.
When off, any table expression using the `STREAM` modifier is rejected
at plan-build time. This is the umbrella gate for the streaming-queries
feature; additional capabilities may be gated by their own settings.

<h2 id="enable_time_time64_type">
  enable\_time\_time64\_type
</h2>

**Aliases**: `allow_experimental_time_time64_type`

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "0"},{"label": "New settings. Allows to use a new experimental Time and Time64 data types."}]}, {"id": "row-2","items": [{"label": "25.12"},{"label": "1"},{"label": "Enable Time and Time64 type by default"}]}]} />

Allows creation of [Time](/docs/reference/data-types/time) and [Time64](/docs/reference/data-types/time64) data types.

<h2 id="enable_unaligned_array_join">
  enable\_unaligned\_array\_join
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

Allow ARRAY JOIN with multiple arrays that have different sizes. When this settings is enabled, arrays will be resized to the longest one.

<h2 id="enable_url_encoding">
  enable\_url\_encoding
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.5"},{"label": "0"},{"label": "Changed existing setting's default value"}]}]} />

Allows to enable/disable decoding/encoding path in uri in [URL](/docs/reference/engines/table-engines/special/url) engine tables.

Disabled by default.

<h2 id="enable_vertical_final">
  enable\_vertical\_final
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.6"},{"label": "1"},{"label": "Enable vertical final by default again after fixing bug"}]}, {"id": "row-2","items": [{"label": "24.1"},{"label": "1"},{"label": "Use vertical final by default"}]}]} />

If enable, remove duplicated rows during FINAL by marking rows as deleted and filtering them later instead of merging rows

<h2 id="enable_writes_to_query_cache">
  enable\_writes\_to\_query\_cache
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

If turned on, results of `SELECT` queries are stored in the [query cache](/docs/concepts/features/performance/caches/query-cache).

Possible values:

* 0 - Disabled
* 1 - Enabled
