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

# deduplicate_insert_* session settings

> ClickHouse session settings in the deduplicate_insert_* 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>;
};

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="deduplicate_insert">
  deduplicate\_insert
</h2>

<SettingsInfoBlock type="DeduplicateInsertMode" default_value="enable" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.2"},{"label": "enable"},{"label": "Enable deduplication for all sync and async inserts by default."}]}]} />

Enables or disables block deduplication of  `INSERT INTO` (for Replicated\* tables).
The setting overrides `insert_deduplicate` and `async_insert_deduplicate` settings.
That setting has three possible values:

* disable — Deduplication is disabled for `INSERT INTO` query.
* enable — Deduplication is enabled for `INSERT INTO` query.
* backward\_compatible\_choice — Deduplication is enabled if `insert_deduplicate` or `async_insert_deduplicate` are enabled for specific insert type.

<h2 id="deduplicate_insert_select">
  deduplicate\_insert\_select
</h2>

<SettingsInfoBlock type="DeduplicateInsertSelectMode" default_value="enable_when_possible" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.1"},{"label": "enable_when_possible"},{"label": "change the default behavior of deduplicate_insert_select to ENABLE_WHEN_POSSIBLE"}]}, {"id": "row-2","items": [{"label": "25.12"},{"label": "enable_even_for_bad_queries"},{"label": "New setting, replace insert_select_deduplicate"}]}]} />

Enables or disables block deduplication of `INSERT SELECT` (for Replicated\* tables).
The setting overrids `insert_deduplicate` and `deduplicate_insert` for `INSERT SELECT` queries.
That setting has four possible values:

* disable — Deduplication is disabled for `INSERT SELECT` query.
* force\_enable — Deduplication is enabled for `INSERT SELECT` query. If select result is not stable, exception is thrown.
* enable\_when\_possible — Deduplication is enabled if `insert_deduplicate` is enable and select result is stable, otherwise disabled.
* enable\_even\_for\_bad\_queries - Deduplication is enabled if `insert_deduplicate` is enable. If select result is not stable, warning is logged, but query is executed with deduplication. This option is for backward compatibility. Consider to use other options instead as it may lead to unexpected results.
