英语的借口
我使用sqlite并测试它.插入数百万行以测试速度.并在任何插入后删除行.
但我知道我的数据库大小是33.0 MB …..现在数据库是空的.但磁盘上的大小为33 MB.
为什么?
你能帮助我吗?
解决方法
The VACUUM command rebuilds the entire database. There are several
reasons an application might do this:Unless sqlite is running in “auto_vacuum=FULL” mode,when a large amount of data is deleted from the database file it leaves behind
empty space,or “free” database pages. This means the database file
might be larger than strictly necessary. Running VACUUM to rebuild the
database reclaims this space and reduces the size of the database
file.