记录慢Sql日志
;配置my.ini ;超过5秒的SQL,记录日志 ;version >= 5.6 slow-query-log=1 long_query_time=5 slow-query-log-file="d:/wamp/logs/mysqlslow.log" ;version < 5.6 long_query_time=5 log-slow-queries="d:/wamp/logs/mysqlslow.log"
explain
//type顺序 system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL
批量update改写
//参考网址:http://laoniangke.com/mysql/2012/05/10/sql-update.html
UPDATE table SET field = CASE id WHEN 1 THEN 3 WHEN 2 THEN 4 WHEN 3 THEN 5 END WHERE id IN (1,2,3)