SQLite 数据库大小太大

发布于 2024-09-07 20:46:00 字数 268 浏览 1 评论 0原文

我正在使用 .NET 中的 SQLite 创建一个数据库,然后插入 1500 条记录(15 列,只有 3 列包含信息)。此时数据库文件大小为73mb!! (涉及的信息量巨大)。

如果我打开SQLite Administrator,并执行清除数据库,它会缩小到只有 142kb。

它为什么要这么做?有什么办法可以避免吗? 不管怎样,有没有办法缩小.NET 中的数据库文件(我正在使用 System.Data.SQLite,它在幕后使用 Finistar)?

I'm creating a DB using SQLite from .NET and then inserting 1500 records (15 columns, only 3 with information). At this point the database file size is 73mb!! (huge for the amount of information involved).

If I open SQLite Administrator, and do a Clear Database, it shrinks to only 142kb.

Why is it doing that? Is there anyway to avoid it?
Either way, is there a way to shrink the DB file from .NET (I'm using System.Data.SQLite, which uses Finistar under the hood) ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟若柳尘 2024-09-14 20:46:01

是的,您可以执行 VACUUMREINDEX 在数据库上以缩小其大小。

Yes, you can execute VACUUM and REINDEX on the database in order to shrink its size.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文