Journal · Engineering note

Porting pgvector to a Rust Postgres

Our work on pgvector inside pgrust, with the benchmark wins and losses side by side.

Kind
Engineering note
Author
MosaicLabs
Published
Not yet

Draft. This is an outline, not the finished post, and it is not in the production build.

Outline.

  • What pgrust is, and whose it is. What pgvector is, and whose it is.
  • What our fork adds: pgvector 0.8.7, half-precision and sparse vectors, bit distance functions, IVFFlat, parallel index builds.
  • Compatibility, limited to what was tested: recall within 0.005 of the C original; index sizes close.
  • Where it is ahead: four-worker HNSW builds at 0.35 to 0.40 times the peak memory; simple read throughput at 1.10 times.
  • Where it is behind: HNSW search at 0.72 to 0.74 times the throughput; serial HNSW builds about twice as slow; IVFFlat builds 3.65 to 4.84 times slower.
  • The conditions: one sequential campaign on a shared host; memory figures are container peaks.
  • What comes next.