Hi. When i disable query cache in mysql, queries still cached. As I understand it is because of OS filesystem cache. How can i prevent filesystem on cache this data. I working on WIndows 7 but it might be the Linux.
A:
There is no query filesystem cache in MySQL.
When i disable query cache in mysql, queries still cached
How do you disable it and how do you know queries are still cached? Why you don't want them to be cached?
FractalizeR
2010-02-08 12:16:59
I running querymysql> SHOW GLOBAL STATUS LIKE 'Qcache%';And it returns all zero values, and it means no query cache enabled.Next a running query against table with 20.000 rowsmysql> SELECT COUNT(*) FROM bigtable;returns 1 row in set (2.55 sec)run againmysql> SELECT COUNT(*) FROM bigtable;returns 1 row in set (0.52 sec)etc---I won't like to use cache because i need to run same queries for benchmarking.
Dima
2010-02-08 14:13:19
When you make COUNT(*) on ISAM tables, only table header is read. Actual row count is stored in table header and fetched quickly. And it is cached in Windows file cache. This has no relation to query cache.
FractalizeR
2010-02-08 16:00:19
Well, count(*) is not good example. I use InnoDb table, and query might be select * or select id or whatever else.
Dima
2010-02-08 16:18:46
I think you misunderstand something. There is a lot of optimizations done by MySQL except query cache. And the single fact, that second same query is executed faster than the first, does not mean query cache is enabled. Also, I still don't understand why to disable it. Benchmarking should use the same conditions live server will have. Otherwise, why to have them at all?
FractalizeR
2010-02-09 07:58:04
A:
Well now i can answer my question by myself. To prevent caching second and next queries need to set innodb_buffer_pool_size=0 config option. This buffer used by mysql to swapping data into memory and all next queries operates with memory instead HD.
Dima
2010-02-09 09:55:48