Vector Database Parameters
maintenance_work_mem
Parameter description: Specifies the maximum amount of memory used in maintenance operations. This parameter can be set at the PDB level.
Parameter type: integer.
Unit: KB
Value range: 1024 to 2147483647
Default value: 65536 (that is, 64 MB). In the PDB scenario, if this parameter is not set, the global settings will apply.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1. For example, if the value is 1024 without a unit, maintenance_work_mem indicates 1024 KB. If the value is 1MB, maintenance_work_mem indicates 1 MB. The unit must be KB, MB, or GB if required.
Setting suggestion: The value of this parameter must be greater than the memory required for data sampling during vector index building. For the gsivfflat index, the memory required for sampling is estimated at max(nlist, nlist2) x dim x 0.2 KB. For the gsdiskann index, when pq is enabled, the memory required for sampling is dim x 80 KB.
Risks and impacts of improper settings: If the value is too small, indexes cannot be created and other services that require large memory will fail.
diskann_probe_ncandidates
Parameter description: Specifies the size of the candidate set when the gsdiskann index is used to retrieve vectors. In the multi-tenancy scenario, this parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: 1 to 32768
Default value: 128. In the PDB scenario, if this parameter is not set, the global settings will apply.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion:
- Retain the default value. Obtain the optimal parameter settings through experiments.
- The diskann_probe_ncandidates parameter can be set and take effect for some queries that use the gsdiskann index. You are advised to set the parameter only in a session using SET. You are advised not to use gs_guc to set the parameter globally.
Risks and impacts of improper settings: If the value is too large, the query performance deteriorates. If the value is small, the recall rate is insufficient.
gsivfflat_probes
Parameter description: Specifies the number of inverted tables to be searched when the gsivfflat index is used to retrieve vectors. If the total number of inverted tables exceeds the total number of inverted tables of the gsivfflat index, the entire table is searched. The total number of inverted tables of the gsivfflat index is specified by the ivf_nlist parameter when the index is created. In the multi-tenancy scenario, this parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: 1 to 32768
Default Value: 5. In the PDB scenario, if this parameter is not set, the global settings will apply.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Set this parameter to 3% of the value of ivf_nlist when the index is created. You are advised to obtain the optimal parameter configuration through experiments.
Risks and impacts of improper settings: If this parameter is set to a larger value, the search takes a longer time but the search result is more accurate.
gsivfflat_secondary_probes
Parameter description: Specifies the number of level-2 inverted tables to be searched when the gsivfflat index is used to retrieve vectors. If the total number of inverted tables exceeds the total number of level-2 inverted tables, the entire table is searched. The total number of level-2 inverted tables is specified by the ivf_nlist2 parameter when the index is created. In the multi-tenancy scenario, this parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: 1 to 32768
Default Value: 5. In the PDB scenario, if this parameter is not set, the global settings will apply.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: You are advised to set this parameter to a value between 1/4 and 1/2 of the value of ivf_nlist2. You are advised to obtain the optimal parameter configuration through experiments.
Risks and impacts of improper settings: If this parameter is set to a larger value, the search takes a longer time but the search result is more accurate.

gsivfflat_secondary_probes has the same effect as gsivfflat_probes. gsivfflat_secondary_probes takes effect only when the vector index is a double-layer index, which effectively accelerates the query speed. You are advised to obtain the optimal parameter configuration through experiments.
enable_vectordb
Parameter description: Specifies whether vector indexes can be created and whether vector indexes can be added, modified, and queried. For details about the functions of a vector database, see "Using a Vector Database" in Vector Database Developer Guide.
Parameter type: Boolean.
Unit: none
Value range:
- on: allowed.
- off: not allowed.
Default value: off
Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Setting suggestion: If users are not allowed to use vector database functions such as vector index, set this parameter to off. Otherwise, set this parameter to on.
Risks and impacts of improper settings: The parameter value determines whether users can use the vector database functions. If the parameter value is incorrect, users may use the out-of-range database functions.
bm25_ranking_metric
Parameter description: Specifies the similar document sorting and recall algorithm used by the BM25 index. In the multi-tenancy scenario, this parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: 0 to 127. The mappings between the values are as follows:
- 0: BM25_OKAPI (default value)
- 1: BM25_ATIRE
- 2: BM25_L
- 3: BM25_PLUS
- 4: TF_IDF
- > 4: BM25_OKAPI
Default value: 0. In the PDB scenario, if this parameter is not set, the global settings will apply.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Select a proper document similarity scoring algorithm based on the service scenario.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
bm25_ncandidates
Parameter description: Specifies the number of top documents to be prepared when the BM25 index is used to sort and retrieve similar documents. This parameter is used to accelerate the retrieval of similar documents with the WHERE filter criterion. In the multi-tenancy scenario, this parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: 0–65535
Default value: 128. In the PDB scenario, if this parameter is not set, the global settings will apply.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Set this parameter based on the filter criteria of the search statement and the number of returned LIMIT records. The value is calculated as follows: Number of recalled LIMIT records/Probability that the document result meets the filter criteria.
Risks and impacts of improper settings: If the value is too large or too small, the BM25 index retrieval delay is prolonged. In severe cases, the delay may increase by three to four times.
GUC Parameter |
Level |
Value Range/Default Value |
Description |
---|---|---|---|
maintenance_work_mem |
Session |
[1024,2147483647]/[1MB,2048GB) (65536/64MB) |
Maximum amount of memory used in maintenance operations. The default unit is KB. |
diskann_probe_ncandidates |
Session |
[1, 32768](128) |
Size of the candidate set when the gsdiskann index is used to retrieve vectors. |
gsivfflat_probes |
Session |
[1, 32768](5) |
Number of inverted tables to be searched. If it exceeds the total number of inverted tables, the entire table is searched. |
gsivfflat_secondary_probes |
Session |
[1, 32768](5) |
Number of level-2 inverted tables to be searched. If it exceeds the total number of level-2 inverted tables, the entire table is searched. |
enable_vectordb |
Global parameter (SIGHUP) |
[off, on](on) |
An advance feature that specifies whether vector indexes can be created and whether vector indexes can be added, modified, and queried. |
bm25_ranking_metric |
Session |
[0, 127](0) |
Specifies the similar document sorting and recall algorithm used by the BM25 index. |
bm25_ncandidates |
Session |
[0, 65536](128) |
Specifies the number of top documents to be prepared when the BM25 index is used to sort and recall similar documents. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot