I have a table with 3222374 records
when I use “select count(*) from table” it works within a second.
But When I use
select count(*) from table where ts >= ‘2007-01-31 05:21:18’ AND ts <= ‘2008-01-09 05:21:18’
It takes around 20 seconds to get the result.
I have created a index field on ts ( which is DATETIME type field )
Please help on this.