多少表开销算太多?

发布于 2024-08-01 21:41:26 字数 127 浏览 2 评论 0原文

我刚刚在 phpMyAdmin 中看到我们的一个 MySQL 表大小为 14MB,但开销为 10MB。 我猜这已经很多了!

多少是太多了? 我应该定期运行OPTIMIZE TABLE吗?

I just saw in phpMyAdmin that one of our MySQL tables is 14MB in size, but has 10MB overhead. I'm guessing this is a lot!

How much is too much? Should I run OPTIMIZE TABLE regularly?

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

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

发布评论

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

评论(2

Smile简单爱 2024-08-08 21:41:26

“开销”是指以前被现在删除的记录占用的尚未回收的空间。 如果您进行大量插入/删除操作,它几乎总是会在那里。 您可以运行OPTIMIZE TABLE,但我不会打扰 - 特别是在大型表上(尽管 14M 并不大),这可能会花费很多时间。

"Overhead" is not yet reclaimed space formerly occupied by now deleted records. If you're doing a lot of inserts / deletes, it's pretty much always going to be there. You can run OPTIMIZE TABLE, but I wouldn't bother - especially on large tables (14M is not large, though) where it can take a lot of time.

缪败 2024-08-08 21:41:26

要整理数据表,可以使用:

ALTER TABLE table_name_here ORDER BY primary_key_here;

它的运行速度比OPTIMIZE TABLE更快。

这将对数据文件进行碎片整理。 对表进行大量更改后,这还可能会提高使用该表的语句的性能,有时甚至会显着提高。

http://dev.mysql.com/doc/refman/5.1 /en/optimize-table.html

To tidy up data table one can just use:

ALTER TABLE table_name_here ORDER BY primary_key_here;

which could run faster than OPTIMIZE TABLE.

This will de-fragment the data file. After extensive changes to a table, this may also improve performance of statements that use the table, sometimes significantly.

http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html

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