Search code examples
mysqlcachingprofiler

Does MySQL Profiler use cache of queries?


I wonder if the cache is used in the embedded MySQL Profiler. For example, if I run a query:

mysql> select count(*) from comment;

and after that I run the following queries:

mysql> set profiling=1;
mysql> select count(*) from comment;
mysql> show profiles;

Does profiler use cache in that case? Empirically it seems that the cache is not being used. But I want to know for sure. Thanks in advance!


Solution

  • There's an example here that shows profilter output, and two of the steps shown in the result are:

    | Waiting for query cache lock   | 0.000004 |
    | checking query cache for query | 0.000151 |
    

    This suggests that it does use the query cache. Other sites that demonstrate how to profile queries include turning off the query cache.