Good fit
- Teams with a growing embeddings table and no vector index
- Applications where similarity search takes over a second
- RAG implementations with slow retrieval degrading AI response time
You stored your embeddings in pgvector but similarity search takes seconds. The table has no HNSW or IVFFlat index, so every query falls back to a sequential scan over every vector.
For teams whose vector search is unusable because of missing indexes, oversized embeddings, and unoptimized query patterns. pgvector is fast when configured correctly. These are the three configuration issues that make it unusable.
Without an HNSW or IVFFlat index, every similarity query scans every embedding. That is gigabytes of sequential reading per query, multiplied by every query per second, for a search that a graph index answers far faster. EXPLAIN ANALYZE shows the Seq Scan; the fix is one CREATE INDEX with the right opclass.
OpenAI's text-embedding-3-small produces 1536 dimensions, and text-embedding-3-large defaults to 3072. For many retrieval tasks, a smaller model with far fewer dimensions keeps nearly the same recall. Fewer dimensions mean faster distance calculations and smaller indexes. text-embedding-3 also supports Matryoshka shortening via the dimensions parameter, so you can trim without re-embedding from scratch.
Your queries use cosine distance (vector_cosine_ops) but OpenAI embeddings already ship normalized to length 1. On normalized vectors, inner product (vector_ip_ops, the <#> operator) returns identical rankings and skips the redundant norm calculation. The gain is modest at small scale but real at high query volume, and the index opclass must match the query operator or PostgreSQL silently falls back to a sequential scan.
Best fit when you have embeddings in Supabase but similarity search is too slow for user-facing features.
Tutorials show you how to store vectors.
We index, tune, and optimize pgvector for your specific query patterns and recall requirements.
Measure current performance. Analyze query patterns: how many queries per second, what recall level is acceptable, how often embeddings are updated. These determine the optimal index type and parameters.
Build an HNSW or IVFFlat index with m and ef_construction tuned for your data, then dial ef_search at query time to hit your recall target. Switch to inner product (vector_ip_ops) if vectors are normalized. Proof release target: search under 200ms with required recall, verified against an exact-search ground truth set.
Evaluate dimension reduction using PCA or a smaller embedding model. Optimize RPC functions for batched queries. Add pre-filtering with metadata to reduce scan scope.
Performance monitoring for vector search latency and recall. Index maintenance procedures. Guide for adding new vectors without degrading performance.
Fast vector search with proper indexing, tuned parameters, and monitoring.
We tune for your data, not generic benchmarks.
HNSW m, ef_construction, and ef_search are not one-size-fits-all, and over-provisioning m mostly buys longer build times with negligible recall gains. We benchmark multiple configurations against your actual data, comparing each against an exact-search ground truth set to find the settings that hit your recall target fastest.
Slow Current similarity search time
Target: under 200ms, down from seconds.
Fixed scope, fixed price.
HNSW is faster for queries, scales recall sublinearly, and can be built before the table is fully loaded. IVFFlat is faster to build and uses less memory, but it needs representative data present at build time and is best for large, mostly-static sets. For most Supabase applications, HNSW is the better choice. We benchmark both on your data to verify.
Usually not. Unless you have a very large vector set or need extremely low latency, properly indexed pgvector holds its own against Pinecone. Keeping vectors in Supabase means no additional infrastructure, no data sync, and lower cost.
We benchmark recall at both dimension levels with your actual queries. Fewer dimensions usually cost a little recall and buy a lot of speed. We show you the tradeoff with your data before making the change.
An HNSW index build on a large table can take a while, depending on row count and dimensions. We build the index during a maintenance window or on a replica first. Your application continues serving queries during the build. Once the index is ready, queries switch to it with zero downtime.
Yes. Following Supabase's documented pattern, we implement reciprocal rank fusion that merges pgvector similarity ranks with PostgreSQL full-text search (tsvector) ranks using the 1/(k + rank) formula, k defaulting to 50. Because it fuses ranks rather than incompatible raw scores, the result ranks documents by both keyword relevance and semantic meaning, catching exact matches like error codes and product names that pure vector search misses. This hybrid approach consistently outperforms either method alone, with no extra infrastructure since it is all SQL.
It depends on your use case. OpenAI text-embedding-3-small works well for general content at low cost. Cohere embed-v3 excels at multilingual search. For domain-specific data, a fine-tuned model may outperform both. We benchmark candidates on your actual queries and recommend based on quality and cost.
ByKostadin StambolievFounder and Imaginator
Published Updated