1 / 23

from the seminar support for non-standard datatypes in dbms Held by Brendan Briody

from the seminar support for non-standard datatypes in dbms Held by Brendan Briody. Accelerating XPath Location Steps. Overview. 1. Introduction - Awareness of tree structured data (XML ...). - Problem with recursion and RDBMS. 2. Tree Traversals & Mappings (part 1)

cian
Download Presentation

from the seminar support for non-standard datatypes in dbms Held by Brendan Briody

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. from the seminarsupport for non-standard datatypes in dbmsHeld by Brendan Briody Accelerating XPath Location Steps

  2. Overview 1. Introduction - Awareness of tree structured data (XML ...). - Problem with recursion and RDBMS. 2. Tree Traversals & Mappings (part 1) - Traversing trees to obtain information. - pre and post mapping to orthogonal coordinates, discovering their relationships and introducing corresponding XPath axes. 3. Axes and Query windows - Representing nodes in 5- dimensional descriptors and defining query windows for XPath axes. 4. Representation in SQL - Applying descriptors to a relational table and performing analogue SQL queries according to XPath expressions.

  3. Overview • 5. Shrink-Wrapping the // Axis • Discovering equations to shrink-wrap window ranges to minimise query • Query time comparison shrunk and non-shrunk windows. • 6. Tree Mapping (part 2) • Stretching - a different pre/post node assignment idea to avoid misled • query scans of shrink-wrapping. Advantages / Drawbacks of shrinking and stretching. • 7. Benchmarking Accel – Schema • againstEdge Mapping • Performance tests in query time in dependency of document sizes and tree variations.

  4. RDBMS 1. Introduction Awareness of tree structured data in the everyday IT world and combination with RDBMS. How can we achieve this ? Gain information independent of tree type ! >>

  5. a 7 5 7 6 4 1 5 3 4 2 6 2. Tree traversals & Mappings (part 1) Pre Post 0 Traversal direction c 1 b 2 0 3 e d g f h

  6. 8 a 7 c 6 b 5 e post 4 g 3 h 2 f 1 d 0 0 1 2 3 4 5 6 7 8 pre 2. Tree traversals & Mappings (part 1)

  7. 8 a 7 c 6 b 5 e post 4 g 3 h 2 f 1 d 0 0 1 2 3 4 5 6 7 8 pre 3.1 XPath Major Axes a b c d e f g h Context node

  8. e/descendant::* 8 a a 7 c 6 b c b 5 e d e post 4 g 3 f g h 2 f h 1 d 0 0 1 2 3 4 5 6 7 8 pre

  9. e/preceding::* 8 a a 7 c b c 6 b 5 e d e post 4 g f g 3 h 2 f h 1 d 0 0 1 2 3 4 5 6 7 8 pre

  10. e/ancestor::* 8 a a 7 c b c 6 b 5 e d e post 4 g f g 3 h 2 f h 1 d 0 0 1 2 3 4 5 6 7 8 pre

  11. e/following::* 8 a a 7 c b c 6 b 5 e d e post 4 g f g 3 h 2 f h 1 d 0 0 1 2 3 4 5 6 7 8 pre

  12. 4. Axes and Range Queries We have now successfully transformed recursive queries into range queries. To support all XPath Axes though we need a little more information. - child / parent , following / preceding siblings „par(v)“ value characterises these axes too - attribute is distinguished by a att(v) Boolean - tag(v) holds the node or attribute name The result is a 5-Dim descriptor but giving us a 5-dimensional region: descr(v) = (pre(v),post(v),par(v),att(v),tag(v))

  13. 4. Axes and Query windows Now instead of discrete pre/post values we define intervals [..) , (..].. (..) ....

  14. 4. Representation in SQL Specify SQL relational scheme with descriptor. 5-column Table accel Pre value can be considered as primary key Query(e /α) = SELECT v’.* FROM Query(e) v , accel v’ WHERE v’ INSIDE window(α,v) Idea of rectangular region query windows in pre /post plane. Optimised support by R- and B-Trees. To be continued..

  15. 4. Representation in SQL Creating conventional SQL Queries from XPath expressions: Ex.: /descendant::n1/preceding-sibling::n2 We get SELECT v2.* FROM accel v1, accel v2 WHERE 0 < v1.pre AND v1.tag = n1 AND v2.pre < v1.pre AND v2.post < v1.post AND v2.par = v1.par AND v2.tag = n2

  16. 3 4 e g 4 1 5 3 f Level 2 h 2 6 Level 3 Level 4 5. Shrink wrapping the // axis Knowledge taken from specific properties of pre/post ranks to shrink window size(e) = level(e)-pre(e) + post(e) (1) 3 =2- 3 + 4 For the right most leaf of the sub tree we can say size(e) = pre(h) - pre(e) (2) 3 = 6- 3

  17. 3 4 e g 4 1 5 3 f Level 2 h 2 6 Level 3 Level 4 5. Shrink wrapping the // axis From equation(2)formed to pre(h) = pre(e) + size(e) and replacing size(e) with (1) leads to pre (h) = post(e) + level(e) For a useful estimation we can also for sure say that: Level(e) ≤ height(t) Using height(t) instead of level(e): Node h has max pre-order and node f has min post order rank pre(h) ≤ post(e) +height(t) post(f)≥ pre(e) – height(t) The value height(t) of a document tree is assigned at document loading time.

  18. 5. Shrink wrapping the // axis Attribute and leaf „l“ access Knowledge of pre(l) and post(l) differing by height: post = pre – height(t) We are left with a shrunk-wrapped region that minimizes query time considerably. With a B-tree based XPath accelerator on top of a IBM DB2 and an XML instance of 1.1 MB (21051 nodes) we get

  19. 6. Tree Mapping (part 2) Independent pre/post scans result to possible results but also yield false hits. False pre scan hits False post scan hits

  20. a 6. Tree Mapping (part 2) Use a different type of pre post assignment to avoid false pre post scans Called stretching 15 0 c 1 b 12 13 14 2 3 4 11 e d g f 6 7 10 5 h 9 8

  21. 6. Tree Mapping (part 2) 16 c a 14 b Ø 12 e post(e) 10 g h post 8 Ø f Ø 6 pre(e) 4 d Ø 2 0 0 2 4 6 8 10 12 14 pre pre(e) post(e)

  22. 6. Tree Mapping (part 2) • Advantages and drawbacks of stretching: • - avoids incorrect pre post scans by stretched mappings a seen in previous slide • all axis query windows work as before • pre and post of a context node are still unique • estimation of subtree size is accurate : size(v) = ½ (post(v) - pre(v) –1) • relationships are still maintained due to relationships and not absolute values. • Drawback: The pre and post values are not dense.

  23. 7. Benchmarking Accel – Schema against Edge Mapping Measurements performed on: Intel i586 ~ 1 GHz CPU, 2.4 Linux Kernel, ext2 Filesystem, EIDE hard disk, 256 MB RAM No other processes active

More Related