Vector Search on AWS, Measured: Aurora pgvector vs OpenSearch vs S3 Vectors for RAG

2026.12.04 by Stanley Jusuf

Benchmark ran on 25 November 2026 in the Asia Pacific (Singapore) Region, ap-southeast-1. All numbers come from raw result files produced by an open harness; every chart shows the spread across repeat runs, not a single lucky run.

TL;DR

We loaded the same 5,183 scientific abstracts, embedded once with Cohere Embed Multilingualv3, into three AWS vector stores and asked each the same 300 labelled questions.

  • Aurora PostgreSQL with pgvector was the fastest and matched exact search: 1.7 to 4.4 ms median latency and up to about 1,760 queries per second on a 2-vCPU instance.
  • Amazon OpenSearch Service also matched exact search, but took about 9 ms per query. Only 2 to 3 ms of that was the search itself; the rest was the cost of how a request reaches it (HTTPS, JSON, a per-request signature check, distributed coordination).
  • Amazon S3 Vectors was the slowest (about 60 ms) and the least accurate (it returned about 92% of the true top 10, with no setting to improve that), and it throttled above about 130 queries per second. But it needed no servers, was ready in about a minute, and costs almost nothing while idle.

At this small scale, pgvector wins on speed and OpenSearch’s per-request overhead dominates its latency. S3 Vectors wins on cost and operations for workloads that are large, bursty, or mostly idle. The results are specific to a collection that fits in memory; we explain what would likely change at scale.

1. Why benchmark the vector store?

In a retrieval-augmented generation (RAG) application, the vector store decides which documents the language model gets to read. If retrieval misses the right passage, the model cannot use it, however good the model is. Retrieval also sits on the request path, so its latency adds to every answer, and its price is paid every month whether or not anyone asks a question.

AWS offers several places to keep vectors, built on very different designs. We wanted to measure, under identical conditions:

  1. Accuracy: does it find what an exact search would find, and are the results the right answers?
  2. Latency: how long does one search take?
  3. Throughput: how many searches per second can it sustain?
  4. Operations and cost: how long does it take to stand up, and what does it cost to keep?

2. The three contenders

Aurora PostgreSQL + pgvector. pgvector is a PostgreSQL extension that adds a `vector` column type and approximate-nearest-neighbour indexes. Vectors live in an ordinary table next to the rest of your data, and you search with SQL.

Amazon OpenSearch Service. Managed OpenSearch, a distributed search engine. Its k-NN plugin stores vectors in a `knn_vector` field and searches them with a native library (here, faiss). It also does keyword search, filtering and aggregations.

Amazon S3 Vectors. Vector storage built into S3. You create a vector bucket and vector indexes inside it, then put and query vectors through an API. There are no instances: you pay for storage, uploads and queries. Both pgvector and OpenSearch were configured with HNSW (Hierarchical Navigable Small World), the most common approximate-search index. HNSW links each vector to its nearest neighbours in a layered graph. A search starts at the top and walks the graph toward the query, keeping a list of the best candidates. The size of that list, ‘ef_search’, is the main tuning knob: a longer list checks more candidates, which is more accurate and slower. S3 Vectors manages its index internally and exposes no such knob.

3. Methodology

The guiding rule: hold everything constant except the store. Same data, same vectors, same questions, same client, same network position, same instance shape where there are instances.

3.1 Dataset: BEIR SciFact

We used ‘SciFact’ from the BEIR retrieval benchmark: 5,183 scientific abstracts and 300 test claims (short scientific statements), with 339 human judgements of which abstracts are relevant to which claim. Licence: CC BY-SA 4.0.

Why SciFact:

  • It has human relevance labels. That lets us measure answer quality (nDCG, MRR), not just agreement with an exact search, without hand-labelling anything.
  • It is a standard benchmark, so the quality numbers can be compared with published BEIR results.
  • It is small enough to run cheaply and repeat several times. Each abstract was indexed as its title followed by its text.

3.2 Embeddings

