New See exactly what you're overpaying AWS in under 60 seconds. Estimate your AWS savings →

RDS PostgreSQL Extensions Cost: pgvector, PostGIS, and What Actually Drives Your Bill

Picture of Vishal Sharma
Senior Content Strategist

Vishal Sharma

Senior Content Strategist
October 18, 2026

·

15 min read
RDS PostgreSQL Extensions Cost: pgvector, PostGIS, and What Actually Drives Your Bill
In this article

The AI Overview gets the headline right: pgvector and PostGIS are free extensions on Amazon RDS for PostgreSQL. No licensing fee, no per-query charge, no additional line item for enabling them. You run CREATE EXTENSION vector; and the extension is active. AWS does not charge more per hour because you are using vector similarity search or geospatial queries.

The cost impact is entirely indirect. These extensions change what your workload demands from the underlying RDS instance — more memory for index operations, more CPU for spatial computations, more storage for indexes that can be as large as the data they cover. On the wrong instance, pgvector queries degrade to full table scans or index builds fail partway through. On the right instance, both extensions perform at the level your application requires.

This guide covers the specific storage and memory math for pgvector HNSW indexes at common embedding dimensions, the instance sizing decision for PostGIS spatial workloads, verified 2026 pricing for the instances that actually support these workloads, and the RI purchasing strategy that applies once you have the right instance size confirmed.

See exactly what you’re overpaying in under 60 seconds. Try the Calculator for free →

pgvector on RDS: Current Version and What It Includes

Amazon RDS for PostgreSQL supports pgvector 0.8.2 as of the latest release notes (June 2026). pgvector 0.8.0 launched November 21, 2024 and is available on PostgreSQL 17.1+, 16.5+, 15.9+, 14.14+, and 13.17+. Source: AWS official announcement aws.amazon.com/about-aws/whats-new/2024/11/amazon-rds-for-postgresql-pgvector-080.

pgvector enables: storage of high-dimensional vectors (embeddings) directly in PostgreSQL tables using the vector, halfvec, and sparsevec data types. Approximate nearest neighbor (ANN) search using HNSW (Hierarchical Navigable Small World) and IVFFlat indexes. Exact nearest neighbor search without an index. Distance calculations using cosine, Euclidean (L2), and inner product metrics. Support for up to 2,000 dimensions for indexed vectors (standard vector type), up to 4,000 for halfvec, and up to 64,000 for binary vectors.

HNSW (added in pgvector 0.5.0, October 2023) is the preferred index type for production pgvector workloads because it provides fast approximate search with high recall at query time. IVFFlat requires training a clustering step before indexing and requires the full dataset to be loaded before the index is built. HNSW supports concurrent inserts and incremental updates without rebuilding the index. Source: AWS official announcements October 2023 and May 2024.

pgvectorscale is NOT available on Amazon RDS for PostgreSQL as of mid-2026. pgvectorscale (from Timescale) uses the DiskANN algorithm and provides significantly better performance and storage efficiency at scale compared to pgvector’s HNSW for very large vector datasets. Teams running more than 10 million vectors who need pgvectorscale must self-manage PostgreSQL on EC2. This is a known gap — multiple teams have filed feature requests via AWS re:Post.

The HNSW Index Storage Math: What 1 Million Vectors Actually Costs

Vector storage cost is the most consistently underestimated line item for pgvector deployments. Most teams size their instance for the raw vector data and discover later that the HNSW index is as large or larger than the data itself.

Raw Vector Storage

A 1536-dimension vector (the dimension count for OpenAI ada-002 and many common embedding models) stored as the standard vector type uses 4 bytes per dimension plus 8 bytes of overhead: (1536 x 4) + 8 = 6,152 bytes, approximately 6 KB per vector.

At 6,152 bytes per vector, raw vector values alone occupy 0.6152 GB for 100,000 vectors, 6.152 GB for one million, 61.52 GB for ten million and 615.2 GB for one hundred million (decimal units). PostgreSQL row, page, index and other storage overhead is additional.

HNSW Index Size

