chengfengjie / chengfengjie.github.io

我叫MT
1 stars 0 forks source link

mysql #1

Open chengfengjie opened 6 years ago

chengfengjie commented 6 years ago

explain 查询sql语句 查看mysql的执行计划,检查索引是否正确使用,检查是否有过多的全表扫描,优化sql

参考链接: https://segmentfault.com/a/1190000008131735

chengfengjie commented 6 years ago

update join

UPDATE estate_albumimage A
LEFT JOIN estate_album B
ON A.albumID = B.albumID
SET A.sortIndex = A.sortIndex + 1
WHERE B.sortIndex = 1 
AND A.isActive = 1;