Skip to content

Schema

Here is the schema provided by pgvecto.rs.

List of data types

NameDescription
vectorvector, scalar type of which is “binary32” defined in IEEE 754-2008
vecf16vector, scalar type of which is “binary16” defined in IEEE 754-2008
svectorsparse vector, scalar type of which is “binary32” defined in IEEE 754-2008
bvectorbinary vector, a fixed-length bit string
vector_index_stata composite type representing vector index statistics

List of operators

NameLeft arg typeRight arg typeResult typeDescription
+vectorvectorvectorelement-wise arithmetic
+vecf16vecf16vecf16element-wise arithmetic
+svectorsvectorsvectorelement-wise arithmetic
-vectorvectorvectorelement-wise arithmetic
-vecf16vecf16vecf16element-wise arithmetic
-svectorsvectorsvectorelement-wise arithmetic
&bvectorbvectorbvectorelement-wise logical AND
|bvectorbvectorbvectorelement-wise logical OR
^bvectorbvectorbvectorelement-wise logical XOR
=vectorvectorbooleandictionary order comparison
=vecf16vecf16booleandictionary order comparison
=svectorsvectorbooleandictionary order comparison
=bvectorbvectorbooleandictionary order comparison
<>vectorvectorbooleandictionary order comparison
<>vecf16vecf16booleandictionary order comparison
<>svectorsvectorbooleandictionary order comparison
<>bvectorbvectorbooleandictionary order comparison
<vectorvectorbooleandictionary order comparison
<vecf16vecf16booleandictionary order comparison
<svectorsvectorbooleandictionary order comparison
<bvectorbvectorbooleandictionary order comparison
>vectorvectorbooleandictionary order comparison
>vecf16vecf16booleandictionary order comparison
>svectorsvectorbooleandictionary order comparison
>bvectorbvectorbooleandictionary order comparison
<=vectorvectorbooleandictionary order comparison
<=vecf16vecf16booleandictionary order comparison
<=svectorsvectorbooleandictionary order comparison
<=bvectorbvectorbooleandictionary order comparison
>=vectorvectorbooleandictionary order comparison
>=vecf16vecf16booleandictionary order comparison
>=svectorsvectorbooleandictionary order comparison
>=bvectorbvectorbooleandictionary order comparison
<->vectorvectorrealsquared Euclidean distance
<->vecf16vecf16realsquared Euclidean distance
<->svectorsvectorrealsquared Euclidean distance
<->bvectorbvectorrealsquared Euclidean distance
<#>vectorvectorrealnegative dot product
<#>vecf16vecf16realnegative dot product
<#>svectorsvectorrealnegative dot product
<#>bvectorbvectorrealnegative dot product
<=>vectorvectorrealcosine distance
<=>vecf16vecf16realcosine distance
<=>svectorsvectorrealcosine distance
<=>bvectorbvectorrealcosine distance
<~>bvectorbvectorrealjaccard distance

List of functions

NameArgument typeResult typeDescription
to_svectordims integer, index integer[], value real[]svectorConstruct a sparse vector from two arrays of indexes and values
binarizevector vectorbvectorBinarize a vector. All positive elements are set to 1, otherwise 0.

List of casts

Source typeTarget typeImplicit?
real[]vectoryes
vectorreal[]yes
vectorvecf16no
vecf16vectorno
vectorsvectorno
svectorvectorno
vectorbvectorno
bvectorvectorno

List of access methods

NameTypeDescription
vectorsIndexpgvecto.rs vector index

List of operator families

AMOperator familyApplicable types
vectorsvector_cos_opsvector
vectorsvector_dot_opsvector
vectorsvector_l2_opsvector
vectorsvecf16_cos_opsvecf16
vectorsvecf16_dot_opsvecf16
vectorsvecf16_l2_opsvecf16
vectorssvector_cos_opssvector
vectorssvector_dot_opssvector
vectorssvector_l2_opssvector
vectorsbvector_cos_opsbvector
vectorsbvector_dot_opsbvector
vectorsbvector_l2_opsbvector
vectorsbvector_jaccard_opsbvector

List of operator classes

AMInput typeOperator classDefault?Description
vectorsvectorvector_l2_opsnosquared Euclidean distance
vectorsvectorvector_dot_opsnonegative dot product
vectorsvectorvector_cos_opsnocosine distance
vectorsvecf16vecf16_l2_opsnosquared Euclidean distance
vectorsvecf16vecf16_dot_opsnonegative dot product
vectorsvecf16vecf16_cos_opsnocosine distance
vectorssvectorsvector_l2_opsnosquared Euclidean distance
vectorssvectorsvector_dot_opsnonegative dot product
vectorssvectorsvector_cos_opsnocosine distance
vectorsbvectorbvector_l2_opsnosquared Euclidean distance
vectorsbvectorbvector_dot_opsnonegative dot product
vectorsbvectorbvector_cos_opsnocosine distance
vectorsbvectorbvector_jaccard_opsnojaccard distance

List of views

NameDescription
pg_vector_index_statA view provided for vector index statistics