现在在做一个系统使用了这么一个查询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=2048back_log = 500max_connections = 50max_connect_errors = 100table_open_cache = 2048max_allowed_packet = 32Mbinlog_cache_size = 1Mmax_heap_table_size = 256Mread_buffer_size = 16Mread_rnd_buffer_size = 16Msort_buffer_size = 16Mjoin_buffer_size = 32Mthread_cache_size = 64thread_concurrency =4query_cache_size = 128Mquery_cache_limit = 2Mft_min_word_len = 4default-storage-engine = Innodbthread_stack = 192K# Set the default transaction isolation level. Levels available are:
 # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
 #change 11 事务隔离级别
#transaction_isolation = REPEATABLE-READtmp_table_size = 256Mmax_tmp_tables=512slow-query-log=1long_query_time = 2slow-query-log-file=slow.logserver-id = 1#*** MyISAM Specific options
 key_buffer_size = 128Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size=2048Mmyisam_repair_threads = 1myisam_recover# *** INNODB Specific options ***innodb_additional_mem_pool_size = 16Minnodb_buffer_pool_size =2048Minnodb_data_file_path = ibdata1:10M:autoextendinnodb_write_io_threads = 8
 innodb_read_io_threads = 8innodb_thread_concurrency =4innodb_flush_log_at_trx_commit = 0innodb_log_buffer_size = 8Minnodb_log_file_size = 128Minnodb_log_files_in_group = 2innodb_max_dirty_pages_pct = 80innodb_lock_wait_timeout = 60