Mysql state invalidating
If all or the majority of your data is My ISAM, you could go with your original idea of using SQL_NO_CACHE.
The classic tip is “set global query_cache_size=0” .
id=38551In short, in all My SQL versions before 5.5 , the query cache mutex is acquired even if query_cache_size=0 and query_cache_type=OFF : always!
but really, this looks mostly like a case of the actual thread status being misreported, and your issue is insufficient disk I/O bandwidth for the workload (or excessive flushing).
Try Alon, you seem to be making lots of different accounts, which is making editing your question harder.
It often happens to see and hear of replication SQL thread almost always in state “invalidating query cache entries (table)” .
While sometime this works, others don’t; the query cache is “disabled” and you still see the SQL thread in state “invalidating query cache entries (table)”.