Files
doc-exports/docs/css/umn/css_01_0468.html
zhengxiu 2125539080 css umn 25.1.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-07-04 09:10:17 +00:00

3.7 KiB

Optimizing the Write and Query Performance of Vector Search

Optimizing Write Performance

  • To reduce the cost of backup, disable the backup function before data import and enable it afterwards.
  • Set refresh_interval to 120s or a larger value. Larger segments can reduce the vector index build overhead caused by merging.
  • Increase the value of native.vector.index_threads (the default value is 4) to increase the number of threads for vector index build.
    PUT _cluster/settings
    {
      "persistent": {
        "native.vector.index_threads": 8
      }
    }

Optimizing Query Performance

  • After importing data in batches, you can run the forcemerge command to improve the query efficiency.
    POST index_name/_forcemerge?max_num_segments=1
  • If the off-heap memory required by the vector index exceeds the circuit breaker limit, index entry swap-in and swap-out occur, which affects the query performance. In this case, you can increase the circuit breaker threshold of off-heap memory.
    PUT _cluster/settings
    {
      "persistent": {
        "native.cache.circuit_breaker.cpu.limit": "75%"
      }
    }
  • To fetch a small number of fields that support doc values, such as keywords and numerical fields, use the docvalue_fields parameter to specify the fields you want to fetch. This helps to reduce overhead during the fetch phase.
    POST my_index/_search
    {
      "size": 2,
      "stored_fields": ["_none_"], 
      "docvalue_fields": ["my_label"],
      "query": {
        "vector": {
          "my_vector": {
            "vector": [1, 1],
            "topk": 2
          }
        }
      }
    }