gpt4 book ai didi

SQLite 删除后不释放内存

转载 作者:IT王子 更新时间:2023-10-29 06:31:53 27 4
gpt4 key购买 nike

英语借口

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

关于SQLite 删除后不释放内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21637570/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com