本站中文解释
query_cache_wlock_invalidate参数控制MySQL的查询缓存的锁有效性检查的机制。默认情况下,该参数的值为OFF,MySQL将在查询缓存中检查数据库表中的锁,如果查询缓存中存在相应的表锁,则会尝试重新检索数据,而不是从缓存读取结果。如果将该参数设置为ON,MySQL将忽略表锁,并重新从缓存读取结果,这样在一定程度上可以加快查询的执行速度。
要设置query_cache_wlock_invalidate参数,需要在MySQL服务器的配置文件(my.cnf)中添加如下内容:
query_cache_wlock_invalidate = 1
官方英文解释
query_cache_wlock_invalidate
Command-Line Format | --query-cache-wlock-invalidate[={OFF|ON}] |
---|---|
Deprecated | 5.7.20 |
System Variable | query_cache_wlock_invalidate |
Scope | Global, Session |
Dynamic | Yes |
Type | Boolean |
Default Value | OFF |
Normally, when one client acquires a WRITE
lock on a MyISAM
table, other clients are
not blocked from issuing statements that read from the table
if the query results are present in the query cache. Setting
this variable to 1 causes acquisition of a
WRITE
lock for a table to invalidate any
queries in the query cache that refer to the table. This
forces other clients that attempt to access the table to wait
while the lock is in effect.
Note
The query cache is deprecated as of MySQL 5.7.20, and is
removed in MySQL 8.0. Deprecation includes
query_cache_wlock_invalidate
.