多少表开销算太多?
我刚刚在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“开销”是指以前被现在删除的记录占用的尚未回收的空间。 如果您进行大量插入/删除操作,它几乎总是会在那里。 您可以运行
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.要整理数据表,可以使用:
它的运行速度比
OPTIMIZE TABLE
更快。这将对数据文件进行碎片整理。 对表进行大量更改后,这还可能会提高使用该表的语句的性能,有时甚至会显着提高。
http://dev.mysql.com/doc/refman/5.1 /en/optimize-table.html
To tidy up data table one can just use:
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