From: Eric Bergen Date: May 29 2009 9:59pm Subject: Re: Why can't I kill the query cache? List-Archive: http://lists.mysql.com/mysql/217741 Message-Id: <11b1bd990905291459r35c62157y3a76046acb83dc09@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You can also flush the cache with echo 1 > /proc/sys/vm/drop_caches if you have a new enough kernel. On Fri, May 29, 2009 at 2:16 PM, Dan Nelson wrote= : > In the last episode (May 29), Gerald L. Clark said: >> Little, Timothy wrote: >> > Also titled, I want this to run slow ALL the time... >> > >> > I have a group of dreadful queries that I have to optimize. >> > >> > Some take 20-30 seconds each -- the first time that I run them. =A0But >> > then they never seem to take that long after the first time (taking le= ss >> > than a second then). =A0If I change the "keywords" searched for in the >> > where clauses, then they take a long time again... =A0so it's the >> > query-cache or something just like it. >> > >> > BUT, I am doing this each time : >> > flush tables; >> > reset query cache; >> > set global query_cache_size=3D0; >> > SELECT =A0 SQL_NO_CACHE DISTINCT ca.conceptid AS headingid, >> > >> > And still it's not avoiding the cache. >> > >> > Is there a cache I'm missing? >> > >> > Tim... >> > >> > >> Disk cache, but I don't know how to clear it. > > Create a file 2x the size of your RAM (for a 2gb system, dd if=3D/dev/zer= o > of=3Dbigfile bs=3D1024k count=3D4096), then dd it to /dev/null (dd if=3Db= igfile > of=3D/dev/null bs=3D1024k). =A0That should flush your OS cache. =A0The gu= aranteed > way would be to dismount then remount your filesystem, but that could be > difficult depending on how many other processes are using it.. > > -- > =A0 =A0 =A0 =A0Dan Nelson > =A0 =A0 =A0 =A0dnelson@stripped > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Deric.bergen@g= mail.com > > --=20 Eric Bergen eric.bergen@stripped http://www.ebergen.net