Every text was embedded once with Cohere’s Embed Multilingual v3 on Amazon Bedrock, producing 1,024-dimensional vectors. (Amazon Titan Text Embeddings V2 is not available in ap-southeast-1, so we used Cohere.) Three details matter for correctness:

  • Documents and queries are embedded differently. Cohere requires an `input_type`: `search_document` for abstracts and `search_query` for claims. Getting this wrong raises no error; it silently makes retrieval worse.
  • Long texts were truncated to 2,048 characters, because Bedrock rejects longer inputs. The model’s own limit is 512 tokens, roughly the same length.
  • Vectors were L2-normalised, so cosine similarity equals the dot product. Every store was configured for cosine similarity. The resulting vectors were saved once and loaded, byte for byte, into every store.

3.3 Ground truth: exact search

To know what each store *should* return, we ran an exact search: compare each claim with all 5,183 abstracts and keep the 10 most similar (FAISS `IndexFlatIP` on the normalised vectors). This is slow at scale but perfectly accurate, and it is the reference for “recall”. Exact search is also the ceiling for answer quality with these embeddings. It scores “nDCG@10 = 0.7016” and “MRR = 0.6735”, and finds at least one relevant abstract in the top 10 for 248 of the 300 claims (82.7%). A store cannot be expected to beat the embedding model; the fair question is how close it gets to 0.7016.

3.4 Store configuration

Aurora pgvectorOpenSearchS3 Vectors
VersionAurora PostgreSQL 16.15OpenSearch 2.19GA service
Compute1 × db.r6g.large (2 vCPU, 16 GiB)1 × r6g.large.search (2 vCPU, 16 GiB)serverless
IndexHNSW, vector_cosine_opsfaiss HNSW, cosinesimilmanaged, cosine
Build parametersm = 16, ef_construction = 64m = 16, ef_construction = 64none exposed
Layoutone tableone shard, no replica, merged to one segmentone index
Search settings testedef_search 32, 64, 128, 256ef_search 32, 64, 128, 256n/a

Fairness choices:

  • Everything in memory. At this size every index fits in RAM, so no store was penalised by disk reads.
  • Same instance shape (2 vCPU, 16 GiB) for the two instance-based stores, and one node each.
  • Same HNSW build parameters, so accuracy differences come from the engines, not from different graph quality settings.
  • One shard, no replica, one segment for OpenSearch. Every OpenSearch segment carries its own graph, so unmerged segments would change both speed and recall. A single shard also matches the single Aurora instance.

3.5 Measurement protocol

Each run followed the same sequence:

  • Accuracy and latency pass. One query at a time, so each query’s latency is clean. Latency is wall-clock time measured on the client, from sending the request to having the result IDs, so it includes the network and the client library. That is what an application experiences.
  • Throughput passes. 1, 8 and 32 workers send queries in parallel, 2,000 queries per pass (cycling the 300 claims). Connections are opened before the clock starts. A request the store rejects is counted as an error, not treated as a crash, because a store’s rejection rate is its capacity limit.
  • S3 Vectors has no settings to sweep, so it was measured once before the warm-up and once after.
  • Repeats. Every store ran at least three times, each time on a freshly created store (pgvector 3, OpenSearch 3, S3 Vectors 4). The throughput method was improved after the first runs, so comparable throughput data exists for 2 pgvector runs, 3 OpenSearch runs and 2 S3 Vectors runs.

3.6 Guardrails: checks that refuse to produce numbers

Several things can go wrong in a vector benchmark without any error, producing plausible but meaningless numbers. The harness checks for them and aborts instead:

  • The harness itself: a test runs the full pipeline against a fake store that does exact search; recall must come out exactly 1.0, or the ID mapping is broken.
  • pgvector: on a small table, PostgreSQL’s planner may skip the HNSW index and do an exact scan. Recall would read 1.0 and ef_search would do nothing. The harness forces index use and confirms it with EXPLAIN before measuring.
  • OpenSearch: the k-NN plugin can skip building graphs for small segments and fall back to exact search. The harness forces graph building, merges to one segment, and confirms through the k-NN stats API that the graph is loaded in memory. ef_search is sent inside every query, so it cannot silently fail to apply.
  • S3 Vectors: the index is deleted and recreated each run, so no vectors from a previous run can linger.
  • Clients: each store’s client is sized for 32 parallel workers (64 pooled connections; one PostgreSQL connection per worker). Default pools of 10, or a single shared connection, would make the throughput numbers measure the client.

