Data for AI
Pinecone vs pgvector: which fits your stack?
A managed vector service or an extension to the Postgres you already run. How they differ and how to choose.
Key takeaways
- pgvector adds vector types, distance operators and HNSW or IVFFlat indexes to Postgres.
- Pinecone is a managed service with object storage and separate read and write paths.
- pgvector filters after an approximate index scan; iterative scans help.
- Pinecone bills on usage such as storage, reads and writes.
- Pilot both on your own data before you commit.
Choose pgvector when your vectors belong next to relational data in a Postgres database your team already runs, and you want transactions, joins and one system to operate. Choose Pinecone when you want a managed service that separates storage and compute, splits data into namespaces and needs no index tuning. Both support metadata filtering and hybrid search.
What does a vector database do?
It stores embeddings and finds the ones closest to a query. An embedding is a list of numbers produced by a model, and the distance between two embeddings measures how related the two pieces of content are.[1] A search for "cancel a contract" can then find a passage about "terminating the agreement" even though the words differ.
Searching every vector gives exact results but slows down as data grows. Approximate nearest neighbor (ANN) indexes trade a little recall for speed. pgvector states this directly: by default it runs exact search with perfect recall, and adding an index switches to approximate search.[2]
Definition
A vector database stores embeddings with their metadata and answers similarity queries, usually through an approximate nearest neighbor index that trades some recall for speed.
Pinecone and pgvector are two common ways to get this. One is a managed service built for vectors; the other adds vectors to PostgreSQL.
How does pgvector work?
pgvector is an open-source extension that lets you store vectors with the rest of your data in Postgres.[2] It adds:
-
Types: vector, halfvec (half precision), bit (binary) and sparsevec.[2]
-
Distance operators: L2, inner product, cosine and L1, plus Hamming and Jaccard for binary vectors.[2]
-
Two index types: HNSW has better query performance in its speed and recall tradeoff, but builds more slowly and uses more memory. IVFFlat builds faster and uses less memory, with lower query performance.[2]
Index limits matter when you pick an embedding model. The vector type can be indexed up to 2,000 dimensions, halfvec up to 4,000 and bit up to 64,000; sparsevec indexes take up to 1,000 non-zero elements.[2] OpenAI's text-embedding-3-large returns 3,072 dimensions by default, so it needs halfvec or a shortened output to be indexed.[1]
Because it is Postgres, you keep ACID transactions, point-in-time recovery and joins.[2] An embedding and the row it describes can change in one transaction.
How does Pinecone work?
Pinecone runs as a managed service on AWS, GCP and Azure.[3] You do not run servers or tune indexes. Its documentation describes the serverless design:[3]
-
Storage: vector data sits in distributed object storage.
-
Separate paths: writes and reads take different paths that scale on their own, so queries do not slow writes and writes do not slow queries.
-
Namespaces: each index is split into namespaces, and every read and write targets one. Pinecone suggests a namespace per customer when you need to isolate tenants.[4]
-
Indexing: small slabs of data use fast, light indexing; as they grow, the system merges them into larger slabs with more sophisticated methods.
Pricing is usage-based. The Standard and Enterprise plans bill database storage, read units and write units, among other items, against a monthly minimum, and there are a free Starter plan and a flat-fee Builder plan.[5] Check the vendor's page for current rates.
Is your data ready for a vector store?
A free growth diagnostic reviews two or three time-heavy workflows, your data readiness, quick wins with current tools, and data and policy risks, then ranks your top 3 use cases by value and effort. Your top 3 findings and a 30-day fix plan in writing within 2 business days.
How do they compare side by side?
| Feature | pgvector | Pinecone |
|---|---|---|
| What it is | Extension to PostgreSQL[2] | Managed vector database service[3] |
| Where it runs | Wherever you run Postgres | Pinecone's service on AWS, GCP or Azure[3] |
| Index types | HNSW, IVFFlat; you tune them[2] | Managed by the service[3] |
| Data isolation | Schemas, tables, row rules, partial indexes | Namespaces within an index[3] |
| Keyword signal | Postgres full-text search or sparsevec[2] | Sparse vectors[4] |
| Transactions and joins | Yes, through Postgres[2] | Not a relational database |
| Scaling out | Replicas, or sharding with Citus or PgDog[2] | Read and write paths scale separately[3] |
| Cost model | Your Postgres hosting | Usage-based plans[5] |
How does filtering differ?
Both filter on metadata, but the mechanics differ.
In pgvector, filters on an approximate index are applied after the index is scanned. The README's example: if a condition matches 10% of rows, with HNSW and the default ef_search of 40, only 4 rows will match on average.[2] Version 0.8.0 added iterative index scans, which keep scanning until enough results are found, in a strict or relaxed order.[2] For filters on a few distinct values, the README suggests partial indexes; for many values, partitioning.[2]
Pinecone takes filter expressions with each query. Operators cover equality and comparison, $in and $nin lists, $exists, and $and, $or and $not.[6]
What about hybrid search?
Semantic search can miss exact strings such as product codes. Both tools let you add a keyword signal.
pgvector points to Postgres full-text search for hybrid search, and its sparsevec type can hold sparse embeddings.[2] Pinecone describes sparse vectors as capturing keyword information.[4] Its hybrid guide offers one index holding dense and sparse vectors, or separate indexes whose results you merge.[7] Our guide to hybrid search with dense and sparse embeddings covers how to weight the two.
Which should you choose?
Start from your data and your team, not from benchmarks.
-
pgvector fits when the vectors describe rows you already hold in Postgres, you need transactions or joins across them, your team runs Postgres well, and your data must stay on infrastructure you control.
-
Pinecone fits when you want no database operations for vectors, need per-tenant namespaces, or expect your vector workload to grow apart from your application database.
Other options exist, including other managed vector services and search engines with vector support. The same questions apply to each. Run a pilot on your own content with real queries and real filters, and measure recall and latency on both before you commit.
The store matters less than what goes into it. Our guide to enterprise RAG architecture covers the data pipeline, and advanced RAG reranking and chunking covers retrieval quality. Our data infrastructure for AI service covers this choice as part of our AI consulting work.
Sources
Written under our Editorial and AI Policy. Sources checked 19 Oct 2026. Reviewed by DGo Digital on 19 Oct 2026.
FAQ
Pinecone and pgvector FAQs
The pgvector README lists HNSW and IVFFlat support for the vector type up to 2,000 dimensions, halfvec up to 4,000 and bit up to 64,000. Sparse vectors can be indexed with HNSW up to 1,000 non-zero elements. Vectors can be stored with up to 16,000 dimensions, but only indexed within those limits.