pub enum VecEncoding {
F32,
Sq8,
F16,
}Expand description
In-cell encoding for a VECTOR(N) column. v6.0.1 added the
optional USING <encoding> clause; omitting it keeps the
pre-v6 F32 default. Sq8 quantises each cell to a per-vector
affine (min, max, [u8; dim]) triple (4× compression). F16
(v6.0.3, DDL keyword HALF) stores each element as IEEE-754
binary16 (2× compression, ~3 decimal digits of precision).
Variants§
F32
IEEE-754 binary32. Pre-v6 default; matches pgvector’s
uncompressed vector type wire / storage layout.
Sq8
v6.0.1 SQ8 — per-vector affine 8-bit quantisation. See
spg_storage::quantize::Sq8Vector for the math + recall
envelope (≥ 0.95 on Gaussian / unit-sphere corpora at
dim ≥ 32).
F16
v6.0.3 halfvec — IEEE-754 binary16 (half-precision)
per-element. DDL keyword HALF (pgvector convention).
Bit-exact dequantise to f32 at the storage layer; no
rerank pass needed for kNN search.
Trait Implementations§
Source§impl Clone for VecEncoding
impl Clone for VecEncoding
Source§fn clone(&self) -> VecEncoding
fn clone(&self) -> VecEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VecEncoding
Source§impl Debug for VecEncoding
impl Debug for VecEncoding
Source§impl Default for VecEncoding
impl Default for VecEncoding
Source§fn default() -> VecEncoding
fn default() -> VecEncoding
Source§impl Display for VecEncoding
impl Display for VecEncoding
impl Eq for VecEncoding
Source§impl PartialEq for VecEncoding
impl PartialEq for VecEncoding
Source§fn eq(&self, other: &VecEncoding) -> bool
fn eq(&self, other: &VecEncoding) -> bool
self and other values to be equal, and is used by ==.