Re: Queries slow down daily, optimizing helps -> why?
Posted by:
Rick James
Date: February 19, 2009 10:53PM
key_buffer is for MyISAM indexes only.
Query_cache is for statements. And you have it "ON" with 500MB of space (a lot). There are several caveats:
* When a table is modified (INSERT/...) all entries in the QC for that table are purged.
* When the _identical_ SELECT comes in (not even so much as a space different), the engine will first look in the QC to see if it is there. If so, it will return the result set from the QC.
* Result sets that are too big won't go into the QC.
So, another explanation for the slowdown...
1. Do the SELECT -- it gets into QC.
2. The table is modified -- QC flushed (for that table)
3. Do the SELECT again -- not found in QC, so slow.
4. Run SELECT again -- now blazingly fast because it is QC.
SHOW STATUS LIKE "Query%";
will give some numbers that (with some dividing) can give you the hit/miss rate, etc.
Subject
Views
Written By
Posted
4793
February 18, 2009 04:54AM
2416
February 18, 2009 09:04AM
2519
February 18, 2009 11:57AM
2487
February 19, 2009 01:00AM
2444
February 19, 2009 01:52AM
2463
February 19, 2009 03:32AM
1882
February 19, 2009 05:08AM
2337
February 19, 2009 12:24PM
Re: Queries slow down daily, optimizing helps -> why?
2417
February 19, 2009 10:53PM
2534
February 20, 2009 08:34AM
2323
March 18, 2009 03:58AM
2436
February 21, 2009 06:15AM
2390
February 24, 2009 10:02AM
2643
February 26, 2009 02:30AM
2214
February 26, 2009 09:56AM
2414
February 26, 2009 08:14PM
2420
February 27, 2009 01:38AM
2306
February 27, 2009 07:56PM
2320
February 28, 2009 06:20AM
2691
February 28, 2009 03:43PM
2443
February 27, 2009 04:21AM