I read some time ago, that when MySQL is checking to see if a given query can be cached, all it does is check the query begins with ‘SELECT’.
Assuming this is or was true, can anyone confirm if its still the case on MySQL 5.x ?
In addition, if its true, what if the query begins with a comment?
I sometimes use short comments in the query, which helps debugging when looking at SHOW PROCESSLIST.
Ie, “/VW-HIT/ SELECT this, that from table”
Whilst this query will always have a comment of /VW-HIT/, I wonder if Im unintentionally bypassing the query cache because it doesnt being with “SELECT” ?
With any luck, Ive misunderstood and MySQL’s query cache is a little more intelligent than this anyway