首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

mysql5.5.25 源码翻阅-query cache

2013-01-04 
mysql5.5.25 源码阅读---query cacheSQL_CACHE先从query cache 查找,若有直接返回query cache 中结果若没

mysql5.5.25 源码阅读---query cache

SQL_CACHE
   先从query cache 查找,
   若有直接返回query cache 中结果
   若没有再进行select,并且将结果放在query cache中(前提是满足放入query cache条件)
  
SQL_NO_CACHE
   不检查query cache,直接进行查询
       sql_cache.cc
       Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
         if (query_length > 20 && has_no_cache_directive(&sql[i+6]))
         {
            DBUG_PRINT("qcache", ("The statement has a SQL_NO_CACHE directive"));
            goto err;
         }
   不把结果放在query cache中


相关命令
flush query cache :整理query cache碎片,并不会移除query cache内容
reset query cache / FLUSH TABLES :清空query cache内容


热点排行