先创建status,name,LogTime列的索引修改一下where 条件的顺序试试 select count(status) from employee where status in (0,1) and name= 'John' and LogTime>='2005-05-10' and LogTime<'2005-05-12'
我觉得只建创建statuname,LogTime列的索引就可以了。好像status字段不同的值比较少, 修改一下where 条件的顺序试试 select count(status) from employee where status in (0,1) and LogTime>='2005-05-10' and LogTime<'2005-05-12' and and name= 'John'
select count(status) from employee where status in (0,1)
and name= 'John' and LogTime>='2005-05-10' and LogTime<'2005-05-12'
修改一下where 条件的顺序试试
select count(status) from employee where status in (0,1)
and LogTime>='2005-05-10' and LogTime<'2005-05-12' and and name= 'John'