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 withALTER 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 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
逛到本站,mark一下
[***.202.152.39]2024年04月25日 05时54分30秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
C经典 选择排序
2019-04-27
C经典 二分查找法
2019-04-27
Android 备份短信
2019-04-27
Android 拦截修改电话号码
2019-04-27
Android 创建DBHelper类
2019-04-27
Android 使用事物处理
2019-04-27
Android 读取网络数据
2019-04-27
Android 使用HttpGet进行登录
2019-04-27
Android 使用Handler模仿流行的AsyncHttpClient
2019-04-27
Android 简单游戏实现笑脸的移动与人物移动
2019-04-27
Android 关于自定义TextView的测量
2019-04-27
Android 基本属性绘制文本对象FontMetrics介绍
2019-04-27
Android MeasureSpec介绍及使用详解
2019-04-27
Android 简单模仿AsyncHttpClient
2019-04-27
Android 使用Get方式实现断点下载(一)
2019-04-27
Anroid 加载图片方式一 使用SmartImageView
2019-04-27
Android 从网络加载图片
2019-04-27
Android ProgressBar使用
2019-04-27
Android 获得sdcard大小与内存大小工具类
2019-04-27