pgvector vs Dedicated Vector Databases for Commerce Search
Most commerce teams reach for a dedicated vector database before they have proven they need one. For many catalogs, Postgres with pgvector is faster to ship, cheaper to run, and easier to filter. Here is where that stops being true and what to do about it.
The default advice in AI infrastructure is to add a vector database the moment someone says "semantic search." For a commerce team, that default often means a new vendor, a new sync pipeline, a new bill, and a new on call rotation, all to search a catalog that would fit comfortably inside the Postgres instance you already run.
The pgvector vs vector database question deserves a more honest answer than "it depends." In practice it depends on four things you can measure: how many vectors you will store, how hard your metadata filters are, whether you need lexical and semantic results blended, and how much operational surface area your team can carry. This article walks through each, gives you labeled assumptions to reason with, and ends with a clear rule for when to graduate.
What pgvector Actually Gives You
pgvector is a Postgres extension that adds a vector column type, distance operators (cosine, inner product, Euclidean), and approximate nearest neighbor indexes. Because it lives inside Postgres, your embeddings sit next to your products, variants, inventory, and prices in the same tables, under the same transactions, backups, and access controls.
That last point is the underrated one. A product update and its embedding refresh can happen in one transaction. A deleted product cannot linger as a ghost in a separate index. A query can join vectors to inventory and price in a single statement. With a dedicated store, every one of those becomes a synchronization problem you own.
Managed Postgres providers ship pgvector as a standard extension, so there is usually nothing to install. If you are already weighing Postgres hosts for an AI backend, our comparison of Neon vs Supabase for AI backends covers the operational differences that matter.
Catalog Scale: Where the Thresholds Sit
Be careful with anyone who gives you a single magic number for when Postgres "stops working." The real answer depends on vector dimensions, index type, memory, recall target, and query concurrency. Instead, reason with illustrative assumptions.
Illustrative assumptions (not benchmarks): suppose you embed each product once, using a model that produces 1,536 dimensions stored as 32 bit floats. Each vector then takes roughly 6 KB before index overhead. Suppose you also want a handful of embeddings per product (title, description, image), so multiply accordingly.
Under those assumptions:
- A catalog in the tens of thousands of products is trivial. Postgres handles it with room to spare, and a dedicated database adds cost without adding value.
- A catalog in the hundreds of thousands to low millions of vectors is the interesting middle. A properly sized instance with an HNSW index kept in memory can serve this well, but you need to size RAM deliberately and watch index build times.
- Tens of millions of vectors, or very high query concurrency alongside heavy transactional writes, is where contention starts to appear. Your search workload begins competing with checkout and inventory queries for the same resources.
Treat those bands as a prompt to test with your own data, not as promises. The way to know is to load a representative sample, run your real query mix, and measure recall and latency at the concurrency you expect on a sale day.
Index Types: HNSW vs IVFFlat
pgvector offers two approximate index types, and the choice shapes everything downstream.
HNSW builds a layered graph. It generally delivers better recall and latency tradeoffs and does not need training data, so you can create the index on an empty table and insert as you go. The cost is slower builds and higher memory use. For most commerce search workloads that need consistent quality, HNSW is the default choice.
IVFFlat clusters vectors into lists and searches the nearest few. It builds faster and uses less memory, but it needs representative data present when you build it, and recall depends on how many lists you probe. It can make sense for very large, mostly static datasets where build time and memory are the constraint.
The honest recommendation: start with HNSW, tune its search parameter against a recall target you define, and revisit only if memory or build time becomes a real problem. Whichever you pick, remember that an index that does not fit in memory degrades sharply, so size the instance around the index, not just the table.
Filtering With Metadata Is Where Commerce Gets Hard
A shopper never searches "all products." They search within a category, in stock, in their size, under a price, for their market. Filtering combined with vector search is the single most common place where naive implementations fall apart.
The core issue is that approximate indexes find nearest neighbors first and filters apply afterward. With a highly selective filter, the index can return too few matching rows, because most of the nearest candidates get thrown away. Recent pgvector releases added iterative index scans that keep searching until enough filtered results appear, which helps considerably, and Postgres lets you combine this with partial indexes, partitioning by market or catalog, and ordinary B tree indexes on filter columns.
This is a genuine advantage for pgvector. Your filters are real SQL against real columns, so inventory, price, and availability are current by construction. With a dedicated vector store, you duplicate those attributes as metadata and then keep them fresh. Stale availability in a search index is a conversion killer, since it sends shoppers to products they cannot buy.
Dedicated databases have invested heavily in filtered search, and some handle highly selective filters at large scale better than a general purpose database. If your queries are dominated by very restrictive filters across tens of millions of items, that is a reason to look at the specialists. Our comparison of Pinecone, Qdrant, and Weaviate for commerce covers how those options differ.
Hybrid Search: Lexical Plus Vector
Pure semantic search is a trap for commerce. Shoppers type SKUs, brand names, model numbers, and exact sizes, and embeddings are notoriously weak at those. Pure keyword search misses intent, such as "something warm for hiking in the rain." You want both.
Postgres is unusually well suited here because full text search is built in. You can run a text search over a weighted document of title, brand, and attributes, run a vector query in parallel, and merge the two ranked lists with a technique such as reciprocal rank fusion, all in one query against one database. Typo tolerance, faceting, and merchandising rules are weaker than what a purpose built search engine offers, so be realistic about the lexical half.
If your lexical needs are demanding (heavy faceting, synonyms management, merchandiser controls), a search engine will beat Postgres on that side regardless of vectors. We compare the options in Algolia vs Elasticsearch for commerce search. A common and sensible architecture keeps a search engine for lexical retrieval and merchandising while pgvector supplies semantic candidates for recommendations and long tail queries.
Operational Burden Is the Hidden Line Item
Compare what each path asks of your team.
With pgvector, you add an extension to a database you already back up, monitor, and secure. Your new work is index sizing, embedding refresh jobs, and query tuning. There is no second system to authenticate, no second copy of the catalog, and no sync lag.
With a dedicated vector database, you gain purpose built scaling and features, and you take on a sync pipeline, a second source of truth for metadata, another vendor relationship, another set of credentials and network paths, and another thing that can drift out of consistency during a sale. For a small team, that burden is often larger than the performance gap you were trying to close.
The Decision Framework
| Factor | Stay on pgvector | Graduate to a dedicated database |
|---|---|---|
| Vector count | Up to low millions (test your own data) | Tens of millions or fast growth |
| Filters | Moderate, SQL native, current data matters | Extremely selective filters at large scale |
| Query load | Modest to moderate concurrency | Heavy, spiky concurrency competing with transactions |
| Hybrid search | Postgres full text is good enough | Need advanced lexical features and merchandising |
| Team | Small team, one database to run | Dedicated platform team and appetite for another system |
| Freshness | Must reflect inventory and price instantly | Tolerant of sync delay |
The rule of thumb we use: start on pgvector, instrument recall, latency, and index memory from day one, and graduate only when a measured number crosses a line you wrote down in advance. Graduating is rarely a big bang. You can move the vector index out while the catalog stays in Postgres, keeping the same embeddings and a thin retrieval interface so the swap is contained.
What This Means for Your Business
The cost of premature infrastructure is not just the invoice. It is the weeks spent building sync pipelines instead of improving relevance, and the incidents caused by two systems disagreeing about what is in stock. For most mid market merchants, semantic search quality depends far more on good embeddings, sensible hybrid ranking, and clean product data than on which engine stores the vectors.
If AI driven discovery is part of your roadmap, it also pays to think about where shoppers will increasingly start. Our piece on AI agents replacing ecommerce search is worth a read before you lock in an architecture.
How Contra Collective Bridges the Gap
We help commerce teams stand up semantic and hybrid search on the infrastructure they already run, with measured recall targets and a clean path to a dedicated store if the data justifies it. That means you ship relevance improvements first and defer infrastructure spend until it is earned. If you want help sizing your catalog and choosing a path, talk to our team.
Final Thoughts
pgvector is the right starting point for most commerce catalogs because it keeps vectors beside the data that decides whether a result is worth showing. Use HNSW, filter in SQL, blend full text with vector results, and measure before you move. Graduate to a dedicated vector database when scale, selective filtering, or concurrency makes Postgres the bottleneck in your own numbers, not in someone else's blog post.
More from the lab.
Gap and Christie's Are Running Production AI on Mac Minis: What Apple's Q4 Call Actually Revealed About Enterprise Local Inference
On its fiscal Q4 earnings call on November 2, 2026, Apple named two enterprise customers doing something more specific than the usual AI PC talking point: Gap runs AI loss prevention models across hundreds of stores entirely on Mac minis, which CFO Kevan Parekh described specifically as eliminating cloud token costs, and Christie's runs pricing estimate models on Mac Studio. Apple's pitch is that a few thousand dollar Mac can produce inference value worth tens of thousands over its life. That math is directionally right for a narrow set of workloads, and it is not a general argument against cloud inference, even though the earnings call framing invites you to read it that way.
Kimi K3.1 Pro: Moonshot's Open Weight Model and What a 1M Token Context Actually Changes
Kimi K3.1 Pro went live in Moonshot's API on October 23, 2026, priced at 2 dollars per million input tokens and 10 dollars per million output tokens, with a 1 million token context window. Moonshot promised open weights by November 4. The model inherits Kimi K3's reported 2.8 trillion total parameters and 104 billion active parameters per token, which means the real question for most teams is not whether it is open but whether anything they own can actually run it.
oMLX on Apple Silicon: What the SSD KV Cache Actually Buys Coding Agents
oMLX search interest has climbed fast this year, and the pull is a specific engineering claim: a coding agent's time to first token dropping from 90 seconds to as little as 3 once a long prompt's key value cache is already sitting on SSD instead of being recomputed from scratch. The architecture is real and the restore speed is measurable. The claim is also softer than the headline number suggests, and this post works through both halves.