sql 优化 0) update ,insert, delete 慢 1) where 条件 慢, 优化条件 2) 触发器,索引过多 1) select * from user where userid='1' ---- 创建索引优化, 2) select * from user where username like'%张%' --- % 在左边即使有索引也不生效(索引失效) 3) 尽量避免使用多表关联查询 left join /right jion 效率一般优于 内连接