I have a 1.1 million row table (150MB) where each row has a range of columns with one a column having 15 possible states that I am grouping by.
Any select with count is sub 0.05 seconds, for example:
SELECT variant, count(*) FROM `log`
As soon as I
GROUP BY I go to to 0.7 seconds, for example:
SELECT variant, count(*) FROM `log` GROUP BY variant
The variant column has an index. The unique id per row is the primary key.
Not sure if my query is bad or that my web host has poor performance.
PS, I now installed MySQL on a high spec machine and it took 0.55 to run the query. So it look like it's not that slow.