What sort of MySQL query cache should I choose considering the following…
- Large, rapidly growing database (I got 500,000 rows).
- UPDATEs practically never happen.
- SELECTs are rare, but when they do happen, they'll usually happen in huge batches.
- Lots of small INSERTs.
- A row is not usually SELECTed multiple times within a small period of time.
- I want to reduce memory footprint (server is using lots of memory).
Would I be looking for a large cache, or small cache?
From what I understand a cache isn't hugely important as repeated SELECTs are very rare.
Best Answer
Seriously, turning off the QC is probably best. especially based on what you said. Keep in mind that every
INSERT
(orUPDATE
) to a table causes all entries in the QC to be purged. Furthermore, if the QC size is large, (say, over 50M), the purge time slows down the write.The ENGINE's cache is important to both reads and writes. Generally MyISAM's
key_buffer_size
should be 20% of available RAM. OR InnoDB'sinnodb_buffer_pool_size
should be 70% of available RAM.