mysql 服务状态查询
mysql client connection
mysql 查看进程等待时间
show full processlist;
mysql 状态明细查询
show status ;
mysql Import/Expor 备份和恢复
Data Export
Data Import
Mysql Utilities
InnoDB 存储方式
TEXT 和 BLOB 的性能
1.删除text 和blob后空洞并不会处理,需要
OPTIMIZE TABLE movie;
回收表空间;
2.合成(Synthetic )索引,提高大文本字段(text 和blob)的查询性能
只针对精准查询,使用MD5(),SHA1(),CRC32()等生成列散值,
create table t(id varchar(100), context blob,hash_value varchar(40));
insert into t values(1,repeat('beijing',2),md5(context));
insert into t values(2,repeat('beijing',2),md5(context));
insert into t values(3,repeat('beijing 2008',2),md5(context));
select*from t where hash_value=md5(repeat('beijing 2008',2));
也可以添加模糊索引
create index idx_blob on t(context(100));
select*from t where context like 'beijing%'
3.不必要就不要检索blob和text;
如:select*from...
4.把blob和test分析到单独的表
减少主表的碎片也不会再主数表运行select*from查询大量的blob和text;