SQL_NO_CACHE网络上看了解释,不是很明白,自己试验了下:
结论
SQL_NO_CACHE只是不会将查询结果放进缓存,如果第一次查询时没有使用SQL_NO_CACHE,后面查询时使用SQL_NO_CACHE结果还是会从缓存中获取。
试验结果:
试验一:
1、SELECT SQL_NO_CACHE count(1) FROM `cc_member_card_main_info_0`;
2、SELECT SQL_NO_CACHE count(1) FROM `cc_member_card_main_info_0`;
试验二:
1、SELECT count(1) FROM `cc_member_card_main_info_0`;
2、SELECT SQL_NO_CACHE count(1) FROM `cc_member_card_main_info_0`;
3、SELECT SQL_NO_CACHE count(1) FROM `cc_member_card_main_info_0`;