当前位置:Gxlcms > 数据库问题 > 二、mysql优化

二、mysql优化

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

for(int i=0; i<5; i++){   for(int i=0; i<5000; i++){   } }
select * from t1 where id in (select id from where t2)
执行顺序是,先t2,再t1,t2是小表,t1是多大表
for(t2){
  for(t1){
  }
}
select * from t1 where exist (select 1 from where t2.id = t1.id)
执行顺序是,先t1,再t2,t2是小表,t1是多大表,所以这种就会t1大表驱动小表,不推荐
for(t1){
  for(t2){
  }
}

7、索引失效的条件

 

二、mysql优化

标签:mysql   就会   color   建立   分析   sort   col   创建索引   from   

人气教程排行