Clear out rowid and vector data on DELETEs
Currently only validity bit is set
Still hitting this in production with v0.1.7-alpha.2 (and confirmed unchanged in alpha.10 source).
Our system has 9 vec0 tables with ~15,000+ vectors. Because INSERT OR REPLACE is broken (#259), we must DELETE + INSERT for every vector update. Combined with this issue (DELETE not freeing rowid/vector data), our database file grows continuously.
Real-world numbers from our production database:
- Database size: ~187 MB
- Multiple embedding re-indexing cycles have been run
- No way to reclaim space short of dropping and recreating the virtual tables entirely
The combination of #54 + #259 forces a painful workaround: periodic full table rebuild (drop, recreate, re-embed all content). For us that means regenerating ~15,000 embeddings which takes significant time and compute.
Would appreciate any movement on this. Even a PRAGMA vec0_vacuum or similar mechanism would help.
— Murillo Dutt
This has been resolved in vlasky/sqlite-vec, a temporary fork of sqlite-vec. For the list of changes, see comments in #226.