HNSW indexes in pgvector are typically 1.5x to 2x the raw vector data size depending on the m parameter (number of connections per node, default 16) and ef_construction parameter (construction search size, default 64). With default parameters at 1536 dimensions: 1 million vectors generates approximately 9-12 GB of HNSW index storage on top of the 6 GB of raw data. Total storage for 1 million 1536-dim vectors: approximately 15-18 GB.

halfvec reduces storage: using halfvec (2-byte floats instead of 4-byte) cuts raw vector storage in half — approximately 3 KB per 1536-dim vector. halfvec with HNSW reduces total storage for 1 million vectors to approximately 7-9 GB. The trade-off is slight reduction in precision for distance calculations, acceptable for most semantic search applications. Source: pgvector 0.7.0 release notes (AWS official, May 2024).

For PostgreSQL Single-AZ in US East (N. Virginia), gp3 provisioned storage is $0.115/GB-month. An additional 15 GB of billed allocation costs $1.725/month; 150 GB costs $17.25; 1,500 GB costs $172.50. RDS charges allocated storage, not just vector bytes: the usual 20-GiB gp3 minimum is $2.30/month before compute and other charges. Free space already allocated does not create another per-byte storage charge when filled.

AWS RDS management console showing the storage monitoring panel for an RDS PostgreSQL instance with pgvector enabled, with a storage breakdown visualization showing the total 200 GB gp3 volume allocated at $23 per month, with a detailed breakdown showing 38 gigabytes consumed by the vector embeddings table containing 5 million 1536-dimensional vectors stored as pgvector vector type, 67 gigabytes consumed by the HNSW index built on the embedding column with default m equals 16 and ef_construction equals 64 parameters, 42 gigabytes for other application tables and indexes, and 53 gigabytes of remaining free space, with an annotation showing the HNSW index is 1.76 times larger than the raw vector data it indexes

Memory Requirements: Why pgvector Forces r-Family Instances

pgvector query performance depends critically on whether the HNSW index fits in shared_buffers (the PostgreSQL shared memory cache). When the index fits in memory, ANN queries return in single-digit milliseconds. When the index does not fit, queries require disk reads for each HNSW graph traversal, and latency degrades to hundreds of milliseconds or worse.

shared_buffers and work_mem

Check the actual parameter group and memory metrics. RDS defaults reserve memory for the operating system and service processes; a fixed fraction of nominal RAM is only an approximation. Both PostgreSQL buffers and the operating-system cache can affect query performance.

For HNSW index construction, the relevant memory setting is maintenance_work_mem, not work_mem. The latter controls sorts and hashes and can multiply across operations and workers. Size build memory within available headroom and benchmark; neither a 10–20× speedup nor a universal “2× index size” instance rule is guaranteed. See the pgvector HNSW documentation.

Graviton Generations for pgvector Workloads

RDS db.r7g uses Graviton3; db.r8g uses Graviton4; db.r6g uses Graviton2. A benchmark of Graviton3 cannot substantiate the same percentage gain for Graviton4 or for a different workload. Compare latency, recall and cost per query on representative data before treating a processor-generation change as a saving. Source: AWS instance class types.

Verified Instance Pricing for pgvector Workloads (October 15, 2026)

Once you have measured the extension workload’s CPU, memory and storage needs, use the RDS monthly cost breakdown to price the resulting PostgreSQL instance and allocated storage. Extension licensing and the infrastructure needed to run the workload are separate considerations.

Instance RAM On-Demand/hour 1-year No Upfront RI/hour Annual compute saving at full use
db.r8g.large 16 GiB $0.239 $0.160 $692.04
db.r8g.xlarge 32 GiB $0.478 $0.320 $1,384.08
db.r8g.2xlarge 64 GiB $0.956 $0.641 $2,759.40
db.r8g.4xlarge 128 GiB $1.912 $1.281 $5,527.56
db.r8g.8xlarge 256 GiB $3.824 $2.562 $11,055.12

Prices checked against the AWS public catalog on October 15, 2026: PostgreSQL, US East (N. Virginia), Single-AZ. Savings use 8,760 hours of full eligible use. Storage, I/O, backup, transfer, Extended Support and tax are excluded. Source: AWS PostgreSQL pricing.

