MySQL Forums :: Performance :: MySQL 5.5 and Query Cache


Advanced Search

MySQL 5.5 and Query Cache
Posted by: Paulo Victor Maluf Alves ()
Date: November 24, 2011 02:43PM

Hi,

I have a problem with MySQL 5.5 and Query Cache. Just does not work!


The Query Cache is active, follow:

mysql> show variables like '%cache%';
+------------------------------+----------------------+
| Variable_name | Value |
+------------------------------+----------------------+
| binlog_cache_size | 32768 |
| binlog_stmt_cache_size | 32768 |
| have_query_cache | YES |
| key_cache_age_threshold | 300 |
| key_cache_block_size | 1024 |
| key_cache_division_limit | 100 |
| max_binlog_cache_size | 18446744073709547520 |
| max_binlog_stmt_cache_size | 18446744073709547520 |
| query_cache_limit | 10485760 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 16777216 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
| table_definition_cache | 400 |
| table_open_cache | 512 |
| thread_cache_size | 30 |
+------------------------------+----------------------+
16 rows in set (0.00 sec)


mysql> desc tracking;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| k | varchar(256) | NO | PRI | NULL | |
| v | varchar(4096) | NO | | NULL | |
| t | bigint(20) | NO | MUL | NULL | |
| f | bigint(20) | NO | | NULL | |
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)


mysql> select * from tracking where k = '6563a95f-ff8d-4eee-b931-21ee7986f12f.901' and (t = 0 or t >= 63489375661);
+------------------------------------------+--------------------------------------------------------+-------------+-------------+
| k | v | t | f |
+------------------------------------------+--------------------------------------------------------+-------------+-------------+
| 6563a95f-ff8d-4eee-b931-21ee7986f12f.901 | 901/1322163661615/null/{agregador=radardedescontos;}[] | 63489462061 | 63489375661 |
+------------------------------------------+--------------------------------------------------------+-------------+-------------+
1 row in set (0.00 sec)

Or a simple:

mysql> select v from tracking where k = '6563a95f-ff8d-4eee-b931-21ee7986f12f.901';

But, its not cached:

mysql> show status like 'Qcache_queries_in_cache';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Qcache_queries_in_cache | 0 |
+-------------------------+-------+
1 row in set (0.00 sec)

What am I doing wrong?

Thanks!!

Options: ReplyQuote


Subject Views Written By Posted
MySQL 5.5 and Query Cache 2741 Paulo Victor Maluf Alves 11/24/2011 02:43PM
Re: MySQL 5.5 and Query Cache 853 Paulo Victor Maluf Alves 11/25/2011 11:21AM
Re: MySQL (all versions) and Query Cache 621 Rick James 11/25/2011 11:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.