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

# use_partition_* 会话设置

> ClickHouse 中 use_partition_* 自动生成分组下的会话设置。

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

## use\_partition\_minmax\_for\_primary\_key\_pruning

类型

Bool

默认值

1

当某个主键列同时也是分区键的输入列时，在 `MergeTree` 表的主键分析期间使用分区 minmax 索引边界来剪枝更多粒度。

例如，对于一个使用 `ORDER BY (id, event_time)` 和 `PARTITION BY toYYYYMM(event_time)` 的 `MergeTree` 表，ClickHouse 会在主键索引分析期间使用 `event_time` 上的分区 minmax 索引，从而做出更准确的粒度剪枝决策。

可能的值：

* 0 — 禁用。
* 1 — 启用。

## use\_partition\_pruning

**别名**：`use_partition_key`

类型

Bool

默认值

1

在查询执行期间，对 MergeTree 表使用分区键进行分区剪枝。

可能的值：

* 0 — 禁用。
* 1 — 启用。
