sqlite-vec icon indicating copy to clipboard operation
sqlite-vec copied to clipboard

Clear out rowid and vector data on DELETEs

Open asg017 opened this issue 2 years ago • 2 comments

Currently only validity bit is set

asg017 avatar Jul 31 '24 16:07 asg017

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

murillodutt avatar Feb 18 '26 02:02 murillodutt

This has been resolved in vlasky/sqlite-vec, a temporary fork of sqlite-vec. For the list of changes, see comments in #226.

brankoradovanovic-mcom avatar Feb 18 '26 08:02 brankoradovanovic-mcom