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

# lightweight_* 会话设置

> 属于 lightweight_* 生成组的 ClickHouse 会话设置。

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
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

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

<div id="lightweight_delete_mode">
  ## lightweight\_delete\_mode
</div>

<SettingsInfoBlock type="LightweightDeleteMode" default_value="alter_update" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.5"},{"label": "alter_update"},{"label": "新设置"}]}]} />

轻量级删除过程中执行的内部更新查询模式。

可能的值：

* `alter_update` - 运行会创建重量级变更的 `ALTER UPDATE` 查询。
* `lightweight_update` - 如果可以，则运行轻量级更新；否则运行 `ALTER UPDATE`。
* `lightweight_update_force` - 如果可以，则运行轻量级更新；否则抛出异常。

<div id="lightweight_deletes_sync">
  ## lightweight\_deletes\_sync
</div>

<SettingsInfoBlock type="UInt64" default_value="2" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.4"},{"label": "2"},{"label": "与 `mutation_sync` 相同，但仅控制轻量级删除的执行"}]}]} />

与 [`mutations_sync`](/docs/zh/reference/settings/session-settings/mutations#mutations_sync) 相同，但仅控制轻量级删除的执行。

可能的值：

| 值   | 描述                                                                                      |
| --- | --------------------------------------------------------------------------------------- |
| `0` | 变更将异步执行。                                                                                |
| `1` | 查询会等待当前服务器上的轻量级删除完成。                                                                    |
| `2` | 查询会等待所有副本 (如果存在) 上的轻量级删除完成。                                                             |
| `3` | 查询仅等待活跃副本。仅 `SharedMergeTree` 支持。对于 `ReplicatedMergeTree`，其行为与 `mutations_sync = 2` 相同。 |

**另请参阅**

* [ALTER 查询的同步性](/docs/zh/reference/statements/alter/index#synchronicity-of-alter-queries)
* [变更](/docs/zh/reference/statements/alter/index#mutations)

Cloud 默认值：`1`。
