> ## 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_* session settings

> ClickHouse session settings in the read_in_* generated group.

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

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

Type

UInt64

Default

100

Minimal number of parts to read to run preliminary merge step during multithread reading in order of primary key.

## read\_in\_order\_use\_buffering

Type

Bool

Default

1

Use buffering before merging while reading in order of primary key. It increases the parallelism of query execution

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

Type

Bool

Default

1

Use virtual row while reading in order of primary key or its monotonic function fashion. It is useful when searching over multiple parts as only the parts that can actually contribute to the result are read, plus a bounded read-ahead window of at most `max_threads` parts that keeps reads parallel.

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

Type

Bool

Default

0

When enabled together with `read_in_order_use_virtual_row`, emit a virtual row after each block read (not only at the beginning of each part).
This allows `MergingSortedTransform` to reprioritize sources more frequently, which is useful when downstream filters discard many rows and data is distributed unevenly across parts.
Note that it disables `read_in_order_use_buffering` optimization and preliminary merge (`read_in_order_two_level_merge_threshold`) for reading.
