Ksenia
Ksenia

Reputation: 3723

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!

Upvotes: 0

Views: 122

Answers (1)

Barmar
Barmar

Reputation: 782105

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.

Upvotes: 1

Related Questions