当前位置:Gxlcms > 数据库问题 > MySQL性能优化之道

MySQL性能优化之道

时间:2021-07-01 10:21:17 帮助过:29人阅读

* from test1 where EXISTS (select * from test2 where id2 = id1 ) select * FROM test1 where NOT EXISTS (select * from test2 where id2 = id1 )

用join代替

 select id1 from test1 INNER JOIN test2 ON id2 = id1 
 select id1 from test1 LEFT JOIN test2 ON id2 = id1  where id2 IS NULL

 

MySQL性能优化之道

标签:inner   strong   bsp   sql   性能   col   span   mysq   from   

人气教程排行