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

# read_in_* 会话设置

> ClickHouse 在自动生成的 read_in_* 组中的会话设置。

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

## read\_in\_order\_two\_level\_merge\_threshold

类型

UInt64

默认值

100

按主键顺序进行多线程读取时，触发 预合并 步骤所需读取的最少 parts 数量。

## read\_in\_order\_use\_buffering

类型

Bool

默认值

1

按主键顺序读取时，在合并前先进行缓冲。这样可以提高查询执行的并行度

## read\_in\_order\_use\_virtual\_row

类型

Bool

默认值

1

按主键或其单调函数的顺序读取时，使用虚拟行。在跨多个 parts 搜索时，只会读取实际能对结果产生贡献的 parts，同时通过最多包含 `max_threads` 个 parts 的有界预读窗口保持并行读取。

## read\_in\_order\_use\_virtual\_row\_per\_block

类型

Bool

默认值

0

当与 `read_in_order_use_virtual_row` 一起启用时，每读取一个块后都会发出一条虚拟行 (而不仅仅是在每个 parts 的开头) 。
这使 `MergingSortedTransform` 能更频繁地重新调整各源的优先级，这在下游过滤器丢弃大量行、且数据在各个 parts 之间分布不均时尤其有用。
请注意，这会禁用读取时的 `read_in_order_use_buffering` 优化和预合并 (`read_in_order_two_level_merge_threshold`) 。
