求大神帮小弟我优化这个sql语句

求大神帮我优化这个sql语句select distinctuserid from userlog where userid not in(selectdistinct user

求大神帮我优化这个sql语句
select distinct  userid from userlog where userid not in(select  distinct userid from #user) 
and accesstime >='2013-04-27' and accesstime<'2013-04-28';


怎么修改? 现在效率太低
[解决办法]

select distinct  userid 
from userlog t
where 
not exists(select userid from #user t1 where t.userid=t1.userid) 
and accesstime >='2013-04-27' and accesstime<'2013-04-28';

userlog以及#user表中userid设置索引
userlog中创建accesstime索引

http://www.cnblogs.com/worfdream/articles/3040204.html