Database / Supabase basics Interview Questions
What is the difference between pgvector similarity search and hybrid search in Supabase?
pgvector is a Postgres extension that adds a vector column type and distance operators (cosine distance, L2, inner product) so you can store embeddings alongside your relational data and query them with SQL, for example: create extension if not exists vector; create table documents (id bigserial primary key, content text, embedding vector(1536));. Pure vector similarity search finds rows whose embeddings are numerically closest to a query embedding, which is powerful for semantic matches but can miss results that share exact keywords without being semantically close in the embedding space, and vice versa.
Hybrid search combines that vector similarity ranking with traditional keyword search (typically BM25-style full-text ranking via Postgres's tsvector) and merges the two rankings, often using a technique like Reciprocal Rank Fusion, into a single result order. This captures cases pure vector search misses — like an exact product code or acronym a user typed — while still surfacing semantically related results that don't share exact wording.
Because both the vector index and the full-text index live in the same Postgres database, a hybrid search can be expressed as a single SQL query joining both ranking signals, without needing to synchronize data between a separate vector database and a separate search engine.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