No vector-capacity guarantee follows from this pricing table. Measure actual index bytes, query latency, recall, concurrency and cache behavior before choosing an instance. The previous “comfortable” vector limits were inconsistent with the article’s own memory assumptions and have been removed.

A growing index can change the required compute, but vector count alone does not prove that a larger instance is needed. Test expected growth before reserving. PostgreSQL RI size flexibility can apply within the same instance family and Region: an xlarge reservation can partially cover a 2xlarge. Changing families can leave an unused commitment.

Also read: RDS Reserved Instances: complete guide — includes PostgreSQL RI strategy 

PostGIS on RDS: What It Costs and Why Spatial Queries Are Different

PostGIS is also a free extension — no additional licensing fee when you enable it on an RDS PostgreSQL instance. The cost model is the same as pgvector: you pay for the instance and storage that the spatial workload demands.

How PostGIS Differs From pgvector in Resource Profile

pgvector is primarily memory-bound. The HNSW index needs to fit in RAM for fast queries, and index builds are memory-intensive. Once the index is loaded, query CPU usage is moderate.

PostGIS is primarily CPU-bound for complex spatial queries. Simple point-in-polygon lookups are fast on any instance. Complex operations — polygon intersection across large datasets, buffer generation, spatial joins with ST_Within or ST_Intersects on tables with millions of geometries — are CPU-intensive and benefit from instances with higher core counts. A 16-vCPU instance handles complex spatial queries significantly faster than a 4-vCPU instance for the same RAM footprint.

PostGIS spatial data storage: geometries are stored as binary objects. A simple point (lat/lng) takes approximately 32 bytes. A complex polygon boundary with hundreds of vertices can take 1-10 KB per row. For datasets with millions of geometries, storage costs are driven by geometry complexity. A table with 10 million simple points: approximately 300 MB. A table with 1 million complex polygons (US Census boundaries, zoning data): 1-10 GB.

The PostGIS Raster Extension

Starting with PostGIS 3.0, raster functionality was moved to a separate extension: postgis_raster. If your workload involves raster image processing — satellite imagery, elevation data, grid-based spatial analysis — you need to install both PostGIS and postgis_raster. Both are free on RDS. Raster storage can be significant: a single high-resolution satellite image tile can be 1-10 MB, and datasets of thousands of tiles add up quickly in gp3 storage charges at $0.115/GB-month. Source: AWS RDS PostGIS documentation (docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.PostGIS.html).

h3-pg: Hexagonal Geospatial Indexing

AWS added h3-pg (the H3 hexagonal geospatial indexing system) to RDS PostgreSQL in September 2023. h3-pg works alongside PostGIS for hexagonal grid analysis — retail site selection, mobility heatmaps, geospatial ML preprocessing. Like PostGIS, h3-pg is free to enable. It adds minimal storage overhead (hexagonal cell IDs are fixed-size 64-bit integers) but adds CPU usage for conversion and lookup operations. Source: AWS official announcement, September 2023.

AWS RDS Performance Insights interface for a PostgreSQL database instance with PostGIS extension enabled, showing the database load analysis over a 24-hour period with the top wait event breakdown panel on the right listing db.cpu as the primary bottleneck at 78 percent of average active sessions, with the top SQL statements panel below showing three spatial join queries using ST_Intersects and ST_Within functions as the top CPU consumers, each generating between 12 and 34 average active sessions, and the CloudWatch metrics panel at the bottom showing CPU utilization hovering between 80 and 90 percent on a db.m8g.2xlarge instance, demonstrating that PostGIS spatial join operations are compute-bound rather than memory-bound and benefit primarily from higher vCPU counts rather than larger memory

pgvector vs PostGIS: Instance Family Selection

The resource profiles of the two extensions point to different optimal instance selections.

Factor pgvector (HNSW) PostGIS (complex spatial) Both together
Primary bottleneck Memory (index in RAM) CPU (polygon operations) Memory + CPU
Recommended family r8g (8 GiB/vCPU, Graviton4) m8g (4 GB/vCPU, more cores) r8g (balance memory + CPU)
Key parameter shared_buffers (fit HNSW in RAM) vCPU count (parallel spatial ops) Both
Scale trigger Vector count grows past index-in-memory threshold Concurrent spatial query CPU > 70% Either threshold hit
Storage driver HNSW index (1.5-2x raw vector size) Geometry complexity per row Both independent
Extension fee $0 $0 $0

