1 / 30

XML 資料庫管理系統 之緩衝區管理策略

XML 資料庫管理系統 之緩衝區管理策略. Buffer Management in XML DBMSs. 指導老師:陳世穎 老師 學生 : 翁瑜璘、廖育伶、李昱諭 日期 : 2006/05/10. 大 綱. 簡 介 研究動機 研究目的 問題分析 分析模擬結果 結論與未來方向. XML 簡 介. XML (eXtensible Markup Language) XML 擁有 擴充性 -- 讓使用者自行定義文件架構、標籤 允許使用者自定標籤屬性 XML 文件屬於 樹狀結構 的文件 XPath 為 XML 文件查詢語言之基礎.

vera
Download Presentation

XML 資料庫管理系統 之緩衝區管理策略

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML資料庫管理系統之緩衝區管理策略 Buffer Management in XML DBMSs 指導老師:陳世穎 老師學生: 翁瑜璘、廖育伶、李昱諭 日期: 2006/05/10

  2. 大 綱 • 簡 介 • 研究動機 • 研究目的 • 問題分析 • 分析模擬結果 • 結論與未來方向

  3. XML 簡 介 • XML (eXtensible Markup Language) • XML擁有擴充性 -- 讓使用者自行定義文件架構、標籤 允許使用者自定標籤屬性 • XML文件屬於樹狀結構的文件 • XPath為XML文件查詢語言之基礎 a b2 b1 c4 c1 c2 c3 a/b1/c1

  4. Buffer pool 簡 介 (1/2) • DB (Database)存取方式 -- 磁碟中取出資料放入buffer pool中,供 DBMS (Database Management System)使用 -- DB的存取是以分頁(page)為單位 • Buffer pool -- 尋找某一個page是否存在buffer pool之中 -- 如果找不到此page則從磁碟中把它置換進buffer pool • 緩衝區管理的目的 -- 減少disk I/O (磁碟存取)的次數

  5. Table A Buffer pool 簡 介 (2/2)  以RDB之select語法為例 Buffer pool 0 DBMS 1 2 ? 3

  6. 研究動機 • 目前無適當的XML資料庫系統之緩衝區管理機制 -- XML資料庫 --以Berkeley DB XML為研究對象 --其取代策略是使用LRU的取代方式 --「結合運算(join operations)為一成本高之運算」 for $a in doc("items.xml")/item_tuple let $b:= doc("bids.xml")/bid_tuple[itemno = $a/itemno] • 討論XML資料庫系統中緩衝區管理的問題

  7. 研究目的 • 以XPath語言為基礎,分析XML中XQuery查詢語言的特性,並依據特性作分類。 • 依據分類,提出有效率的XML資料庫系統中緩衝區管理所需的配置策略與取代策略。 • 針對影響查詢效能最鉅的結合運算(join operations),來做討論與分析,以提高系統的效能。

  8. 相關研究 • RDB (Relational Database) -- Hot set Algorithm -- DBMIN Algorithm • OODB (Object-Oriented Database) -- 巡弋查詢在物件導向資料庫系統的 緩衝區管理。

  9. 問題分析 (1/2) • 結合運算之查詢牽涉到的文件,可分成outer tree與innertree兩個部份來分析。 XQuery敘述如下: for $a in doc(“T1.xml")/item_tuple let $b:= doc(“T2.xml")/bid_tuple[itemno = $a/itemno] T1  Level_retrieval (outer tree) T2  Looping_Level_retrieval (inner tree)

  10. 問題分析 (2/2) T1- Level_retrieval T2 – Looping_Level_retrieval 比對 bid_tuple itemno item_tuple itemno

  11. Yao 公式 輸出值:Y - 須要分配之Buffer pool數 輸入值: m-某一層資料數p-m筆資料分佈於p個page k-欲存取資料筆數

  12. h 層 未作查詢部份 Level_retrieval • 特性:節點經擷取過後即不須再取用。 • 配置策略:max(Yi) for each i • 取代策略:Random 成本計算: C為每一層之緩衝區配置大小

  13. Looping_Level_retrieval (1/2) • 特性:每一筆資料會一直不斷的做循環取出。 • 取出之每一資料,可以正確的與outer tree中之資料比對完成。 • 配置策略:max(Yi) for each i • 取代策略:MRU

  14. Looping_Level_retrieval (2/2) 成本計算:  做h層查詢所花費之成本  由T1而導致T2所須做Looping之花費成本  取出T2中比對成功之J元素

  15. 分析模擬結果 (1/3) M=300 m/p=5 (比例:5 個節點資料散佈於 1 個磁碟中) Join運算中outer tree產生之 Join運算中inner tree產生之 頁失誤數 頁失誤數

  16. 分析模擬結果 (2/3) Outer之k=75,與inner tree 做 join運算 Join運算之預估結果

  17. 分析模擬結果(3/3) 三種配置策略之結果比較

  18. Berkeley DB架構圖 應用程式(Applications) 存取函式(Access Methods) Disk 暫存區(Buffer Pool)

  19. 配置 Buffer

  20. os_alloc.c __os_malloc() db_salloc.c __db_shalloc() 查詢流程

  21. 結 論 • 分析了XML資料庫在做查詢時,最主要的兩種查詢方式。 • 使用Yao公式算出須要建立多大的緩衝區提供暫存並建立成本分析數學模式。

  22. 未來方向 • 分析與設計其他XQuery中所需的緩衝區管理機制。 • 利用本研究之成本分析結果設計查詢最佳化之決策。

  23. 報告完畢 謝謝

  24. Hot Set Algorithm • hot set:一組有循環行為的page • hot set in memory (efficient vs. page faults) buffer pool 的大小足夠持有hot set buffer pool 的大小不足以持有hot set • hot points:在efficient和page faults間取得平衡 • Buffer pool 配置大小(hot points)

  25. Select * from A,Bwhere A.id=B.id Hot set Table B Disk I/O Table A Hot point 3+1=4 Buffer Size

  26. OODB存取模式 物件1 (oid1 add1) 磁碟頁1 物件2 buffer (oid2 add2) 磁碟頁2 …. …. (oidn addn) 物件n 磁碟頁3 (物件指標,位址) 對應區 物件存放區

  27. OODBMS巡弋查詢在物件導向資料庫系統的緩衝區管理OODBMS巡弋查詢在物件導向資料庫系統的緩衝區管理 • 直接法 --直接查詢 • 區塊法 --先查詢Buffer裡有無要查詢的資料 • 索引法 --透過標籤或屬性值做索引查詢

  28. Berkeley DB之應用 • Amazon.com uses Berkeley DB as a fast cache for several critical parts of its customer-facing e-commerce website. • Google uses Berkeley DB High Availability for Google Accounts. • Motorola uses Berkeley DB to track mobile units in its wireless radio network products.

  29. BerkeleyDB page size

  30. BerkeleyDB os_alloc

More Related