Pinecone vs pgvector
Keep Postgres. The choice here is only about where vector search runs. pgvector adds a vector type and vector indexes to Postgres. It starts to fall short in three places: how much memory the index needs, what happens to your results when you filter, and how well recall holds up as the data changes.
Pinecone wins on complete results for filtered queries, capacity you do not have to predict, and recall that holds up as data changes. It also runs full-text search with BM25 keyword ranking in the same index as your vectors. pgvector is the better choice when the corpus is small and mostly static, the index fits in memory you already pay for, and you would rather not run a second system.
The short version
pgvector is a reasonable choice when your vector workload is small, mostly static, and sits next to relational data you already keep in Postgres. Keeping everything in one system is an advantage. For a prototype or a modest corpus, it works.
Pinecone is the better fit once the workload grows, changes continuously, or depends on metadata filters returning complete results. pgvector's HNSW index (a graph-based search index) has to fit in memory to build and query at speed. Postgres applies metadata filters after the vector search has already picked its candidates. The other index type, IVFFlat, groups vectors into clusters when it is built and loses recall as the data changes afterward. These limits come from adding vector search to a relational database. Tuning does not remove them. Moving vector search to Pinecone does not mean adding a separate keyword search engine: one Pinecone index holds full-text (BM25), dense, and sparse fields.
Postgres also brings decades of operational maturity that Pinecone does not have. You get point-in-time recovery, streaming replication, mature backup tooling, extensive access controls, and a hiring pool that already knows how to run all of it. Moving vector search out means running a second system with its own approach to each of those. For some teams, that trade does not pay off.
When to pick which
Each system is the better choice for some workloads. These lists say which.
Choose Pinecone when
- You need keyword search with BM25 ranking in the same index as your vectors, along with sparse retrieval, reranking, or embedding generation.
- Your corpus grows past the point where keeping the index in memory is affordable, or you cannot predict how large it will get.
- You filter on metadata and need every query to return the full number of results you asked for.
- Vector inserts, updates, and deletes keep arriving after the initial load.
- You would rather not own index sizing, index rebuilds, and query-plan tuning.
Choose pgvector when
- You want vector search inside the database that already holds your data, with the backups, point-in-time recovery, replication, and access control you already run and trust. That is an advantage Pinecone does not offer.
- You need vectors and rows in the same transaction. A vector query that runs outside the database cannot join against your relational tables. If that join has to be transactional, pgvector is the correct answer.
- Your corpus is small and mostly static, with an index that fits in the memory you already pay for. Under those conditions HNSW on Postgres performs well. It is also simple to operate.
- Vector search is a secondary feature next to relational queries and you would rather run one database than two.
- Your team already runs Postgres well. For you, the cost of operating a second system outweighs what better retrieval would buy.
Feature by feature
How Pinecone and pgvector differ on the points that usually decide it.
| Capability | Pinecone | pgvector |
|---|---|---|
| Deployment model | PineconeYou create an index and write to it. Data sits in object storage, Pinecone runs the servers that answer queries, and you never choose an instance size, a node count, or a cluster layout. | pgvectorAn extension you install into a Postgres instance you run or rent. You size it. |
| Index memory sizing | PineconeYou do not size index memory. You pay for the data you store and the operations you run. | pgvectorThe HNSW index should fit in working memory. In Pinecone's April 2024 benchmark across four public datasets, index memory ran between 1.2x and more than 5x the raw dataset size. |
| Behavior when the index exceeds memory | PineconeNot applicable. Vectors live on object storage and are cached on the query servers Pinecone runs. | pgvectorThe index build spills to disk. In the same benchmark, build throughput dropped by more than 10x past that point. |
| Metadata filtering | PineconePinecone applies filters during the search itself. A filtered query returns as many results as you asked for, as long as enough records match the filter. | pgvectorBy default, Postgres applies the filter after the index scan. A selective filter can therefore return fewer results than you asked for. Since 0.8.0 an opt-in iterative scan keeps searching until it has enough matches, up to a cap on how many index entries it visits. |
| Query path predictability | PineconeEvery query takes the same retrieval path. | pgvectorThe Postgres planner chooses between the vector index, a GIN index (an inverted index Postgres can use for filters), and a sequential scan. Queries that look alike can take different paths. |
| Recall under changing data | PineconePinecone re-optimizes the index continuously in the background. There is no re-indexing step. | pgvectorIVFFlat partitions are set once, when the index is built. In the same benchmark, recall fell as data arrived after the index was built. |
| Scaling model | PineconeBillions of vectors. Automatic on the on-demand tier, where you never pick a shard or replica count. On Dedicated Read Nodes, which are capacity you provision, shards and replicas are set by hand today. | pgvectorLimited by the memory of one instance. Growing past it means a bigger instance or sharding that you build yourself. |
| Embedding dimensions | PineconeDense vectors can have up to 20,000 dimensions. You do not have to compress (quantize) them yourself to get there. | pgvectorHNSW indexes stop at 2,000 dimensions. The limit is hard-coded in the pgvector source. No setting changes it. A 3,072-dimension model cannot be indexed at full precision. The ways around it are halfvec (a half-precision vector type), binary quantization, or reducing the dimensions. |
| Multi-tenancy | PineconeOne index holds a namespace per tenant, with nothing to provision for each new tenant. The documented limit is 100,000 namespaces per index on Standard and 1,000,000 on Enterprise. Dedicated Read Nodes support one namespace per index today. For now you cannot combine them with a design that keeps many tenants in one index. | pgvectorA tenant column with a filter, a table per tenant, or a schema per tenant. You choose the design and build its indexes yourself. The filtering behavior described above applies to the tenant-column design. |
| Running it in your own cloud | PineconeBring your own cloud on AWS, Azure, and GCP. | pgvectorAlready the case. pgvector runs inside the Postgres you operate. That is the strongest form of running in your own cloud and a good reason to stay. |
| Hybrid and sparse retrieval | PineconeDense vectors, sparse vectors, and full-text search with BM25 keyword ranking. Dense and sparse vectors combine in one query. Full-text and dense combine as a text-match filter on a dense search, or as two searches merged in your application. | pgvectorA sparsevec type and a bit type alongside dense vectors, plus Postgres full-text search for keyword matching. You write the code that merges their results into one ranked list. |
| Licensing and source | PineconeCommercial managed service. | pgvectorOpen source under the PostgreSQL License. Postgres itself is open source too. |
| Embeddings and reranking | PineconePinecone Inference hosts embedding and reranking models alongside the index. | pgvectorBring your own models and pipeline. |
| Pricing model | PineconeUsage based. You pay for storage and the reads and writes you run. | pgvectorYou pay for the instance and storage you provision, whether or not the instance is busy. |
What we measured
We ran Postgres with pgvector against four public datasets and published the results. The numbers below come from that benchmark.
1.2x to 5x+
index memory compared with raw dataset size. Because the ratio varied by dataset, capacity is hard to plan in advance
10x+
drop in index build throughput once the HNSW graph no longer fits in working memory
1 of 10
results returned by a filtered query in one tested case, even with the candidate count raised to its maximum. At the default setting the same query returned nothing. This happens because Postgres applies the filter after the HNSW search
1.5x to 2.9x
lower ongoing monthly cost for Pinecone Serverless across the four tested datasets, or 1.1x to 2.2x including the one-off initial upsert (the first load of all the vectors)
Datasets: mnist, nq-768-tasb, yfcc (10M), and cohere (10M). The cost model assumes a full upsert, an average of 10 queries per minute, and 10 percent of the dataset modified each month. The pgvector side is priced as the EC2 instance needed to answer 95 percent of queries in under 100ms (p95 latency), plus EBS storage. These runs date from April 2024 and predate pgvector 0.8.0, which added iterative index scans and better cost estimates for filtered queries. The filtering section below covers what changed. We last checked the claims on this page against pgvector 0.8.6, the current release at the time of review.
Source: Pinecone vs. Postgres pgvector: For vector search, easy isn't so easy (April 2024). Results depend on the dataset, query pattern, and configuration. Test your own workload before deciding on these numbers.
Index memory is hard to predict
pgvector builds its HNSW graph in memory. To keep builds and queries fast, that graph needs to fit in the memory you have provisioned. How much it needs depends on the data itself as well as its size on disk.
In Pinecone's benchmark, index memory ranged from about 1.2x the raw dataset size on one dataset to more than 5x on others. No simple formula tells you where your data falls before you load it. If you guess low, the index spills to disk. In the benchmark, build throughput then fell by more than 10x.
The trouble shows up after launch. An application ships with acceptable latency, data accumulates, the index outgrows the memory it was given, and query latency degrades sharply. The fix at that point is a larger instance or sharding the database.
pgvector's own scaling guidance names two ways to shrink the index. The halfvec type stores each dimension in two bytes instead of four. An expression index over binary_quantize() shrinks it further. You then rerank the results against the original vectors to win back the recall that quantization loses. Try both before you conclude the index will not fit. The benchmark numbers above were measured on the full-precision vector type, without either technique.
Both techniques leave the work with you. You choose the representation, tune how deep the reranking goes, and re-check recall as the data changes. Pinecone chooses and adjusts quantization itself while it re-optimizes the index in the background.
Filtering after the search can cut results short
Most retrieval applications filter, by tenant, document set, date range, or language.
pgvector's HNSW index does not apply those filters while it searches the graph. Postgres searches the vector index first, then applies the WHERE clause to what comes back. When the filter is selective, Postgres throws away most of the candidates and the query returns fewer results than you asked for. One query in Pinecone's 2024 test set returned nothing at all. Raising the candidate count to its maximum brought back a single result out of ten.
A GIN index lets Postgres filter first and then rank, which works when the planner chooses it. In the same test set, the planner sometimes used the vector index instead and returned partial results. In another case it skipped both indexes and ran a sequential scan that took several seconds. Queries that looked alike took different paths.
pgvector has since added a mitigation. Version 0.8.0, released in October 2024 after the benchmark above, introduced iterative index scans. When a filtered query comes up short, pgvector can keep scanning the index until it has enough matches. It is off until you enable it per session with the hnsw.iterative_scan setting. Because it stops at a configurable cap on how many index entries it visits, it cannot guarantee a full result set. Its relaxed-ordering mode gives up exact distance ordering to get better recall. The same release also improved the planner's cost estimates for choosing an index when a query filters.
If you are staying on pgvector, iterative scans narrow the gap. The underlying difference remains. Postgres still filters outside the index search. Complete results depend on a setting you have to know about and tune. Even then, the scan stops at a cap on how many index entries it visits. Pinecone applies filters during the search itself. A filtered query returns the full number of results you asked for, as long as enough records match the filter. There is nothing to configure.
Pinecone has caveats of its own here. The claim above describes how the search works. We have published one measurement behind it. In our benchmark against OpenSearch on 10 million vectors, Pinecone's filtered queries found an average of 98.9% of the true 10 nearest matches, against 99.8% for OpenSearch. We have not published recall at each level of filter selectivity, the view that would show where filtering starts to cost accuracy. Pinecone filters also have limits: at most 10,000 values in an $in or $nin list and at most 40 KB of metadata per record. Run your real filters against both systems before you decide.
IVFFlat saves memory but loses recall as data changes
pgvector's other index type, IVFFlat, needs far less memory than HNSW. It clusters vectors into partitions when the index is built.
Those partitions reflect the data that existed at build time. Vectors added later go into partitions that were drawn without them. In Pinecone's tests, recall dropped on every dataset once the data had changed since the initial build. Getting it back means rebuilding the index.
That rules IVFFlat out for most production retrieval, where documents are added and updated all the time.
Most vector benchmarks do not look like production
Published vector benchmarks tend to query a frozen corpus one client at a time. HNSW earns its good results on that test. Most applications serve concurrent traffic against a corpus that is still being written to.
Under that load, two things change. Adding a vector to an HNSW graph means running a series of approximate searches through the graph's layers. Writes therefore compete with queries for the same memory and CPU. On a single Postgres instance, queries, ingest, index rebuilds, and autovacuum all contend for that one machine. Read replicas can take some read traffic off the primary, but you then have replicas to run and replication lag to deal with.
The slowdown hits the slowest requests while the median still looks fine. A healthy p50 (median latency) can sit alongside a p99 (the slowest 1 percent of requests) that has climbed into seconds. Users feel those slow requests. Pinecone separates storage from compute and gives reads their own capacity. Ingest does not compete with queries.
What the operational difference costs
Keeping vectors in Postgres saves you a second system, but running pgvector at scale still takes work. You predict index memory, watch for the point where it stops fitting, choose between two index types that fail in different ways, add GIN indexes to make filters behave, and check query plans when results look wrong.
Pinecone's benchmark also modeled direct cost across the four datasets. On ongoing monthly cost, Pinecone Serverless came out between 1.5x and 2.9x cheaper. Including the one-off cost of the initial upsert, it came out between 1.1x and 2.2x cheaper. Those figures exclude the cost of operating Postgres itself.
You also pay for idle capacity. A Postgres instance sized for peak index memory is paid for around the clock, whether or not anyone is querying it. By default, Pinecone charges for what you query. Where traffic is sustained enough to justify provisioned capacity, Dedicated Read Nodes trade per-query cost for fixed read capacity. Pinecone has published three production workloads that moved to Dedicated Read Nodes: 77 percent lower cost on a billion-vector index at low query volume, 83 percent on a latency-sensitive workload, and 97 percent on one with sustained high QPS (queries per second).
Moving from pgvector
Moving means reading from Postgres and upserting into Pinecone. Pull the vectors along with their metadata, then write them into an index. For a large table, bulk import from object storage saves you from sending everything through the API one batch at a time. The guide walks through every step, including how a pgvector column and its metadata map onto a Pinecone index and namespace.
Talk to an engineer or read how Pinecone works.
Frequently asked questions
Should I keep Postgres if I move vectors to Pinecone?
Usually yes. Postgres stays the system of record for relational and transactional data. Pinecone holds the vectors and the metadata you filter on at query time. It returns IDs that your application maps back to Postgres rows.
Is Pinecone a good alternative to pgvector?
For vector search, yes. Pinecone replaces the vector search path. Postgres stays. If your corpus is small and mostly static and the index fits in memory you already pay for, pgvector is a good answer and staying put is reasonable. Moving makes sense when you hit one of three limits: index memory you have to predict in advance, filters that Postgres applies only after the vector search, and recall that drops as the data changes.
Is comparing Pinecone to Postgres the same as comparing it to pgvector?
For vector search, yes. Postgres has no native vector type. pgvector is the extension that adds one. When managed Postgres providers advertise vector support, pgvector is what they mean. Comparing Pinecone with Postgres for vector search is therefore a comparison with Postgres running pgvector.
Is pgvector good enough for production?
It can be, for small and mostly static vector workloads that sit next to relational data. The limits appear as the corpus grows and changes. The HNSW index needs to fit in memory to stay fast. Because Postgres applies metadata filters after the search, a filtered query can return fewer results than you asked for. The IVFFlat index loses recall as the data changes after the index is built.
Why does pgvector return fewer results than I asked for?
pgvector's HNSW index does not check metadata filters while it searches. Postgres finds the nearest neighbors first, then applies the WHERE clause to those candidates. If the filter is selective, it removes most of them and you get fewer results than you asked for. There are two mitigations. A GIN index on the filtered column can make Postgres filter first, when the planner chooses that path. Since version 0.8.0 you can also turn on iterative index scans with the hnsw.iterative_scan setting. They keep scanning until they find enough matches, up to a configurable cap on how many index entries they visit. Both are opt-in. Neither guarantees a complete result set.
How much memory does a pgvector HNSW index need?
It depends on what the data looks like as well as how much of it there is. In Pinecone's published benchmark the index needed roughly 1.2x the raw dataset size on one dataset and more than 5x on others. Because the ratio varies, it is hard to predict how much memory you need before you load the data.
Can I migrate from pgvector to Pinecone?
Yes. Read the vectors and their metadata out of Postgres and upsert them into a Pinecone index. Pinecone also supports bulk import from object storage for large datasets. Your Postgres database stays in place for relational data. Only the vector search moves.
What about pgvectorscale, DiskANN, or binary quantization?
They help. Try them before you migrate anything. StreamingDiskANN, pgvectorscale's disk-based index, reduces the memory pressure that breaks plain HNSW at scale. Quantization frees up memory at some cost to recall. Before you make pgvectorscale a production dependency, check its commit history. Since its last functional release in November 2025, the commits have been a copyright-year bump and a style fix. Its own README still describes the project as early stage. None of these options moves the work off your team. You still choose an algorithm, tune its parameters, size an instance around it, and re-tune as the data changes. Meanwhile queries, ingest, and reindexing compete for the same machine.
Can I still join vector results against my relational tables?
Not in a single statement. You query Pinecone through its API instead of SQL. The usual pattern is to get IDs and scores from Pinecone, then fetch the rest of each record from Postgres. Most applications already work that way. The embedding rarely sits in the same row as everything the response needs. If your retrieval requires a transactional join across relational and vector data in one statement, keep it on pgvector.
What about the benchmarks showing pgvector matching Pinecone at lower cost?
The two most-cited ones, from October 2023 and June 2024, both ran against Pinecone's pod-based indexes, a product line that has since been retired. Neither tested serverless. Neither could have tested Dedicated Read Nodes, which reached general availability in April 2026. For any benchmark in this space, check which product it measured and when. The same check applies to ours. Our figures are from April 2024 and predate pgvector 0.8.0, the release that added iterative index scans.
Is Pinecone cheaper than running pgvector?
In Pinecone's published benchmark across four datasets, Pinecone Serverless was 1.5x to 2.9x cheaper on ongoing monthly cost, and 1.1x to 2.2x cheaper including the one-off initial upsert. The pgvector side was priced as the instance required to keep p95 query latency under 100ms, plus storage. That comparison excludes the staff cost of operating Postgres. Your own result depends on your data volume and query rate. Idle capacity usually matters more. An instance sized for peak index memory is paid for around the clock. One more set of figures compares two ways of running Pinecone. pgvector is not part of it. Three published production workloads that moved from on-demand querying onto Dedicated Read Nodes cut cost by 77, 83, and 97 percent. Two limits are easy to miss when those savings are quoted alone. Dedicated Read Nodes support one namespace per index today. For now you cannot combine them with a design that keeps many tenants in one index. On Dedicated Read Nodes, shards and replicas are set by hand today.
Sources
- Pinecone vs. Postgres pgvector: For vector search, easy isn't so easy
- pgvector on GitHub, including iterative index scans and changelog
- Pinecone vs OpenSearch, including our benchmark
- Dedicated Read Nodes: now generally available
- How Pinecone works
- Full-text search in Pinecone
Claims about pgvector last checked against its own documentation on . Competitors ship changes we do not control. If something here is out of date, tell us and we will correct it.
Try it on your own workload
Create your first index for free, then pay as you go when you are ready to scale.