SELECT *!N SQL_NO_CACHE * * FROM `table` - What is this? SQL_NO_CACHE instructs MySQL to by pass the cache when executing the query It would otherwise fetch the result from cache (if it is present in the cache) making it execute faster than it normally would
mysql的SQL_NO_CACHE (在查询时不使用缓存)和sql_cache用法 - edda_huang - 博客园 SQL_NO_CACHE means that the query result is not cached It does not mean that the cache is not used to answer the query You may use RESET QUERY CACHE to remove all queries from the cache and then your next query should be slow again Same effect if you change the table, because this makes all cached queries invalid
8. 10. 3. 2 Query Cache SELECT Options - MySQL SQL_CACHE The query result is cached if it is cacheable and the value of the query_cache_type system variable is ON or DEMAND SQL_NO_CACHE The server does not use the query cache It neither checks the query cache to see whether the result is already cached, nor does it cache the query result