4. Infrastructure topology

Design choices and the reasons for them:

  • One client machine in the same availability zone as each store. The load generator and the Aurora and OpenSearch instances all sit in ap-southeast-1a, so no measurement crosses an availability zone. A compute-optimised c7i.2xlarge (8 vCPU) was chosen so the client would not be the bottleneck. A local client was used only for a smoke test; its internet round trip made its latency numbers useless.
  • A dedicated VPC. The benchmark’s networking is isolated from other workloads in the account and can be removed cleanly.
  • Stores in private subnets. Aurora and OpenSearch have no route to the internet. Their security groups accept traffic only from the load generator’s security group (port 5432 for Aurora, 443 for OpenSearch), and the OpenSearch access policy admits only the load generator’s IAM role.
  • No inbound access to the load generator. Its security group has no inbound rules. It is controlled through AWS Systems Manager (SSM), and its public IP is used only for outbound calls. It has no NAT gateway to pay for.
  • A second private subnet in ap-southeast-1b exists only because an Aurora subnet group must span two availability zones; the database instance itself was pinned to 1a.
  • S3 Vectors is a regional service reached through its public HTTPS endpoint, over the internet gateway (no VPC endpoint was used). The load generator’s IAM role can touch only vecbench-* vector buckets.
  • One store at a time. All three stores share the one load generator, so runs were queued one after another. Two runs at once would have competed for the client’s CPU.
  • Every store is a separate CloudFormation stack, deleted at the end of every run in a finally block, so a failed or interrupted run cannot leave a database billing. Aurora is created with DeletionPolicy: Delete; CloudFormation’s default for RDS keeps a final snapshot, which would have been billed.
  • Software on the load generator: Amazon Linux 2023, Python 3.12, numpy 2.1.3, boto3 1.44.11, psycopg 3.2.3, opensearch-py 2.7.1, all pinned.

5. The measurements, explained

MetricWhat it answersUnit and rangeBetter is
recall@10Of the 10 results an exact search returns, how many did the store also return?0 to 1higher
nDCG@10Are the results the right answers according to human judges, and are the right ones near the top?0 to 1 (ceiling here 0.7016)higher
MRRHow high does the first correct answer appear?0 to 1higher
p50 latencyHow long does a typical search take?millisecondslower
p95 / p99 latencyHow slow are the occasional slow searches?millisecondslower
QPSHow many searches per second did the store sustain?queries per secondhigher
WorkersHow many searches were in flight at once (stand-in for simultaneous users)?1, 8, 32n/a
Error rateWhat share of searches did the store refuse as over its limit?percentlower
Build timeHow long did loading and indexing 5,183 vectors take?secondslower
Provisioning timeHow long until the store existed at all?minuteslower

recall@10, in plain terms. Vector stores take shortcuts to be fast; recall measures what the shortcut costs. A recall of 0.92 means that, on average, about 9 of the 10 exact results came back and about 1 was replaced by a slightly less similar abstract. Recall says nothing about whether those results actually answer the question.

nDCG@10, in plain terms. nDCG (normalised Discounted Cumulative Gain) scores a result list against the human judgements. A correct result earns credit, and the credit shrinks the further down the list it appears; the total is scaled so a perfect ranking scores 1. For a claim with a single correct abstract: at position 1 the score is 1.0, at position 2 about 0.63, at position 10 about 0.29, and 0 if it is missing. The benchmark averages this over all 300 claims. Because the embedding model itself sometimes ranks the right abstract low, even exact search scores only 0.7016, and that is the ceiling.

MRR, in plain terms. Mean Reciprocal Rank looks only at the first correct result: 1 if it is first, 0.5 if second, 0.33 if third, and so on. It approximates how often an application that reads only the top result would get it right.

