mysql left join 优化 mysql left join 优化

mysql left join 优化

select * from a left join b on a.id=b.id  (a大表、b小表)

select * from b left join a on a.id=b.id  ---优化

大表 左关联 小表,很慢;小表 左关联 大表,很快。

 

select * from a join b on a.id=b.id -----自动选择小表作为驱动表

等于 select * from a left join b on a.id=b.id where b.id is null

参考

https://www.cnblogs.com/zedosu/p/6555981.html

https://blog.csdn.net/qq_36028348/article/details/88864691

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-10-18
  • 2022-01-13
  • 2021-09-24
  • 2022-12-23
  • 2022-02-28
猜你喜欢
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-10-07
  • 2022-12-23
相关资源
相似解决方案