mysql表大小限制_mysql数据库名

mysql表大小限制_mysql数据库名Solution One: To shrinking a shared InnoDB tablespace is: 1. Backup *all* InnoDB tables with mysqld…

mysql innodb 表过大问题

Solution One:

To shrinking a shared InnoDB tablespace is: 
1. Backup *all* InnoDB tables with mysqldump. 
2. Drop all of the InnoDB tables. 
3. Physically delete the ibdata1 file at the filesystem interface. 
4. Restart MySQL Server, which recreates a new, small tablespace file. 
5. Restore all your InnoDB tables, which expands the tablespace file as needed. 

Solution Two:

To shrink an .ibd file it”s enough to run ALTER TABLE t1 ENGINE INNODB. It will rebuild the tablespace and the new one will be the most compact. I think OPTIMIZE TABLE does exactly the same internally. ALTER TABLE however is preferred because you can use pt-online-schema-change to avoid blocking the table.

To get better understanding how data use the tablespace I would recommend InnoDB tools https://github.com/jeremycole/innodb_ruby

For example, to check how many pages are user by PRIMARY secondary indexes and how many free pages:

# /usr/local/bin/innodb_space -f actor.ibd space-extents-illustrate

  Start Page ╭────────────────────────────────────────────────────────────────╮
           0 │███▄▂░░                                                         │
             ╰────────────────────────────────────────────────────────────────╯

Legend (█ = 1 page):
  Page Type                                                         Pages    Ratio
  █ System                                                              3   42.86%
  █ Index 15                                                            1   14.29%
  █ Index 16                                                            1   14.29%
  ░ Free space                                                          2   28.57%

代码100分

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/7833.html

(0)
上一篇 2023-03-13
下一篇 2023-03-13

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注