Latency percentiles. Line up all 300 query times from fastest to slowest. p50 is the middle one, the typical experience. p95 is the time 95% of queries beat. p99 is the time 99% beat, close to the worst case. With 300 queries, p99 is about the third-slowest query, so a couple of hiccups can move it a lot; we report medians as the headline.

6. Results

Ranges are across repeat runs.

Aurora pgvectorOpenSearchS3 Vectors
recall@100.989 (ef 32) to 1.000 (ef 256)0.977 (ef 32) to 1.000 (ef 256)0.914 to 0.926
nDCG@10 (ceiling 0.7016)0.700 to 0.7020.700 to 0.7020.649 to 0.665
MRR (ceiling 0.6735)0.6726 to 0.67350.6727 to 0.67350.629 to 0.640
Median latency1.7 to 4.4 ms8.2 to 12.6 ms60.0 to 60.6 ms
p99 latency2.2 to 10.7 ms11.0 to 32.0 ms65.5 to 65.7 ms
Peak throughput1,460 to 1,763 QPS (ef 32, 8 workers)237 to 303 QPS (32 workers)~130 QPS clean; 171 to 182 at 32 workers with 30 to 33% refused
Load + index 5,183 vectors5.7 to 6.3 s10.2 to 10.7 s8.6 to 9.4 s
Time to create the store~12 to 15 min~12 min~1 min
Figure 1. Recall against median latency, log scale. Each point is the median across runs; bars show the range. pgvector traces the classic HNSW curve: more accuracy costs more time. OpenSearch’s curve is almost flat because its latency is dominated by per-request overhead rather than search effort (section 7.2). S3 Vectors is a single point far to the upper left
Figure 2. Recall against throughput with 8 parallel clients, log scale. At similar recall, pgvector sustains about two to six times the throughput of OpenSearch. OpenSearch’s ef 256 point varied widely between runs (155 to 296 QPS).
Figure 3. Answer quality at each store’s most accurate setting. pgvector and OpenSearch reach the exact-search ceiling; S3 Vectors lands about 6% below it.

pgvector across settings

ef_searchrecall@10nDCG@10p50p99QPS at 1 / 8 / 32 workers
320.989 to 0.9900.700 to 0.7021.7 to 2.0 ms2.2 to 10.7 ms544–591 / 1,460–1,763 / 1,358–1,467
640.997 to 0.9980.700 to 0.7022.2 to 2.6 ms3.3 to 9.9 ms431–440 / 1,086–1,143 / 1,046–1,196
1280.99970.70162.9 to 3.1 ms4.5 to 6.0 ms322–339 / 766–846 / 802–825
2561.0000.70164.1 to 4.4 ms6.7 to 7.1 ms232–247 / 514–540 / 490–532

OpenSearch across settings

ef_searchrecall@10nDCG@10p50p99QPS at 1 / 8 / 32 workers
320.97670.700612.1 to 12.6 ms20.1 to 29.0 ms93–96 / 196–254 / 237–256
640.99470.70029.3 to 9.7 ms17.6 to 32.0 ms106–114 / 271–291 / 250–262
1280.99870.70168.5 to 9.1 ms11.0 to 16.3 ms100–119 / 258–268 / 239–303
2561.00000.70168.2 to 9.6 ms12.3 to 12.8 ms100–115 / 155–296 / 171–298

OpenSearch’s recall and nDCG were identical to four decimal places in all three runs.

S3 Vectors

recall@10nDCG@10p50p95p99QPS at 1 / 8 / 32 workers
after warm-up0.914 to 0.9260.649 to 0.66560.0 to 60.6 ms64.9 to 65.1 ms65.5 to 65.7 ms17 / 130–131 / 171–182 (30–33% refused)

7. Why the results look like this

7.1 pgvector: very little work per query

PostgreSQL authenticates a client once, when the connection opens. After that, each search is a short SQL message over an already-trusted connection. One process parses the query, walks the in-memory HNSW graph and returns ten IDs, with no coordination step and no second pass. Many small, fast queries on one machine is exactly the workload PostgreSQL was built for.

