Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to query buffer Mechanism in MySQL Database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

It is believed that many inexperienced people have no idea about how to query the buffer mechanism in MySQL database. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

How to query buffer Mechanism in MySQL Database

You can know whether the query_cache_size setting is reasonable by adjusting the following parameters:

Qcacheinserts

Qcachehits

Qcachelowmemprunes

Qcachefreeblocks

Qcachetotalblocks

The value of Qcache_lowmem_prunes is very large, which means that there is often insufficient buffering. At the same time, the value of Qcache_hits is very large, which means that query buffering is used very frequently. At this time, you need to increase the buffer size. The value of Qcache_hits is not large, it means that your query repetition rate is very low. In this case, using query buffering will affect efficiency, so you can consider not using query buffering. In addition, adding SQL_NO_CACHE to the SELECT statement makes it clear that query buffering is not used.

Qcache_free_blocks, if the value is very large, indicates that there is a lot of fragmentation in the buffer query_cache_type specifies whether to use query buffering.

How to query buffer Mechanism in MySQL Database

If set to:

Query_cache_size=32M

Query_cache_type=1

Get the following status values:

Qcachequeriesincache12737// indicates the number of entries currently cached.

Qcacheinserts20649006

Qcachehits79060095// seems to have a high rate of repeated queries.

There are so many cases where the cache is too low in Qcachelowmemprunes617913//.

Qcachenotcached189896

Qcachefreememory18573912// currently has remaining cache space.

The number of Qcachefreeblocks5328// seems to be a little big, with a lot of fragments.

Qcachetotalblocks30953

If memory allows, you can also make the query_cache_size a little larger.

After reading the above, have you mastered how to query the buffering mechanism in the MySQL database? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report