现在在做一个系统
使用了这么一个查询
select a.id,a.fdate,a.fbillno,e.fname as fwarehousename,a.fnote,c.fname as fsupplyname,d.fname as fdeptname,a.fempname,b.fid,b.fname,b.fnumber,b.fprice,b.famount,a.fyear,a.fperiod,a.fbillerid,b.fac,a.voucherid from stockbill a right join entry b on a.fbillno=b.fbillno left join supplier c on a.fsupplyid=c.fid left join department d on a.fdeptid=d.fid left join warehouse e on a.fwarehouse=e.fid where a.fbilltypeid='1' and a.fdeleted=0 and b.fbilltypeid='1' and a.fdate>='2013-07-01' and a.fdate<='2013-07-31' and b.fdate>='2013-07-01' and b.fdate<='2013-07-31' order by a.fdate desc,a.fbillno desc
我用同样的配置
发现mysql 5.5.33进行了缓存,另一个mysql 5.6.13没有缓存到,很奇怪
使用show status like 'Qcache',发现运行了一天后
Qcache_hits值为0
但是5.5.33运行一会就有了数据
my.ini的内容如下:
[mysqld]
# generic configuration options
port = 3306
basedir=D:/wamp/mysql
datadir=D:/wamp/data5/
tmpdir=D:/wamp/tmp/
#change1 character-set-server=utf8
#character_set_server=utf8 either is ok
character-set-server=utf8
#change 2 无法使用
#table_cache=2048
wait_timeout=60
interactive_timeout=30
skip-name-resolve
bind-address=0.0.0.0
innodb_file_per_table=1
innodb_open_files=2048
back_log = 500
max_connections = 50
max_connect_errors = 100
table_open_cache = 2048
max_allowed_packet = 32M
binlog_cache_size = 1M
max_heap_table_size = 256M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
sort_buffer_size = 16M
join_buffer_size = 32M
thread_cache_size = 64
thread_concurrency =4
query_cache_size = 128M
query_cache_limit = 2M
ft_min_word_len = 4
default-storage-engine = Innodb
thread_stack = 192K
# Set the default transaction isolation level. Levels available are:
# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
#change 11 事务隔离级别
#transaction_isolation = REPEATABLE-READ
tmp_table_size = 256M
max_tmp_tables=512
slow-query-log=1
long_query_time = 2
slow-query-log-file=slow.log
server-id = 1
#*** MyISAM Specific options
key_buffer_size = 128M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size=2048M
myisam_repair_threads = 1
myisam_recover
# *** INNODB Specific options ***
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size =2048M
innodb_data_file_path = ibdata1:10M:autoextend
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_thread_concurrency =4
innodb_flush_log_at_trx_commit = 0
innodb_log_buffer_size = 8M
innodb_log_file_size = 128M
innodb_log_files_in_group = 2
innodb_max_dirty_pages_pct = 80
innodb_lock_wait_timeout = 60