相关文章推荐
酷酷的日光灯  ·  临时表 | TiDB 文档中心·  2 周前    · 
彷徨的机器人  ·  Delphi - ...·  2 年前    · 
好帅的领带  ·  C# ...·  2 年前    · 
温柔的汽水  ·  vb.net dictionary ...·  2 年前    · 


L表数据量:77179753

J表数据量:42201

原表left join :

select count(1) from l left join j on j.userID=l.userid 
where l.appID=1000 and l.loginTime>='2018-01-01' and l.loginTime<'2018-02-01'

等半天不出结果!



临时

表left join :


select l.* into #tmp
from l where l.appID=1000 and l.loginTime>='2018-01-01' and l.loginTime<'2018-02-01'

select count(1) from #tmp l left join j on j.userID=l.userid

查询结果:45459


速度很快!