优化前: select t1.id, t1.create_time, t1.account, t2.name from tab1 t1 inner join tab2 t2 on t1.account = t2.bip order
优化前:
select t1.id, t1.create_time, t1.account, t2.name from tab1 t1 inner join tab2 t2 on t1.account = t2.bip order by t1.create_time limit 0,10
优化后:
select tamp.*, t2.name from
( select t1.id, t1.create_time, t1.account, t2.name from tab1 t1 order by t1.create_time limit 0,10 ) tamp
inner join tab2 t2 on tamp.account = t2.bip
inner join
left join
--结束END--
本文标题: mysql 性能优化(order by limit , inner join 、 left join)
本文链接: https://www.lsjlt.com/news/4472.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0