加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SQLite删除后没有释放内存

发布时间:2020-12-12 18:58:23 所属栏目:百科 来源:网络整理
导读:英语的借口 我使用SQLite并测试它.插入数百万行以测试速度.并在任何插入后删除行. 但我知道我的数据库大小是33.0 MB …..现在数据库是空的.但磁盘上的大小为33 MB. 为什么? 你能帮助我吗? 解决方法 The VACUUM command rebuilds the entire database. Ther
英语的借口

我使用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.

https://www.sqlite.org/lang_vacuum.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读