I am testing performance of a complicated select query. It is very slow.
Using explain, I have found a ALL
in type COLUMN
. Then I ADD INDEX
. The result comes out fast. However, when I DROP
the INDEX
I added, the result comes out fast too.
I have set query_cache_size=0
. There is no cache for each query result.
I am a new learner. Could some experts tell me why and what other items I need to check? How can I go back to the first slow scenario and verify that it is the index I need to add which has big impact of the performance?
Sample:
select col1,col2 from tbl1 groupby col1,col2;
show create table
shows "index(col1), index(col2)"
explain shows the select query have type=ALL
.
Then I add index(col1, col2)
which made explain type=RANGE
.