![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
Super_ever
这个作者很懒,什么都没留下…
展开
-
mysql索引
索引的最左匹配原则1.最左前缀匹配原则,非常重要的原则,mysql会一直向右匹配直到遇到范围查询(>、<、between、like)就停止匹配,比如a = 1 and b = 2 and c > 3 and d = 4如果建立(a,b,c,d)顺序的索引,d是用不到索引的,如果建立(a,b,d,c)的索引则都可以用到,a,b,d的顺序可以任意调整。2.=和in可以乱序,比...原创 2019-03-26 20:30:10 · 93 阅读 · 0 评论 -
记一次Mysql死锁问题
线上阿里云RDS insert into on duplicate key update 造成死锁等待,等待死锁超时时间默认 innodb_lock_wait_timeout=50s,大概造成15分钟数据库连接数不够异常(实例下所有库均如此),后将50s改为15s仍未解决问题;将死锁检测开关设置关掉 innodb_deadlock_detect=off 后续没有发现问题。...原创 2019-08-19 17:10:02 · 166 阅读 · 0 评论