摘要: 列选择原则:1:字段类型优先级 整型 > date,time > enum,char>varchar > blob列的特点分析:整型: 定长,没有国家/地区之分,没有字符集的差异time定长,运算快,节省空间. 考虑时区,写sql时不方便 where > ‘2005-10-12’;enum: 能起来 阅读全文
posted @ 2017-09-15 18:05 Microtiger 阅读(143) 评论(0) 推荐(0)
摘要: show variables like '%profiling%'; 查看状态 set profiling = 1; 开启 reset query cache; 清空缓存 select * from admin; show profiles; show profile for query 2; sh 阅读全文
posted @ 2017-09-15 17:54 Microtiger 阅读(537) 评论(0) 推荐(0)
摘要: processlist.sh 记录数据库的状态 #!/bin/bash while true do mysql -uroot -pwangxiaohu -e 'show processlist\G'|grep State:|uniq -c|sort -rn >> proce.txt echo ' ' 阅读全文
posted @ 2017-09-15 17:25 Microtiger 阅读(259) 评论(0) 推荐(0)