In the last episode (Jun 09), Iago Sineiro said:
> Sorry for the ambiguity. I'm testing the useful of adding indexes to
> one table for one type of query.
> When I execute the same query for the second time it executes faster
> beacuse it's using the cache (the key_cache or the query cache if it
> is enabled). Is it possible to empty the key_cache (and also the
> query cache) without shutdown the mysql server?
"flush tables" should empty all mysql caches. But remember that MySQL
also makes heavy use of the OSes buffer cache (for MyISAM table data,
for example). If you really want reliable results, shut down mysql,
then dismount and remount the filesystem holding your table and index
files between tests, to force the OS the release its filesystem
buffers. Alternatively, dd'ing a file larger than your physical RAM
should also flush the OS cache.