Source: AWS Database Blog (HNSW benchmark November 2023), AWS RDS PostGIS documentation. Instance families verified against Vantage.sh (May 2026). Note: a single RDS instance can run both pgvector and PostGIS simultaneously — both extensions co-exist without conflict. If using both, size for the more demanding workload (usually pgvector’s memory requirement exceeds PostGIS’s CPU requirement unless the spatial dataset is very large).

Enabling pgvector and PostGIS: The Commands and Parameter Considerations

Enabling pgvector

Enable the extension in any database: CREATE EXTENSION IF NOT EXISTS vector;

Create a table with a vector column: CREATE TABLE documents (id BIGSERIAL PRIMARY KEY, content TEXT, embedding vector(1536));

Create an HNSW index: CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 64);

The m and ef_construction parameters control index quality and build time. Higher m (connections per node) improves recall at the cost of larger index size and slower build. Higher ef_construction improves index quality at the cost of slower builds. Default values (m=16, ef_construction=64) are appropriate for most production workloads. Source: pgvector GitHub repository (April 2026).

Enabling PostGIS

Enable the core extension: CREATE EXTENSION IF NOT EXISTS postgis;

If raster processing is required: CREATE EXTENSION IF NOT EXISTS postgis_raster;

For hexagonal geospatial indexing: CREATE EXTENSION IF NOT EXISTS h3;

To check available PostGIS versions: SELECT * FROM pg_available_extension_versions WHERE name = ‘postgis’ ORDER BY version DESC;

Memory Parameters for HNSW Index Builds

Use maintenance_work_mem to budget HNSW build memory, with enough headroom for other database work. Set it for the build session and monitor memory; do not copy a large setting blindly. work_mem still matters for query sorts and hashes, but raising it is not the documented HNSW graph-build tuning control.

RDS Reserved Instances for pgvector and PostGIS Workloads

pgvector and PostGIS workloads are particularly well-suited for Reserved Instances because both extension use cases tend to be stable: vector search for a production AI application does not typically change instance families month to month, and PostGIS spatial data pipelines are generally steady-state.

The RI strategy for PostgreSQL instances running these extensions follows the same rules as all RDS PostgreSQL RIs: size-flexible, Single-AZ RI at the smallest size in the target family. A db.r8g.xlarge RI covers two db.r8g.large instances or 50% of a db.r8g.2xlarge via normalization units. Source: AWS official RDS RI documentation.

The critical sizing caution for pgvector specifically: purchase the RI after confirming the instance size is correct for your current and near-term projected vector dataset size. A 1-year RI on a db.r8g.xlarge that needs to be replaced by a db.r8g.2xlarge in 6 months leaves you with a mismatched RI for the remaining 6 months. Because PostgreSQL RIs are size-flexible, the orphaned xlarge RI will partially cover the 2xlarge at 50% normalization — not ideal, but not completely wasted. Run the workload for 30 days with a realistic production vector load before purchasing any RI.

At the verified Single-AZ PostgreSQL rates, db.r8g.2xlarge falls from $0.956/hr On-Demand to $0.641/hr on a one-year No Upfront RI: $2,759.40 saved over 8,760 fully used hours. db.r8g.4xlarge falls from $1.912/hr to $1.281/hr, saving $5,527.56/year. These are compute-only savings and the commitment remains payable if unused.

Usage.ai Insured Flex Commitments for RDS PostgreSQL instances apply to pgvector and PostGIS workloads identically to any other PostgreSQL instance. The platform identifies the correct instance size based on 30-day utilization analysis, purchases the RI automatically, and provides cashback if the instance is later resized or decommissioned. For teams scaling vector datasets rapidly, the 24-hour recommendation refresh catches when a scale-up is needed and updates the RI recommendation before the next purchase decision. Fee: percentage of realized savings only.

See exactly what you’re overpaying in under 60 seconds. Try the Calculator for free →

 

