Larger than RAM Vector Indexes for Relational Databases
Oct 1, 2025Vicent Martí

Summary
This post details the challenges of implementing vector indexes in relational databases, particularly supporting indexes larger than RAM and maintaining transactional guarantees during inserts, updates, and deletes. It introduces the Hierarchical Navigable Small Worlds (HNSW) data structure and discusses its limitations in a relational context. The PlanetScale implementation offers both fully in-memory HNSW indexes with transactional guarantees and a new hybrid vector index design for indexes larger than RAM, ensuring approximate nearest neighbor search behaves as expected within a relational database.