为什么phpmyadmin中导入的数据库比较小?

发布于 2024-12-19 22:05:53 字数 91 浏览 3 评论 0原文

我使用 phpmyadmin 转储了一个数据库,大小为 390MB 然后使用命令行导入到新数据库中,然后显示大小360。

为什么导入的数据库较小?谢谢。

I have dumped a database using phpmyadmin and had 390MB
and then imported it using command line into new database, then it showed the size 360.

Why this imported database is smaller? Thanks.

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

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

发布评论

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

评论(1

新一帅帅 2024-12-26 22:05:53

当您从数据库中删除数据时,记录通常不会真正从数据库文件中删除,只是标记为已删除 - 该空间可以在以后重新用于新记录。当您导出数据库时,这些已删除的记录自然不会导出,也不会在您导入数据库时​​重新创建。

添加记录时,这种重用可以节省一些时间,因为您不必总是增大文件。而且在删除记录时,它可以节省大量时间 - 从文件中间删除某些内容涉及移动其后面的所有数据。

When you delete data from a database, the records usually aren't actually deleted from the database files, just marked as deleted – the space can be reused for new records later. When you export a database, these deleted records naturally aren't exported, or recreated when you import the database.

This reuse saves a little time when records are added, because you don't always have to make the file larger. And it saves a lot of time when deleting records – deleting something from the middle of a file involves shifting all the data that comes after it.

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