read_in_order_max_bytes_to_prefetch
Maximal total size in bytes of the blocks buffered ahead when reading a single part in order of the primary key with a filter, where the part is split into several streams that are concatenated in order instead of merged. The streams that come later in the order read ahead into memory while the earlier ones are consumed, and this budget is given to the nearest streams first. A larger value allows more streams to be read in parallel. The stream that is currently consumed may buffer a couple of blocks beyond this limit. With 0, there is no limit by bytes, and every stream reads ahead only a couple of blocks.read_in_order_two_level_merge_threshold
Minimal number of parts to read to run preliminary merge step during multithread reading in order of primary key.read_in_order_use_buffering
Use buffering before merging while reading in order of primary key. It increases the parallelism of query executionread_in_order_use_virtual_row
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 mostmax_threads parts that keeps reads parallel.
read_in_order_use_virtual_row_per_block
When enabled together withread_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.