Description:
FLUSH TABLE T flushes entire query cache if T exists and even if T does NOT exist. See bug #40809 and http://dev.mysql.com/doc/refman/5.0/en/flush.html.
This may have serious performance impact. So, please, flush query cache only for tables listed explicitely, if they exist.
How to repeat:
mysql> show global status like 'qcache%';
+-------------------------+---------+
| Variable_name | Value |
+-------------------------+---------+
| Qcache_free_blocks | 1 |
| Qcache_free_memory | 8376576 |
| Qcache_hits | 3 |
| Qcache_inserts | 5 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 13 |
| Qcache_queries_in_cache | 2 |
| Qcache_total_blocks | 7 |
+-------------------------+---------+
8 rows in set (0.00 sec)
mysql> flush table xxxxxxxnevereverexisted;
Query OK, 0 rows affected (0.01 sec)
mysql> show global status like 'qcache%';
+-------------------------+---------+
| Variable_name | Value |
+-------------------------+---------+
| Qcache_free_blocks | 1 |
| Qcache_free_memory | 8379648 |
| Qcache_hits | 3 |
| Qcache_inserts | 5 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 14 |
| Qcache_queries_in_cache | 0 |
| Qcache_total_blocks | 1 |
+-------------------------+---------+
8 rows in set (0.00 sec)