In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to use SQL_NO_CACHE in MySQL, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
SQL_CACHE means to use caching when querying.
SQL_NO_CACHE explains as follows:
1. If you do not use the existing database cache to query the current query, the current query will take more time.
two。 If the result set generated by the current query is not cached in the system query cache, it will take more time next time for the same query.
When we want to use SQL_NO_CACHE to disable result caching, we find that the result is not what we expected, and the result of query execution is still the cached result. In fact, the real purpose of SQL_NO_CACHE is to disable the caching of query results, but that does not mean that cache is not returned to query as a result.
The official explanation of SQL_NO_CACHE is as follows:
SQL_NO_CACHE means that the query result is not cached. It does not mean that the cache is not used to answer the query.
You may use RESET QUERY CACHE to remove all queries from the cache and then your next query should be slow again. Same effect if you change the table, because this makes all cached queries invalid.
The following is the experimental process:
Mysql > use test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-A
Database changed
Mysql > select count (*) from fp_data
+-+
| | count (*) |
+-+
| | 158404 |
+-+
1 row in set (0.05sec)
Mysql > select count (*) from fp_data
+-+
| | count (*) |
+-+
| | 158404 |
+-+
1 row in set (0.03 sec)
Mysql > select SQL_CACHE count (*) from fp_data
+-+
| | count (*) |
+-+
| | 158411 |
+-+
1 row in set (0.03 sec)
Mysql > select SQL_NO_CACHE count (*) from fp_data
+-+
| | count (*) |
+-+
| | 158404 |
+-+
1 row in set (0.02 sec)
Thank you for reading this article carefully. I hope the article "how to use SQL_NO_CACHE in MySQL" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.