forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
52 lines
4.7 KiB
HTML
52 lines
4.7 KiB
HTML
<a name="css_01_0126"></a><a name="css_01_0126"></a>
|
|
|
|
<h1 class="topictitle1">Optimizing the Performance of Vector Retrieval</h1>
|
|
<div id="body0000001262069744"><div class="section" id="css_01_0126__en-us_topic_0000001262069744_section186411329173012"><h4 class="sectiontitle">Optimizing Write Performance</h4><ul id="css_01_0126__en-us_topic_0000001262069744_ul09461057164113"><li id="css_01_0126__en-us_topic_0000001262069744_li189761389357">To reduce the cost of backup, disable the backup function before data import and enable it afterwards.</li><li id="css_01_0126__en-us_topic_0000001262069744_li27411942123713">Set <span class="parmname" id="css_01_0126__en-us_topic_0000001262069744_parmname877971815344"><b>refresh_interval</b></span> to <strong id="css_01_0126__en-us_topic_0000001262069744_b1176015317388">120s</strong> or a larger value. Larger segments can reduce the vector index build overhead caused by merging.</li><li id="css_01_0126__en-us_topic_0000001262069744_li1053491484012">Increase the value of <span class="parmname" id="css_01_0126__en-us_topic_0000001262069744_parmname18272105316343"><b>native.vector.index_threads</b></span> (the default value is <strong id="css_01_0126__en-us_topic_0000001262069744_b11648194418458">4</strong>) to increase the number of threads for vector index build.<pre class="screen" id="css_01_0126__en-us_topic_0000001262069744_screen28631532420">PUT _cluster/settings
|
|
{
|
|
"persistent": {
|
|
"native.vector.index_threads": 8
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="css_01_0126__en-us_topic_0000001262069744_section527113518302"><h4 class="sectiontitle">Optimizing Query Performance</h4><ul id="css_01_0126__en-us_topic_0000001262069744_ul1388130134412"><li id="css_01_0126__en-us_topic_0000001262069744_li1456725974318">After importing data in batches, you can run the <strong id="css_01_0126__en-us_topic_0000001262069744_b168089591364">forcemerge</strong> command to improve the query efficiency.<pre class="screen" id="css_01_0126__en-us_topic_0000001262069744_screen3998132772116">POST index_name/_forcemerge?max_num_segments=1</pre>
|
|
</li></ul>
|
|
<ul id="css_01_0126__en-us_topic_0000001262069744_ul269911532210"><li id="css_01_0126__en-us_topic_0000001262069744_li56213018222">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.<pre class="screen" id="css_01_0126__en-us_topic_0000001262069744_screen9611125582411">PUT _cluster/settings
|
|
{
|
|
"persistent": {
|
|
"native.cache.circuit_breaker.cpu.limit": "75%"
|
|
}
|
|
}</pre>
|
|
</li><li id="css_01_0126__en-us_topic_0000001262069744_li118231027162512">If the end-to-end latency is greater than the <strong id="css_01_0126__en-us_topic_0000001262069744_b1636727154813">took</strong> value in the returned result, you can configure <strong id="css_01_0126__en-us_topic_0000001262069744_b1579222154816">_source</strong> to reduce the <strong id="css_01_0126__en-us_topic_0000001262069744_b572916214913">fdt</strong> file size and reduce the <strong id="css_01_0126__en-us_topic_0000001262069744_b1040010152719">fetch</strong> overhead.<pre class="screen" id="css_01_0126__en-us_topic_0000001262069744_screen94734312718">PUT my_index
|
|
{
|
|
"settings": {
|
|
"index": {
|
|
"vector": "true"
|
|
},
|
|
<strong id="css_01_0126__en-us_topic_0000001262069744_b10944142414295">"</strong><strong id="css_01_0126__en-us_topic_0000001262069744_b204937213297">index.soft_deletes.enabled</strong><strong id="css_01_0126__en-us_topic_0000001262069744_b1994442412296">": </strong><strong id="css_01_0126__en-us_topic_0000001262069744_b20561510295">false</strong>
|
|
},
|
|
"mappings": {
|
|
<strong id="css_01_0126__en-us_topic_0000001262069744_b826541914298">"</strong><strong id="css_01_0126__en-us_topic_0000001262069744_b6486121362916">_source</strong><strong id="css_01_0126__en-us_topic_0000001262069744_b526551915299">": {</strong>
|
|
<strong id="css_01_0126__en-us_topic_0000001262069744_b42711119172914"> "</strong><strong id="css_01_0126__en-us_topic_0000001262069744_b162115992916">excludes</strong><strong id="css_01_0126__en-us_topic_0000001262069744_b9271101913291">": ["my_vector"]</strong>
|
|
<strong id="css_01_0126__en-us_topic_0000001262069744_b12272319202914"> }</strong>,
|
|
"properties": {
|
|
"my_vector": {
|
|
"type": "vector",
|
|
"dimension": 128,
|
|
"indexing": true,
|
|
"algorithm": "GRAPH",
|
|
"metric": "euclidean"
|
|
}
|
|
}
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0117.html">Vector Retrieval</a></div>
|
|
</div>
|
|
</div>
|
|
|