DiskPQParams

API definition

DiskPQParams {

int pqChunks = 512;

int funcType = 1;

int dim = 1;

char *pqTable = nullptr;

uint32_t *offsets = nullptr;

char *tablesTransposed = nullptr;

char *centroids = nullptr;

}

Function

Defines the PQ structure.

Input

N/A

Output

N/A

Parameter

int pqChunks: divides the original vector dimension into pqChunks.

int funcType: standard used for PQ lookup table distance calculation.

int dim: original data dimension.

char *pqTable: pointer for storing the codebook data. The default value is nullptr.

uint32_t *offsets: start and end dimensions of each chunk in the original dimension. The default value is nullptr.

char *tablesTransposed: pointer for storing the transposed codebook data. The default value is nullptr.

char *centroids: average value of each dimension, which is used to centralize data. The default value is nullptr.

Restrictions

  • 1 ≤ pqChunksdim: A smaller value of pqChunks indicates less memory usage, but may cause accuracy drop. Generally, it is recommended that the value of pqChunks be dim/8 or dim/16 (rounded up). The default value is 512.
  • The value of funcType can be 1, 2, or 3. 1 indicates L2 distance, 2 indicates IP distance, and 3 indicates cosine distance. The default value is 1.
  • 1 ≤ dim ≤ 2000: The default value is 1.
  • pqTable supports only the float data type, that is, the openGauss vector data type.
  • tablesTransposed supports only the float data type, that is, the openGauss vector data type.