Its accuracy knob behaves as designed. Going from ef_search 32 to 256 raised recall from 0.989 to 1.000, about 2.4× the median latency, and cut throughput to about a third. Throughput peaked at 8 workers and did not grow at 32, which is consistent with a 2-vCPU database running out of CPU. We did not record database CPU, so that last point is an inference.

7.2 OpenSearch: a fixed toll on every request

The third OpenSearch run recorded OpenSearch’s own reported search time (the took field in each response) next to the latency seen by the client:

Figure 4. OpenSearch’s own search time was 2 to 3 ms (took, reported in whole milliseconds). The remaining 6 to 10 ms of each query happened outside that timer.

We then measured the client’s share separately, by running the real client code path (building the JSON body, opensearch-py, the HTTP library and request signing) against a fake network that answers instantly. It came to about 0.7 ms per query (0.31 ms to serialise the 1,024 numbers as JSON, 0.26 ms of library handling, 0.11 ms to sign). The network round trip within the availability zone must be well under 2 ms, because pgvector’s entire round trip, over the same network, was 1.7 ms. That leaves roughly 5 to 8 ms on the AWS side, outside OpenSearch’s search timer.

We did not instrument those 5 to 8 ms, but OpenSearch’s design explains where they are likely to go:

  • Each request is self-contained. OpenSearch speaks HTTP and JSON. Every request carries its own SigV4 signature, which the managed service checks against the domain’s access policy, and the full query as text, including all 1,024 numbers (14 KB). The server decrypts it, verifies it, and parses the numbers back out, every time.
  • Even one node runs the distributed pipeline. A search goes through a coordinator that picks shards, sends them the query, merges partial results, and makes a second pass to fetch the hits. With one shard on one node there is nothing to distribute, but the steps still run.
  • took rounds to whole milliseconds, so up to about 1 ms of search time can hide in the “outside” share.
  • Warm-up. The outside share fell from 9.6 ms at the first setting to 6.3 ms at the last, as more queries passed through. Part of it looks like OpenSearch’s Java code warming up.

Two observations support the idea that this is a fixed cost per request on the server side. Single-worker throughput stayed at about 100 QPS whatever the ef_search, even though search effort differs several-fold. And throughput topped out around 250 to 300 QPS at every setting, far below what the client could generate. If the node’s two vCPUs are the bottleneck at about 270 QPS, each query costs it about 7 ms of CPU, much more than took reports. We did not record node CPU, so this is a calculation, not a measurement.

The overhead buys real capabilities: stateless requests any client can make through any load balancer, per-request IAM authorisation with no passwords, sharding across many nodes, and keyword, hybrid and filtered search through the same path. Because it is roughly fixed per query, it matters most on small collections like this one, where the search itself is cheap, and should matter less on large ones.

7.3 S3 Vectors: a remote service with a rate limit

S3 Vectors answered in about 60 ms with a very tight spread (warm p99 about 65 ms). AWS documents latency of around 100 ms or less for frequent queries and under a second for infrequent ones; our results are consistent with that. We did not measure true cold latency: the index had always just been written.

It handled about 130 queries per second cleanly with 8 workers in both comparable runs. With 32 workers it refused 30 to 33% of requests with TooManyRequestsException. That looks like a per-index request limit rather than noise. A shorter, 300-query test in an early run had suggested about 400 QPS; that turned out to be a burst allowance, not a sustained rate, which is why every throughput pass now runs 2,000 queries.

Its recall of about 0.92 cannot be tuned, and it varied more between builds than the other stores (0.914 to 0.926).

7.4 Why 8% lower recall costs only about 6% answer quality

S3 Vectors missed about 8% of the exact top 10, but its nDCG was only about 6% below the ceiling. The results an approximate index misses are mostly the lower-ranked, less relevant ones, and nDCG gives those little weight. For a RAG application that passes the top few results to a model, the practical loss is smaller than recall suggests.

A related curiosity: pgvector once scored nDCG 0.7017, a hair above exact search’s 0.7016. That is possible. An approximate search sometimes skips an irrelevant near neighbour, which lets a relevant abstract move up one place.

