# Fix ERROR: column cannot have more than 2000 dimensions for hnsw index in pgvector

> PostgreSQL 8 KB index pages cannot store uncompressed FP32 vectors above 2,000 dimensions, causing pgvector to reject OpenAI text-embedding-3-large (3072d) and Google gemini-embedding-001 (3072d). Fix it immediately with a functional halfvec(3072) HNSW index in pgvector 0.7.0+, or switch to Voxell Forge Turbo 1024d ($0 forever) and Pro 2560d ($0.25/1M tokens).

Canonical URL: https://voxell.ai/errors/pgvector-column-cannot-have-more-than-2000-dimensions/


## Why PostgreSQL 8 KB Pages Reject FP32 `vector(3072)` HNSW Indexes

PostgreSQL fixes `BLCKSZ` at `8,192` bytes (`8 KB`) and forbids out-of-line TOAST pointers inside index tuples. Because an `FP32` `vector(3072)` consumes `3,072 * 4 = 12,288` bytes before tuple headers, `CREATE INDEX ... USING hnsw` aborts at `2,000` dimensions (`8,000` bytes). Switching the index expression to `FP16` `halfvec(3072)` halves payload size to `6,144` bytes (`<= 4,000` max dimensions) with `<0.2%` recall delta.

## Immediate SQL Fix: Functional `halfvec(3072)` HNSW Index Without Re-Embedding

```sql
-- Requires pgvector >= 0.7.0 (RDS, Aurora, Cloud SQL, Supabase, Neon)
CREATE INDEX CONCURRENTLY idx_chunks_emb_hnsw_fp16
  ON doc_chunks
  USING hnsw ((embedding::halfvec(3072)) halfvec_cosine_ops)
  WITH (m = 16, ef_construction = 128);

-- Query MUST cast parameter to halfvec(3072) so the planner selects the index
SELECT id, content
FROM doc_chunks
ORDER BY (embedding::halfvec(3072)) <=> ($1::vector(3072))::halfvec(3072)
LIMIT 20;
```

## Eliminate `pgvector` Dimension Ceilings With Voxell Forge

Instead of maintaining functional `halfvec` casts and sizing `77.6 GB` of resident RAM at `10M` chunks, point your OpenAI SDK `base_url` at Voxell Forge: `Turbo` (`1024d`, **$0** forever) fits native `FP32` `vector(1024)` directly, while hosted Forge Spaces and Sovereign VPC (`< 14 GB` VRAM on 1x 24 GB GPU, **$9,995/yr** Dev) remove PostgreSQL vector indexing altogether.

## Related Optimization Guides, Calculators & Benchmarks

- **[Fix pgvector 2,000-Dimension HNSW Limit Deep Dive](/optimize/pgvector-2000-dimension-limit-hnsw/)**
- **[pgvector RAM & Quantization Calculator](/tools/pgvector-ram-calculator/)**
- **[Pinecone vs Qdrant vs pgvector vs Voxell Forge](/compare/pinecone-vs-qdrant-vs-pgvector/)**
- **[Audit Your Docs or GitHub Repo Free](/audit/)**

## Frequently Asked Questions

### Does casting vector(3072) to halfvec(3072) require re-embedding my table?

No. A functional HNSW index on (embedding::halfvec(3072)) leaves existing FP32 heap rows untouched and indexes 16-bit floats in place on pgvector 0.7.0 and newer.

### What is the maximum dimension limit for halfvec and bit in pgvector?

pgvector caps FP32 vector HNSW indexes at 2,000 dimensions, FP16 halfvec HNSW indexes at 4,000 dimensions, and 1-bit binary bit HNSW indexes at 64,000 dimensions.

---

## Zero-Install Model Context Protocol (MCP) & Keyless Agent Verification

```bash
claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try
```

- Keyless Retrieval Bake-Off: `POST https://api.voxell.ai/api/v1/agent/bakeoff`
- Keyless Contradiction X-Ray: `POST https://api.voxell.ai/api/v1/agent/xray`
- Machine-Readable Pricing JSON: `https://voxell.ai/api/v1/agent/pricing.json`
- Full LLM Authority Map: `https://voxell.ai/llms-full.txt`
