mysql 
select count(distinct(userId)) number,3
from SessionLog
where accesstime>date_Sub(curdate(), INTERVAL DAYOFMONTH(curdate())-1 day)
union all
select count(distinct(userId)) number,4
from SessionLog
where accesstime>date_sub(date_Sub(curdate(), INTERVAL DAYOFMONTH(curdate())-1 day),INTERVAL 1 month) and accesstime<DATE_SUB(sysdate(),INTERVAL 1 month)发现他不走索引 (我已经建立了 accesstime的索引)
想知道 1  2个where后面的含义
       2  如何改进?