When we want to use Sql_no_cache to suppress the results cache, we find that the results are not the same as our expectations, and the result of query execution is still the result of the cache. In fact, the real function of Sql_no_cache is to disallow caching of query results, but it does not mean that the cache is not returned to query as a result.
Sql_no_cache means that the query result was not cached. It does not mean
The cache is not a used to answer the query.
The use of RESET QUERY cache to remove all queries from the cache and
Then your next query should is slow again. Same effect if you change
The table, because this makes all cached queries invalid.
mysql> Select COUNT (*) from users where email = ' Hello ';
+----------+
| count (*) |
+----------+
| 0 |
+----------+
1 row in Set (7.22 sec)
Mysql> Select COUNT (*) from users where email = ' Hello ';
+----------+
| COUNT (*) |
+----------+
| 0 |
+----------+
1 row in Set (0.45 sec)
Mysql> Select COUNT (*) from users where email = ' Hello ';
+----------+
| COUNT (*) |
+----------+
| 0 |
+----------+
1 row in Set (0.45 sec)
Mysql> Select Sql_no_cache Count (*) from users where email = ' Hello ';
+----------+
| COUNT (*) |
+----------+
| 0 |
+----------+
1 row in Set (0.43 sec)
The true meaning of MYSQL Sql_no_cache