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
-- 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.