国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

Innodb三大特性之a(chǎn)daptivehashindex_MySQL

來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-09 20:07:34
文檔

Innodb三大特性之a(chǎn)daptivehashindex_MySQL

Innodb三大特性之a(chǎn)daptivehashindex_MySQL:1、Adaptive Hash Indexes 定義 If a table fits almost entirely in main memory, the fastest way to perform queries on it is to use hash indexes. InnoDB has a mechanism that monitors i
推薦度:
導(dǎo)讀Innodb三大特性之a(chǎn)daptivehashindex_MySQL:1、Adaptive Hash Indexes 定義 If a table fits almost entirely in main memory, the fastest way to perform queries on it is to use hash indexes. InnoDB has a mechanism that monitors i

1、Adaptive Hash Indexes 定義

If a table fits almost entirely in main memory, the fastest way to perform queries on it is to use hash indexes. InnoDB has a mechanism that monitors index searches made to the indexes defined for a table. If InnoDB notices that queries could benefit from building a hash index, it does so automatically.

The hash index is always built based on an existing B-tree index on the table. InnoDB can build a hash index on a prefix of any length of the key defined for the B-tree, depending on the pattern of searches that InnoDB observes for the B-tree index. A hash index can be partial: It is not required that the whole B-tree index is cached in the buffer pool. InnoDB builds hash indexes on demand for those pages of the index that are often accessed.

In a sense, InnoDB tailors itself through the adaptive hash index mechanism to ample main memory, coming closer to the architecture of main-memory databases.

The configuration parameter innodb_adaptive_hash_index can be set to disable or enable the adaptive hash index. See Section 8.3.4, “Dynamically Changing innodb_adaptive_hash_index” for details.

2、hash index

哈希(hash)是一種非常快的查找方法,一般情況下查找的時間復(fù)雜度為O(1),常用于連接(join)操作,如SQL Server和Oracle中的哈希連接(hash join)。但是SQL Server和Oracle等常見的數(shù)據(jù)庫并不支持哈希索引(hash index)。MySQL的Heap存儲引擎默認(rèn)的索引類型為哈希,而InnoDB存儲引擎提出了另一種實(shí)現(xiàn)方法,自適應(yīng)哈希索引(adaptive hash index)

3、自適應(yīng)哈希

InnoDB存儲引擎會監(jiān)控對表上索引的查找,如果觀察到建立哈希索引可以帶來速度的提升,則建立哈希索引,所以稱之為自適應(yīng)(adaptive) 的。自適應(yīng)哈希索引通過緩沖池的B+樹構(gòu)造而來,因此建立的速度很快。而且不需要將整個表都建哈希索引,InnoDB存儲引擎會自動根據(jù)訪問的頻率和模式 來為某些頁建立哈希索引。

根據(jù)InnoDB的官方文檔顯示,啟用自適應(yīng)哈希索引后,讀取和寫入速度可以提高2倍;對于輔助索引的連接操作,性能可以提高5倍。在我看來,自適應(yīng)哈希索引是非常好的優(yōu)化模式,其設(shè)計思想是數(shù)據(jù)庫自優(yōu)化(self-tuning),即無需DBA對數(shù)據(jù)庫進(jìn)行調(diào)整。

Adaptive Hash Index是針對B+樹Search Path的優(yōu)化,因此所有會涉及到Search Path的操作,均可使用此Hash索引進(jìn)行優(yōu)化,這些可優(yōu)化的操作包括:Unique Scan/Range Scan(Locate First Key Page)/Insert/Delete/Purge等等,幾乎涵蓋InnoDB所有的操作類型

Adaptive,意味著不是所有的葉頁面都會以Hash索引維護(hù),葉頁面進(jìn)入Hash 索引的條件是:同種類型的操作(Scan/Insert…),命中同一葉頁面的次數(shù),超過此頁面記錄數(shù)量的1/16,則可將當(dāng)前葉頁面加入Hash索引, 用以優(yōu)化后續(xù)可能的相同Search Path。

mysql> show engine innodb status \G
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
 insert 0, delete mark 0, delete 0
discarded operations:
 insert 0, delete mark 0, delete 0
Hash table size 553229, node heap has 17 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s


mysql> show variables like '%adaptive_hash%'; 
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| innodb_adaptive_hash_index | ON |
+----------------------------+-------+

不過我們可以通過參數(shù)innodb_adaptive_hash_index來禁用或啟動此特性,默認(rèn)為開啟

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

Innodb三大特性之a(chǎn)daptivehashindex_MySQL

Innodb三大特性之a(chǎn)daptivehashindex_MySQL:1、Adaptive Hash Indexes 定義 If a table fits almost entirely in main memory, the fastest way to perform queries on it is to use hash indexes. InnoDB has a mechanism that monitors i
推薦度:
標(biāo)簽: 三大 mysql index
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 欧美日韩国产亚洲人成 | 欧美日韩视频在线 | 91欧美激情一区二区三区成人 | 黑人操穴| 亚洲精品国产综合一线久久 | 午夜欧美在线 | a级免费在线观看 | 欧美高清一区二区 | 99精品视频在线观看免费播放 | 最新国产精品电影入口 | 国产精选视频在线观看 | 国产一级淫 | 国产日韩在线播放 | 亚洲精品在线免费观看视频 | 国产精品一区二区三区四区五区 | 国产精品视频一区麻豆 | 久久99国产精品成人欧美 | 国产精品一区二区三区免费 | 精品欧美在线 | 欧美精品首页 | 亚洲欧美另类色图 | 最新中文字幕在线 | 欧美另类网站 | 亚洲国产成人久久综合碰 | 欧美精品在线视频观看 | 日本韩国在线 | 国产在线视频在线观看 | 国产欧美日韩三级 | 国产一级内谢a级高清毛片 国产最新精品视频 | 亚洲另类第一页 | 久久免费国产精品一区二区 | 亚洲精品在线第一页 | 欧美在线精品一区二区三区 | 青青国产成人久久91 | 国产va免费精品观看 | 亚洲国产成人影院播放 | 日韩毛片免费观看 | 中文字幕欧美在线观看 | 欧洲综合网 | 精品一区二区三区免费观看 | 久久久久成人精品一区二区 |