top of page

When Does a Dedicated Vector Database Outperform Postgres pgvector?

11 minutes ago
6 min read

If you already run Postgres, starting with pgvector feels obvious. Your data is already there. Your team knows the database. Backups, permissions, migrations, monitoring, all of that is probably in place.


So the real question isn’t “Are dedicated databases better?” The useful question is this:


At what point does staying inside Postgres stop being the simpler choice?


The short answer: Postgres with a vector search extension is usually great for small to mid-sized workloads. A dedicated database starts to pull ahead when the number of items gets large, search traffic gets heavy, filtering gets complex, or latency has to stay low all the time.


A rough rule of thumb:


Data scale

Best starting point

Why

Under 1 million items

Postgres extension

Simple, cheap, easy to operate

1 million to 10 million items

Benchmark both

Either can work, workload matters a lot

10 million to 100 million items

Dedicated database often wins

Search speed, scaling, and isolation start to matter

Over 100 million items

Dedicated database is usually the safer bet

Postgres can struggle to stay fast and predictable


That’s not a law of nature. It’s a practical starting point. The real cutoff depends on item size, search patterns, filters, update rate, and how much delay your app can tolerate.


Wide-angle view of stacked database blocks beside a glowing search cube

Start with Postgres for vectors when the data is close to the app

Postgres is a great place to begin when your search data is tied to normal app data.


Think of a product catalog. Each product has a name, price, category, inventory count, and a chunk of numeric meaning created from the product text or image. Those numbers let the app find “similar” items, even if the words don’t match exactly.


Keeping that in Postgres means you can ask questions like:


  • Find similar products in the same category

  • Search only active listings

  • Sort results by price or date

  • Join results to users, permissions, or orders


That’s where pgvector earns its keep. You’re not adding a new system just to run one feature. You’re extending the database you already trust.


For many apps, that’s enough for a long time.


Postgres is often the right choice when:


  • You have fewer than a few million searchable items

  • Search traffic is modest

  • Results can take tens or hundreds of milliseconds

  • Your filters are simple

  • Your app already uses Postgres as the main source of truth

  • Your team doesn’t want another service to manage


At this stage, a dedicated system can add more trouble than value. You’ll need to copy data into it, keep that copy fresh, monitor it, secure it, and debug it when results differ from Postgres.


Small systems benefit from fewer moving parts.


Dedicated databases start winning when speed must stay steady

The first real warning sign usually isn’t total data size. It’s unpredictable performance.


Maybe searches are fast most of the day, then slow during traffic spikes. Maybe adding new items makes search speed worse. Maybe a few customer accounts with huge data sets drag down everyone else. Maybe a normal Postgres job, like a backup or report query, makes search feel sluggish.


That happens because Postgres is doing many jobs at once. It stores app records, handles writes, joins tables, checks permissions, runs reports, and now also searches through thousands or millions of numeric fingerprints.


A dedicated database for this kind of search has a narrower job. It is built to answer similarity queries quickly, at high volume, across large collections.


That difference shows up when you care about tail latency.


Tail latency means the slow searches, not the average ones. An average response time can look fine while 1 out of 100 users sees a slow page. For search features, those slow cases matter. They make the app feel broken.


A dedicated database tends to pull ahead when you need:


  • Fast results during traffic spikes

  • Many searches at the same time

  • Predictable response times

  • Large indexes that don’t fit comfortably on one machine

  • Search workloads separated from normal app database work


This is where the 10 million item mark becomes meaningful. Below that, Postgres can still be excellent. Above that, the search index can become large enough that memory, disk speed, and background database work start to shape the user experience.


The exact number could be lower or higher. Ten million short text chunks are different from ten million long documents with many filters and frequent updates.


Filters can move the cutoff earlier than expected

Raw similarity search is only part of the story. Most real apps also filter.


A support tool might search only one customer’s documents. A shopping app might filter by brand, size, seller, inventory, and region. A security app might filter by tenant, date, and access rules.


Those filters can change everything.


