Updated on 2026-11-09 GMT+08:00

Vector Search

The recall rate and query latency of vector search are affected by the number of detected partitions, reordering factor, TopK pruning policy, and runtime resources. You need to balance the two factors in your service. This section describes the GUC parameters related to Lance vector search, including query policy parameters (lance_options), runtime behavior parameters (lance_runtime_options), and runtime cache parameters (lance_cache_options). You can adjust these parameters based on the data scale and query performance requirements to improve the recall rate and control the query latency.

Parameter Description

Table 1 Vector search parameters

Parameter

Type

Description

lance_options

String

Definition: Sets parameters related to Lance vector retrieval, including the number of probed partitions, reordering factor, and distributed Top-K pruning policy. The parameter format is a comma-separated key-value pair, and each key-value pair is represented in the format of (key:value).

Range: Key-value pair string. The value range of each subitem is as follows:

  • nprobes: The value is an integer ranging from 1 to INT_MAX. The default value is 1024. It indicates the number of IVF partitions to be probed during vector index query. A larger value indicates more partitions to be scanned, higher recall rate, and longer query latency.
  • refine_factor: The value is an integer ranging from 0 to INT_MAX. The default value is 0. It indicates the reordering factor. The size of the candidate set returned by the index scan is the product of this factor and the Top-K value. The system calculates the exact distance of the candidate set, sorts the candidate set, and obtains the Top-K value. A larger value indicates a higher recall rate and higher compute overhead.
  • large_topk_threshold: The value is an integer ranging from 0 to INT_MAX. The default value is 0. It indicates the K value threshold for triggering distributed Top-K pruning. When the LIMIT K value of a query is greater than or equal to the threshold, the per_shard_topk policy is enabled. The CN calculates the number of candidates to be returned by each DN and pushes down the calculation result. If the value is 0, this policy is disabled.
  • global_topk_budget: The value is a float ranging from 1.0 to 100.0. The default value is 3.0. It indicates the budget coefficient of distributed Top-K pruning, which is used together with large_topk_threshold.

    Calculation formula: perShardTopk=ceil(global_topk_budget × K / active_dn_count), where active_dn_count is the number of active DNs. When active_dn_count is 3.0, perShardTopk equals K, which is consistent with the recall rate when pruning is not enabled.

Default Value: (nprobes:1024), (refine_factor:0), (large_topk_threshold:0), (global_topk_budget:3.0).

Example:

set lance_options='(nprobes:10), (refine_factor:0), (large_topk_threshold:0), (global_topk_budget:3.0)'

lance_runtime_options

String

Definition: Sets parameters related to the running behavior of Lance, including the number of CPU threads, number of I/O threads, and memory pool size. The parameter format is a comma-separated key-value pair, and each key-value pair is represented in the format of (key:value).

lance_runtime_options is a Postmaster-level parameter. It must be configured before the Aura server starts. Modifying this parameter using the SET command at runtime is not supported.

Range: A string of key-value pairs. The value range of each sub-item is as follows:

  • cpu_threads: Specifies the size of the thread pool for CPU-intensive tasks (such as decompression, encoding, and vector calculation). The value is an integer ranging from 1 to INT_MAX. There is no default value.
  • io_threads: Controls the degree of parallelism for I/O operations, which is used for the number of concurrent read and write operations on object storage. The value is an integer ranging from 1 to INT_MAX. There is no default value.
  • mem_pool_size: Specifies the memory pool size (in bytes) of the DataFusion execution engine, which is used for memory management during query execution, especially for operations that support spilling to disks (such as sorting and aggregation). The value is an integer ranging from 1 to INT64_MAX. There is no default value.

Default Value: None.

Example:

set lance_runtime_options='(cpu_threads:8), (io_threads:64), (mem_pool_size:1048576)'

lance_cache_options

String

Definition: Sets parameters related to the cache of the running Lance, including whether to enable the internal thread pool, thread pool size, thread pool queue size, and read/write timeout interval of the thread pool. The parameter value is a string of key-value pairs separated by commas (,), with each key-value pair in the format of (key:value). This parameter takes effect only when enable_remote_cache is set to on.

Range: A string of key-value pairs. The sub-items are as follows:

  • cache_pool_support: Specifies whether to enable the cache thread pool when Lance is running. The value is an integer, which can be 0 or 1. The default value is 1.
  • cache_pool_size: Controls the size of the cache thread pool. The value is an integer ranging from 1 to INT_MAX. The default value is 16.
  • cache_pool_queue_depth: Controls the queue size of each thread in the cache thread pool. The value is an integer ranging from 1 to INT_MAX. The default value is 4.
  • cache_pool_timeout: Controls the read/write timeout interval of each thread in the cache thread pool. If the timeout interval is reached, the I/O request of OBS is directly initiated. The value is an integer ranging from 1 to INT_MAX. The default value is 30.

Default Value: (cache_pool_support: 1), (cache_pool_size: 16), (cache_pool_queue_depth: 4), (cache_pool_timeout: 30).

Example:

set lance_cache_options = "(cache_pool_size:32), (cache_pool_queue_depth:8)";