You’re Overpaying AWS. See by How Much in 60 Seconds.Upload your AWS bill and get your exact overspend number for free. No account access, or commitment required.FIND MY SAVINGS

 

Frequently Asked Questions

1. Are pgvector and PostGIS free on Amazon RDS?

Yes. Both pgvector and PostGIS are open-source PostgreSQL extensions that AWS includes in RDS for PostgreSQL at no additional charge. There is no licensing fee, no per-query cost, and no extra hourly charge for enabling them. You pay only for the standard RDS PostgreSQL instance, storage, and I/O that your workload consumes. The cost impact of these extensions is indirect — they change what your workload demands from the instance, typically requiring larger memory-optimized instances.

 

2. How much storage does a pgvector HNSW index use?

A 1,536-dimension standard vector occupies 6,152 bytes before PostgreSQL storage overhead. One million raw vectors therefore occupy 6.152 decimal GB; index size depends on data, type and index settings. Measure it instead of treating a fixed 1.5–2× multiplier as a guarantee. gp3 is billed on provisioned allocation, with a typical 20-GiB minimum for PostgreSQL, not only bytes used by vectors.

3. Which RDS instance is recommended for pgvector?

Benchmark instance candidates against your latency, recall and concurrency requirements. db.r8g uses Graviton4, not Graviton3. In the checked Single-AZ US East pricing, db.r8g.xlarge is $0.478/hour and db.r8g.2xlarge is $0.956/hour On-Demand. No guaranteed maximum vector count follows from RAM alone.

4. What version of pgvector does RDS support?

Amazon RDS for PostgreSQL supports pgvector 0.8.2 as of June 2026. pgvector 0.8.0 (released November 2024) added improved filtering with WHERE clauses, iterative index scans to prevent overfiltering, and HNSW performance improvements. Available on PostgreSQL 17.1+, 16.5+, 15.9+, 14.14+, and 13.17+. pgvectorscale is not available on RDS as of mid-2026 — teams needing DiskANN for very large datasets must self-manage PostgreSQL on EC2. Source: AWS official release notes.

 

5. Does pgvector work with Amazon Bedrock and SageMaker embeddings?

Yes. pgvector on RDS stores embedding vectors generated by any source including Amazon Bedrock foundation models, Amazon SageMaker endpoints, OpenAI API, Cohere, and any other service that produces numerical vector representations. The extension stores and indexes the numerical arrays regardless of which model generated them. AWS explicitly supports Bedrock and SageMaker integration with pgvector in the RDS documentation and Database Blog.

 

6. How does PostGIS affect my RDS instance sizing?

PostGIS is CPU-intensive for complex spatial operations (polygon intersections, spatial joins, buffer generation) rather than memory-intensive. Simple point lookups require minimal resources. Complex polygon operations on large datasets can push CPU utilization to 80-100% on smaller instances. For CPU-intensive PostGIS workloads, m-family instances (db.m8g, db.m7g) provide more vCPUs per dollar than r-family. For mixed pgvector and PostGIS workloads, r-family instances balance memory and CPU. Monitor CPU utilization in CloudWatch — if spatial queries consistently drive CPU above 70% P95, consider scaling up vCPU count.

 

7. What is the work_mem parameter and why does it matter for pgvector?

work_mem controls memory for query sorts and hash operations. HNSW index builds use maintenance_work_mem for the build graph. Set build memory within available RAM, account for concurrent work, and benchmark rather than promising a fixed speedup.

8. Can I run pgvector and PostGIS on the same RDS instance?

Yes. Both extensions co-exist on a single RDS PostgreSQL instance without conflict. Enable both: CREATE EXTENSION IF NOT EXISTS vector; CREATE EXTENSION IF NOT EXISTS postgis; Each extension operates independently. For mixed workloads, size the instance for the more demanding requirement — typically the pgvector memory requirement (fitting the HNSW index in shared_buffers) rather than the PostGIS CPU requirement, unless the spatial dataset is very large or spatial queries run at high concurrency.

See your savings first
More from Usage.ai
Latest from our blogs

725 5th Ave, New York, NYC, 10022© 2026 Usage AI