8. Cost

On-demand prices for ap-southeast-1 from the AWS Price List API, 25 November 2026:

ItemPricePer month if left running
Aurora PostgreSQL db.r6g.large$0.313 per hour~$228, plus storage and I/O (not priced here)
OpenSearch r6g.large.search$0.202 per hour~$147
OpenSearch gp3 storage, 100 GB$0.1464 per GB-month~$15
S3 Vectors storage$0.066 per GB-month~$0.001 for this 21 MB index
S3 Vectors upload (PUT)$0.219 per GB uploaded~$0.004 per full load of this index
S3 Vectors queries$2.70 per million requests, plus a data-processed feesee below

S3 Vectors charges each query a request fee plus a fee for the data it processes, which AWS defines as the average vector size times the number of vectors in the index. For our index (5,183 vectors of about 4 KB each, no metadata), that fee is negligible, so a query costs about $2.78 per million. The fee grows with the index: the same 4 KB vectors in a 1-million-vector index would cost about $11.70 per million queries. Returned data is free here (ten small results per query, well under the free allowance).

Two ways to read these numbers:

  • Cost per million queries at full load. pgvector about $0.05 to $0.06 (ef 32 at 1,460 to 1,763 QPS), OpenSearch about $0.20 to $0.26 (at 237 to 303 QPS), S3 Vectors about $2.78. If you can keep an instance busy, it is far cheaper per query.
  • Break-even with idle time. An Aurora instance costs about $228 a month whether used or not. At $2.78 per million queries, S3 Vectors costs less until about 82 million queries a month, an average of about 32 queries per second around the clock. For OpenSearch (about $162 a month) the break-even is about 58 million queries, or about 22 per second. Below those averages, which covers most internal tools and many RAG applications, S3 Vectors is cheaper. These figures are for this small index; S3 Vectors’ per-query price rises with index size, while instance prices rise in steps when you need a bigger instance.

The whole study cost a few dollars, mostly the load generator’s five hours at $0.41 per hour, because each store existed only for the minutes of its run.

9. Which one should you use?

Points marked (measured) were shown by this benchmark. The others are what each service is designed for, and were not tested here.

If you need…Choose
The lowest latency or the highest queries per secondAurora pgvector (measured)
Vectors next to relational data: SQL filters, joins, transactionsAurora pgvector
Keyword + vector (hybrid) search, filters, facets, multi-node scaleOpenSearch
The lowest cost for large, bursty or mostly idle collections, with no serversS3 Vectors (measured: setup and idle cost)
Hot and cold tiersOpenSearch or pgvector for hot data, S3 Vectors for cold
  • Aurora pgvector suits applications already on PostgreSQL and small-to-medium collections where latency matters. Query throughput scales out with up to 15 read replicas, but each replica holds the whole index and all writes go to one writer. To spread the data itself across machines you shard it yourself (for example by customer), or use Aurora PostgreSQL Limitless Database, which lists pgvector among its supported extensions (not tested here).
  • OpenSearch suits search-heavy products, teams that already run OpenSearch, and collections too large for one machine. Expect a fixed per-request overhead of several milliseconds on top of the search itself.
  • S3 Vectors suits archives, long-tail document sets, per-customer collections and Bedrock Knowledge Bases where around 100 ms is acceptable and traffic is modest. AWS states an index can hold up to 2 billion vectors. Plan for its per-index request limit if traffic is spiky.

