当前位置:网站首页>Mysql OCP 28题
Mysql OCP 28题
2022-08-03 09:33:00 【51CTO】
The MySQL error log shows:
InnoDB: Warning: a long semaphore wait:
The relevant parts of the InnoDB monitor output shows:
Which two options would help avoid the long wait in the future?
A. Increase the value of the innodb_lock_wait_timeout option.
B. Increase the value of the innodb_read_io_threads option.
C. Change the table to use HASH indexes instead of BTREE indexes.
D. Set the value of innodb_adaptive_hash_index to zero.
E. Deactivate the query cache.
F. Increase the size of the InnoDB buffer pool.
Answer: DE
InnoDB存储引擎会监控对表上索引的查找,如果观察到建立哈希索引可以带来速度的提升,则建立哈希索引,所以称之为自适应(adaptive) 的。自适应哈希索引通过缓冲池的B+树构造而来,因此建立的速度很快。而且不需要将整个表都建哈希索引,InnoDB存储引擎会自动根据访问的频率和模式 来为某些页建立哈希索引。
根据InnoDB的官方文档显示,启用自适应哈希索引后,读取和写入速度可以提高2倍;对于辅助索引的连接操作,性能可以提高5倍。在我看来,自适应哈希索引是非常好的优化模式,其设计思想是数据库自优化(self-tuning),即无需DBA对数据库进行调整。
Adaptive Hash Index是针对B+树Search Path的优化,因此所有会涉及到Search Path的操作,均可使用此Hash索引进行优化,这些可优化的操作包括:Unique Scan/Range Scan(Locate First Key Page)/Insert/Delete/Purge等等,几乎涵盖InnoDB所有的操作类型
Adaptive,意味着不是所有的叶页面都会以Hash索引维护,叶页面进入Hash 索引的条件是:同种类型的操作(Scan/Insert…),命中同一叶页面的次数,超过此页面记录数量的1/16,则可将当前叶页面加入Hash索引, 用以优化后续可能的相同Search Path。
版权声明:本文为博主原创文章,未经博主允许不得转载。
MYSQL
边栏推荐
猜你喜欢
随机推荐
flush tables
110 MySQL interview questions and answers (continuous updates)
STP生成树(端口状态+端口角色+收敛机制 )|||| STP优化技术( uplinkfast技术+Portfast技术+backbonefast技术 )详解
Apple Silicon配置二进制环境(二)
mysql8安装步骤教程
gpnmb+ gpnmb-AT2 cell idling mapping Epithelial cell idling mapping
Oracle 数据如何迁移到MySQL 图文详细教程
System io statistics
【LeetCode】101.对称二叉树
【快手面试】Word2vect生成的向量,为什么可以计算相似度,相似度有什么意义?
Chrome F12 keep before request information network
MySQL的存储过程
响应式布局经典范例——巨幅背景大标题
STP普通生成树安全特性— bpduguard特性 + bpdufilter特性 + guard root 特性 III loopguard技术( 详解+配置)
别人都不知道的“好用”网站,让你的效率飞快
English Grammar - Adverbial Clauses
pytorch安装错误
面试突击71:GET 和 POST 有什么区别?
Batch PNG format can be converted to JPG format
机器学习(公式推导与代码实现)--sklearn机器学习库