mysql优化摘要
发布日期:2021-09-20 08:07:30 浏览次数:44 分类:技术文章

本文共 1282 字,大约阅读时间需要 4 分钟。

1.

Replication

If you have a read-heavy environment, reads can go faster in MyISAM if you do the following:

  • Setup Master/Slave Replication
  • Create one or more Read Slaves under the Master
  • Add --skip-innodb in /etc/my.cnf on all Slaves (converts tables to MyISAM when loading data into the Slave)
  • Change the row format of all MyISAM tables on every Slave to FIXED by this command: ALTER TABLE tblname ROW_FORMAT=FIXED;
  • The book recommends using ROW_FORMAT=FIXED on pages 72,73. This will internally convert all VARCHAR fields to CHAR. It will make the MyISAM table larger, but executed SELECTs against it will be much faster. I can personally attest to this. I once had a table that was 1.9GB. I changed the format with ALTER TABLE tblname ROW_FORMAT=FIXED. The table ended up 3.7GB. The speed of the SELECTs against it was 20-25% faster without improving or changing anything else.

2.

FULLTEXT Indexing

At present, only MyISAM supports FULLTEXT indexing. . If you have any Drupal tables using FULLTEXT indexes, they cannot be converted to InnoDB.

To locate those tables that have a FULLTEXT index, run this query:

SELECT table_schema,table_name FROM information_schema.statistics WHERE index_type='FULLTEXT';

If no rows come back, convert all InnoDB tables to your heart's content. .

转载地址:https://blog.csdn.net/caiyiii/article/details/11473857 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:mongodb操作使用笔记
下一篇:重置 InnoDB 表的日志文件

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月25日 05时54分30秒