directpathread直接路徑讀-創(chuàng)新互聯(lián)

前言:傳統(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)歡迎咨詢:13518219792,為您提供成都網(wǎng)站建設網(wǎng)頁設計及定制高端網(wǎng)站建設服務,成都創(chuàng)新互聯(lián)網(wǎng)頁制作領(lǐng)域十余年,包括成都宴會酒店設計等多個領(lǐng)域擁有豐富的網(wǎng)站制作經(jīng)驗,選擇成都創(chuàng)新互聯(lián),為企業(yè)錦上添花。

direct path read(直接路徑讀):直接路徑讀是違反傳統(tǒng)的數(shù)據(jù)讀取方式的,指服務器進程直接讀取數(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ù)設置的大小,提高了讀取的效率;

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

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

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

當然這種方法也是有副作用的:

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

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

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

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

本文作者:JOHN

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

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

網(wǎng)站名稱:directpathread直接路徑讀-創(chuàng)新互聯(lián)
瀏覽路徑:http://muchs.cn/article36/egopg.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)、電子商務、微信小程序、移動網(wǎng)站建設網(wǎng)站收錄、網(wǎng)站制作

廣告

聲明:本網(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)

成都app開發(fā)公司