List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:June 9 2003 2:54pm
Subject:Re: How to empty the cache?
View as plain text  
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.

-- 
	Dan Nelson
	dnelson@stripped
Thread
How to empty the cache?Iago Sineiro9 Jun
  • Re: How to empty the cache?Jeremy Zawodny9 Jun
  • Re: How to empty the cache?Nils Valentin9 Jun
    • RE: How to empty the cache?Iago Sineiro9 Jun
      • Re: How to empty the cache?Dan Nelson9 Jun
        • RE: How to empty the cache?Iago Sineiro9 Jun