If your app searches across all items, the database can use its search index in a pretty direct way. If your app first narrows results to “only these 3,000 items out of 50 million,” the system has to combine two jobs:


  1. Find items that are meaningfully similar

  2. Respect the filter rules


That combination can be hard.


Postgres is very good at normal filters. Dedicated search databases are very good at similarity search. The tricky part is doing both together without wasting work.


Postgres may work well when filters are selective and simple. For example, searching only one customer’s small document set can be fast even if the whole database is large.


A dedicated database may win when filters are:


  • Applied to very large collections

  • Used in many combinations

  • Paired with strict response time goals

  • Needed for many users at once

  • Changing often


Here’s the twist: filtering by tenant can help or hurt.


If each tenant has a small amount of data, Postgres can do well because each search touches a small slice. If a few tenants have tens of millions of items, that same design may become painful. The “average tenant” won’t tell you much. The biggest tenants will set the limits.


Close-up of colorful index cards sorted through a bright mechanical filter

Write-heavy apps change the math

Some search systems are mostly read-only. You build an index over a stable library of documents, then query it all day.


Others change constantly. New messages arrive. Products sell out. Users upload files. Articles get edited. Fraud signals update. Recommendations refresh.


Frequent writes can make Postgres less comfortable for this job, especially at scale.


Search indexes need upkeep. When you add, update, or delete items, the database has to keep the search structure useful. That work competes with normal app work.


For a small app, no big deal. For a large one, write pressure can cause:


  • Slower inserts

  • Slower searches during updates

  • Larger database files

  • More maintenance work

  • More tuning work for the team


Dedicated systems are often better at handling this pattern because they separate search storage from the main app database. Some are designed to ingest new items in batches. Some split data across machines. Some let you rebuild or refresh parts of the search index without putting pressure on your core database.


That doesn’t mean you should split too early. A second database creates its own problems. You now have two versions of the data. You need to decide what happens when Postgres has a record but the search database hasn’t received it yet.


For many apps, a short delay is fine. For others, it isn’t.


Ask this simple question:


If a user adds something, does it need to appear in search immediately?


If yes, Postgres may be simpler for longer. If no, a dedicated system becomes easier to justify once the data gets large.


The real breakpoint is workload, not just row count

It’s tempting to ask for one magic number. There isn’t one.


A million items can be hard if each item is large, filters are complex, and traffic is high. Fifty million items can be manageable if searches are rare, data is split cleanly, and response time goals are loose.


Instead of asking only “How many items do we have?” ask these questions:


Question

Why it matters

How many searchable items are there?

More items mean larger indexes and more work per query

How many numbers describe each item?

Larger item fingerprints take more memory and storage

How many searches happen per second?

Traffic can matter more than total size

What response time feels acceptable?

A background tool can wait longer than a user-facing search box

How often does data change?

Updates add index maintenance work

How many filters does each search use?

Filters can make search much harder

Does search share Postgres with core app traffic?

Heavy search can hurt normal app queries

Can results be slightly stale?

Delayed updates make dedicated systems easier to run


A good test should use your real data shape. Fake data can mislead you. Random text chunks don’t behave like product titles, legal documents, chat messages, or image descriptions.


Also test the slow cases, not just the easy ones.


Use queries like:


  • Very common searches

  • Rare searches

  • Searches with heavy filters

  • Searches for the largest customer

  • Searches during writes

  • Searches while normal app traffic runs


The winner is the system that stays fast enough under the messiest normal day, not the one that looks best in a clean demo.


Cost changes shape as the system grows

Postgres usually wins early on cost because you already have it. No extra service. No new data copy. No new failure mode.


But that cost advantage can shrink.


If search forces you to buy a much larger Postgres machine, tune indexes constantly, slow down normal queries, or add read replicas just to survive, the “free” extension isn’t really free anymore.


Dedicated databases have their own cost. You pay for the service or run more machines. You build data syncing. You add monitoring. You train the team. You handle failures between systems.




bottom of page