'%query_cache% ';2: Cache configuration parameter explanation1. Query_cache_type: Query cache type, whether to open cacheOptions availableA, 0 (off): Turn off the query cache function, do not use the query
have to adjust the value of "query_cache_limit" to avoid the MySQL cache because the result set size exceeds the limit.View query Cache-related state variables650) this.width=650; "src=" Http://my.csdn.net/uploads/201208/12/1344760080_2359.png "style=" border:none; "/>
1. Query cache key is a SQL string, and requires exact matching: The case is not the same or more than one space, will result in cache miss
2. Query cache directly the user input of the original SQL as a key, not to parse or optimized after the SQL as a key, also will not b
Qcache_not_cached does not have the number of queries cached (cannot be cached, or because of QUERY_CACHE_TYPE)
Qcache_free_memory
Qcache_free_blocks query the number of idle memory blocks in the cache
Qcache_total_blocks
Total number of queries = Qcache_inserts + Qcache_hits + Qcache_not_cached.
The query cache uses
Many database systems can cache execution plans. For identical SQL statements, you can use existing execution plans to skip the process of parsing and generating execution plans. MYSQL and Oracle provide more advanced query result caching functions. For SQL statements with identical strings and Case sensitivity, You can execute the return
default character sets are considered to be different queries and cache them separately.
The following SQL query cache is considered different:
SELECT * FROM tbl_name
Select * from tbl_name
Query cache Parameters
MySQL
string may be considered different for other reasons. Queries using different databases, different protocol versions, or different default character sets are considered to be different queries and cache them separately.
The following SQL query cache is considered different:
SELECT*FROMtbl_name
Select*fromtbl_name
for SQL statements that involve frequently updated tables, plus sql_no_cache keywords. This avoids unnecessary memory operations as much as possible and keeps the memory as continuous as possible.
You should also not use caching for SQL statements that are very decentralized queries. For example, use MySQL to query user and password statements--"Select pass from user where name= ' surfchen '". Such statem
The MySQL query cache is analyzed in detail from five angles: The working principle of query cache, how to configure, how to maintain, how to judge the performance of query cache, and t
by default, and disable the CACHE for some SQL statements involving frequently updated tables with the keyword SQL _NO_CACHE. In this way, you can avoid unnecessary memory operations as much as possible and maintain memory continuity as much as possible.
The SQL statements with scattered queries should not be cached. For example, if Mysql is used to query the us
. Each user login to use the query, are not the same SQL text, QC here is almost useless, because the cached data is almost not used, they will only occupy a place in memory. Negative effects of 2,querycache:1,query hash performance problem and hit rate problem;2, the query cache and its easy invalidation, when the tab
/MY.CNF[MYSQLD] Added: Query_cache_type = OnHave_query_cache indicates whether the current database supports caching capabilities; YesQuery_cache_limit represents the maximum value of a single query cache, and if the query results exceed this size, the result is not cached even if the current result is specified; defau
MySQL Query cache summary bitsCN.com
MySQL Query cache summary
You can use the following SQL statement to view the cache-related parameter status of the current
: Sets the memory size that the query cache uses, default A value of 0, the size must be 1024 integer times, if not an integer multiple, MySQL will automatically adjust the minimum amount to achieve a multiple of 1024
query_cache_type: Control the
Detailed description of MySQL query Cache
Query cache stores the text returned to the client using the SELECT syntax query. When the same request occurs again, data is retrieved from the query
To improve the query speed, MySQL maintains a memory area (official documentation indicates that the size is at least 41984B) to cache the query results, and when the query finds data in the c
).Cache Configuration and MaintenanceQuery_cache_type: Whether to open the query cache. can be set to (OFF, on, DEMAND). Demand indicates that only statements that explicitly mark Sql_cache in a query statement are placed into the query cache.Query_cache_size: The
2 can be enabled using Sql_cache in SQL statements.
Query_cache_min_res_unit
Allocate the memory size to the QC results each time
State
Show status like ' qcache% ' can see this information.
Qcache_free_blocks
When a table is updated, the cache blocks associated with it will be free. However, the block may still exist in the queue unless it is at the end of the queue. These blocks will be counted to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.