directpathread直接路徑讀

前言:傳統(tǒng)的數(shù)據(jù)庫讀取的方式是先在內(nèi)存中搜索,如果搜索不到數(shù)據(jù),那么就在把數(shù)據(jù)從磁盤讀到內(nèi)存中,然后PGA再中SGA中獲取數(shù)據(jù),這樣數(shù)據(jù)就緩存到內(nèi)存中了,下次再次訪問的時候,就可以直接從SGA中獲取,不用再進行物理讀;

創(chuàng)新互聯(lián)建站擁有10年成都網(wǎng)站建設(shè)工作經(jīng)驗,為各大企業(yè)提供成都做網(wǎng)站、網(wǎng)站制作服務(wù),對于網(wǎng)頁設(shè)計、PC網(wǎng)站建設(shè)(電腦版網(wǎng)站建設(shè))、成都APP應(yīng)用開發(fā)、wap網(wǎng)站建設(shè)(手機版網(wǎng)站建設(shè))、程序開發(fā)、網(wǎng)站優(yōu)化(SEO優(yōu)化)、微網(wǎng)站、國際域名空間等,憑借多年來在互聯(lián)網(wǎng)的打拼,我們在互聯(lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)積累了很多網(wǎng)站制作、網(wǎng)站設(shè)計、網(wǎng)絡(luò)營銷經(jīng)驗,集策劃、開發(fā)、設(shè)計、營銷、管理等網(wǎng)站化運作于一體,具備承接各種規(guī)模類型的網(wǎng)站建設(shè)項目的能力。

direct path read(直接路徑讀):直接路徑讀是違反傳統(tǒng)的數(shù)據(jù)讀取方式的,指服務(wù)器進程直接讀取數(shù)據(jù)文件到PGA的內(nèi)存,不經(jīng)過buffer cache,以下是數(shù)據(jù)庫讀取數(shù)據(jù)的三種方式;direct path read直接路徑讀

官方說明介紹:When a session is reading buffers from disk directly into the PGA (opposed to the buffer cache in SGA), it waits on this event. If the I/O subsystem does not support asynchronous I/Os, then each wait corresponds to a physical read request.

 If the I/O subsystem supports asynchronous I/O, then the process is able to overlap issuing read requests with processing the blocks existing in the PGA. When the process attempts to access a block in the PGA that has not yet been read from disk, it then issues a wait call and updates the statistics for this event. Hence, the number of waits is not necessarily the same as the number of read requests (unlike db file scattered read and db file sequential read).

 Check the following V$SESSION_WAIT parameter columns:

 ?P1: File_id for the read call

 ?P2: Start block_id for the read call

 ?P3: Number of blocks in the read call

直接路徑讀的優(yōu)勢:存在即合理,相信這個算法的產(chǎn)生也肯定是有原因的;

總結(jié)優(yōu)勢如下:

1、采用直接路徑讀取后,總能保證讀取的塊數(shù)是多塊讀參數(shù)設(shè)置的大小,提高了讀取的效率;

2、大大的降低了對于latch的使用,進而避免了可能導(dǎo)致的latch競爭(cbc latch等);

3、降低了全表掃描對buffer cache的沖擊;

4、降低了buffer pin的開銷,有可能降低buffer busy waits等相關(guān)等待;

 

當(dāng)然這種方法也是有副作用的:

1、會發(fā)生段一級的檢查點(后面詳細介紹),因此在查詢真正開始執(zhí)行前,會做這個額外的準(zhǔn)備工作。而且可能會造成IO抖動,因為要寫臟數(shù)據(jù);

2、如果你的表需要頻繁的全表掃描讀取,還是用傳統(tǒng)的讀取方式比較好;

3、在MOS中搜索direct path read,會發(fā)現(xiàn)它可能會導(dǎo)致多次的延遲塊清除;

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

本文作者:JOHN

ORACLE技術(shù)博客:ORACLE 獵人筆記               數(shù)據(jù)庫技術(shù)群:367875324 (請備注ORACLE管理 )  

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

本文題目:directpathread直接路徑讀
URL地址:http://bm7419.com/article8/jjdpop.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站、微信小程序搜索引擎優(yōu)化、網(wǎng)站排名、標(biāo)簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

手機網(wǎng)站建設(shè)