Branching serverless Postgres for AI coding agents: keeping pgvector indexes fast on ephemeral preview DBs
Seeing the Neon/Peat serverless Postgres fork and Postgres 18->19 discussions today reminded me of an annoying issue we're hitting in CI.
We give our coding agents an isolated copy-on-write Postgres branch for each PR run so they can apply Alembic migrations and run integration tests without touching staging.
For normal relational tables it feels instant. For our pgvector HNSW table (~400k rows), the very first similarity query on a fresh branch takes 3–5 seconds because the HNSW graph pages aren't in shared buffers yet, which trips our 2-second test timeout.
How are teams handling pgvector inside ephemeral Postgres branches—smaller test fixtures, pg_prewarm, or skipping HNSW in CI?