10. Limitations

  • Small dataset. 5,183 vectors fit in memory, which favours the instance-based stores. S3 Vectors is designed for millions to billions of vectors. Rankings, especially for latency and cost, could change at scale. Treat these results as “at small scale”.
  • Latency includes each store’s protocol. PostgreSQL’s wire protocol versus HTTPS with JSON. That is fair as “what your application sees”, but it is not a pure comparison of search engines.
  • p99 is unreliable at 300 queries per run. pgvector’s p99 at ef 32 ranged from 2.2 to 10.7 ms between runs. Quote medians, or run more queries.
  • Throughput varied 10 to 20% between runs, and one OpenSearch run dropped to about 170 QPS at ef 256. Quote ranges.
  • No server-side CPU was recorded, so “CPU-bound” statements are inferences.
  • OpenSearch’s first setting is inflated by warm-up. ef 32 was the slowest setting in all three runs despite doing the least work, and the extra time was entirely outside the search. pgvector showed no such effect. A longer warm-up would remove it.
  • S3 Vectors cold latency was not measured, and S3 Vectors was reached over its public endpoint, not a VPC endpoint.
  • One discrepancy is unexplained. In a local smoke test, S3 Vectors scored nDCG 0.693 with byte-identical data, against about 0.65 on EC2.
  • Not tested: filtered search, hybrid search, writes or updates under load, multi-node clusters, quantisation, Aurora Serverless, OpenSearch Serverless.

11. Pitfalls we hit, so you don’t

These are the bugs we found while building the benchmark. Most of them would have produced believable but wrong numbers rather than errors.

  1. The database skipped the vector index. On small tables, PostgreSQL may choose an exact scan over HNSW. Check EXPLAIN.
  2. OpenSearch may not build graphs for small segments, and multiple segments change recall and speed. Set index.knn.advanced.approximate_threshold to 0, force-merge, and check the k-NN stats.
  3. faiss with cosinesimil requires OpenSearch 2.19 or later. Earlier versions reject the combination.
  4. Client connection pools limit throughput. botocore and opensearch-py default to 10 connections. A single shared PostgreSQL connection serialises every query.
  5. Short throughput tests measure bursts. A 300-query pass finished inside S3 Vectors’ burst allowance and suggested about 400 QPS; 2,000-query passes showed about 130 to 180.
  6. Treat throttling as a result. Counting refused requests turned a crash into the most useful S3 Vectors finding.
  7. Cohere on Bedrock: set input_type differently for documents and queries, keep texts under 2,048 characters, and retry on tokens-per-minute throttling.
  8. CloudFormation keeps a final RDS snapshot by default, which is billed. Set DeletionPolicy: Delete for throwaway databases.
  9. Old SDKs lack new services. boto3 1.35 has no S3 Vectors client.
  10. A newly created OpenSearch domain may drop its first connections. Our first run failed nine seconds after CloudFormation reported the domain ready. Wait for a health check before measuring.

12. Reproducing the benchmark

The harness lives in the vector-bench project:

vector-bench/
  harness/           code that runs on the load generator
    adapters/        one adapter per store, same interface
    datasets/        SciFact loader, Cohere embedding
    ground_truth.py  exact top-10 search
    metrics.py       recall, nDCG, MRR, percentiles
    runner.py        warm-up, sweep, throughput passes
  infra/             CloudFormation: VPC + data bucket, load generator, one stack per store
  scripts/           publish, run (with guaranteed teardown), queue, price lookups
  analysis/          summaries and charts from the raw results
  results/           raw JSON for every run

The sequence: deploy the foundation stack (VPC and data bucket), embed the corpus and compute ground truth once, publish code and data, deploy the load generator, then run scripts/run_store.ps1 -Store <name> for each store. Every run deletes its store at the end. python -m analysis.summarize_runs and python -m analysis.blog_charts regenerate every number and chart in this post from the raw results.

13. Conclusion

On a small RAG collection, Aurora pgvector gave the best combination of accuracy, latency and throughput, and its accuracy knob behaved exactly as HNSW should. OpenSearch matched it on accuracy, but paid a fixed overhead of several milliseconds per request for being a distributed, HTTP-based search engine; that overhead is what you buy hybrid search, filtering and scale-out with. S3 Vectors was the slowest and least accurate, and its request limit is real, but it was ready in a minute, has nothing to operate, and at modest traffic costs less than either instance-based store.

There is no universal winner. The useful question is what your workload looks like: how big the collection is, how busy it is, how much latency your users will notice, and whether you need search features beyond nearest neighbours. Measure with your own data if you can, and watch for the silent failures in section 11.


References

Back to Blog