1 / 27

VOX O rder-sensitive V iew Maintenance of Materialized X Query Views

VOX O rder-sensitive V iew Maintenance of Materialized X Query Views. ER 2003 October 14 th 2003 Katica Dimitrova*, Maged El-Sayed and Elke Rundensteiner Worcester Polytechnic Institute *Now at Microsoft. Views in general Information integration Access control, privacy, ..etc

rea
Télécharger la présentation

VOX O rder-sensitive V iew Maintenance of Materialized X Query Views

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. VOXOrder-sensitive View Maintenance of Materialized XQuery Views ER 2003 October 14th 2003 Katica Dimitrova*, Maged El-Sayed and Elke Rundensteiner Worcester Polytechnic Institute *Now at Microsoft

  2. Views in general Information integration Access control, privacy, ..etc Data warehouses XML Views (EXTRA useful) Information inter-portability Crossing gaps between different data models Materialized Views Fast access over complex views Increased availability Query optimization Motivation View View Definition Query RDB XML Other Sources

  3. Maintaining Materialized Views Methods of view maintenance • Recomputation • recompute view from scratch from base data When sources are updated, materialized view may become inconsistent. View View update View Definition Query • Incremental view maintenance • compute changes to view in response to changes to base sources Source 1 Source 2 Sources 3..n Incremental view maintenance is usually cheaper than full recomputation. update

  4. Goal • Incrementally maintaining XQuery views • Why is it a challenge? • XML features • Hierarchical • Optional elements • Self-typed • IDRefs • Ordered • Expressiveness of XQuery language • Complex operations: tagging, unnesting, aggregation, .. • Expected large auxiliary information View View Definition XQuery XML Source XML Source XML Source

  5. Basics of VOX Approach: Algebraic General approaches to view maintenance • Algorithmic – Fixed procedure exists for fixed view type • Algebraic - Update propagation rules for each algebra operator and each update type XML View D2 Update D2 Update Algebra Tree Operator Operator XQuery Definition D1 D1 Update Execution View Maintenance XML Source XML Source XML Source time Update

  6. <result> <cheap_book> <title>Data on the Web</title> </cheap_book> </result> View Extent <result> for $b in document("bib.xml")/bib/book where $b/price/text() < 60 return <cheap_book> $b/title </cheap_book> </result> View Definition Query Example <bib> <book> <price> 65.95 </price> <title> Advanced Programming in the Unix environment </title> </book> <book> <title> TCP/IP Illustrated </title> </book> <book> <price>39.95</price> <title> Data on the Web </title> </book> </bib> <cheap_book> <title>TCP/IP Illustrated</title> </cheap_book> <price>55.48</price> Bib.xml Bib.xml List all books that cost less than $60 Insert element <price>55.48</price> into second book

  7. Background on XML Algebra XAT • XQuery XAT algebra tree [ZR02] • XAT Operators: • XAT SQL Operators: Select, Project … • XAT XML Operators: Navigate Unnest, Navigate Collection, Tagger, Combine .. view $col1 T <result>$col2</ result >$col1 C $col2 T<cheap_book>$col3</cheap_book>$col2 <result> for $b in document("bib.xml")/bib/book where $b/price/text() < 60 return <cheap_book> $b/title </cheap_book> </result> ($col5 < 60.0) $b, price/text()$col5 $b, title$col3 $s6, /book $b S “bib.xml”$s6 bib.xml

  8. Background on XML Algebra XAT – Data Model • XAT Data Model (XAT Table) • Order sensitive table of tuples • Columns denote user-specified or internally generated variable bindings • A cell in a tuple holds an XML node for a sequence of XML nodes • The XAT algebra has ordered bag semantics view Input Output $col1 T <result>$col2</ result >$col1 C $col2 T<cheap_book>$col3</cheap_book> $col2 $b, price/text()$col5 ($col5 < 60.0) $b, price/text()$col5 $b, title$col3 $s6, /book $b S “bib.xml”$s6 bib.xml

  9. Order in XAT Context: View Maintenance Non Order-sensitive Order-sensitive ($col5 < 60.0) ($col5 < 60.0) 55.48 55.48

  10. Our Approach to Maintaining Order • Use node identity • Why? • Already present as concept in XQuery • Can be reference to base XML data set • Can encode structure and order

  11. Multi-level lexicographical keys Comparison b.h < b.t bab < bd.cc b.b < b.b.c Advantages It is always possible to generate a key between two keys The deletion of a LexKey in a sequence does not affect other LexKeys Lexicographical Keys: LexKeys b bib b.h b.t book book b.n book b.t.r b.n.f title b.h.k price price b.t.k b.h.r price title b.n.m title

  12. LexKeys - References to source XML nodes Storage Manager bib.xml b bib b.h b.t book book b.n $b, title$col3 book $b, title$col3 b.t.r b.h.k title price b.t.k b.h.r price title b.n.m title

  13. LexKeys - References to constructed nodes Storage Manager view Constructed Nodes $col1 LexKey Skeleton T <result>$col2</ result >$col1 cheap_book y.b C $col2 b.t.r T<cheap_book>$col3</cheap_book>$col2 T<cheap_book>$col3</cheap_book>$col2 cheap_book y.c ($col5 < 60.0) b.n.m $b, price/text()$col5 bib.xml $b, title$col3 b bib b.h b.t $s6, /book $b book book b.n S “bib.xml”$s6 book b.t.r bib.xml title

  14. Order Among XAT Tuples 1 Notion: designate order schema to XAT tables • Ordering by LexKeys in columns in order schema yields correct tuple order. • Comparison operation ‘<’ on tuples. $b, title$col3 1 1 2 3 b.h < b.n < b.t

  15. Order Schema Computation • Calculated in a postorder traversal of the tree • Schema Computation Rules

  16. Order Among Nodes in a Cell • Most collections of XML nodes are in document order • Navigate Collection, XML Union, … • Concept of overriding order • Combine creates a collection in which nodes may be in order different then one encoded in node identity LexKey with overriding order Node identity part, by default also represents order Optional, only represents order when present • Notation: key [order] • Examples • b.c.b [h] • b.c.b

  17. XML algebra now has (non-ordered) bag semantics Gained distributiveness with regard to bag union and difference Compact intermediate results The Impact of Using LexKeys on View Maintenance ($col5 < 60.0) b.n.f.m

  18. Update iup k Update Propagation Strategy XML View XAT Update XQuery XML Source XML Source XML Source Rainbow Storage Manager

  19. Use distributiveness with regard to bag union Reuse rules from relational view maintenance for XAT SQL operators Provide rules for XAT XML operators Q Update to Q Operator Operator R Update to R Execution View Maintenance time Update Propagation Rules

  20. Update Propagation Rules Example - Navigate Unnest on Insertion of Tuples Qold =  $col,path$col’ (Rold) Rnew=Rold + R Qnew =  $col,path$col’ (Rold + R) = =  $col,path$col’ (Rold) +  $col,path$col’ (R) = = Qold + Q + represents bag union Q u (Q)  $col,path$col’  $col,path$col’ R u (R) Execution View Maintenance time Propagate u(Q)

  21. cheap_book y.c b.n.m view View Maintenance Example Insert element <price>55.48</price> into second book u (+y.c[b.n], result[1]/$col2 x, $col1, 1) $col1 Rainbow T <result>$col2</ result >$col1 u (c, $col2, 1) | c = y.c[b.n] Constructed XDOMs C $col2 LexKey Skeleton u (s) | s = (b.n, y.c ) result x y.b[b.t] y.c[b.n] T<cheap_book>$col3</cheap_book>$col2 cheap_book y.b u (s) | s = (b.n, b.n.m) b.t.r ($col5 < 60.0) u (c, $col5, 2) | c= b.n.f.m $b, price/text()$col5 b b.h bib bib.xml b.t u (+b.n.f, price[b.n.f] b.n, $b, 2) book b.n book $b, title$col3 b.t.r book b.h.k b.n.m u (+b.n.f, price[b.n.f] b.n, $b, 2) price title b.n.f b.t.k b.h.k.m title price $s6, /book $b price 65.95 b.n.f.m b.h.r u (+b.n.f, book[b.n]/price[b.n.f] b, $s6, 1) b.t.k.m 55.48 title 39.95 Storage Manager +b.n.f, book[b.n]/price[b.n.f] b S “bib.xml”$s6

  22. view $col1 $col1 x T <result>$col2</ result >$col1 . . . . cheap_book y.c b.n.m S “bib.xml”$s6 View Maintenance Example Insert element <price>55.48</price> into second book Rainbow Constructed XDOMs LexKey Skeleton result result x y.b[b.t] y.c[b.n] y.b[b.t] cheap_book cheap_book y.c[b.n] cheap_book title y.b b.n.m title b.t.r TCP/IP Illustrated Data on the Web b b.h bib bib.xml b.t book b.n book b.t.r book b.h.k b.n.m price title b.n.f b.t.k b.h.k.m title price price 65.95 b.n.f.m b.h.r b.t.k.m 55.48 title 39.95 Storage Manager

  23. Experimental Evaluation • Implemented in Java on top of Rainbow system • Experimental evaluation Basic performance comparison Varying size of insert 637 elements of interest selectivity 50%

  24. Related work • Relational • [GMS93] Survey • [GL95] Algebraic approach to maintain relational views with duplicates • [BLT86], [CW91], [ZGHW95], [Q96], [MK00], [PSCP02]… • Object-Oriented • [KR96] MultiView. Object algebra, exploit OO features like inheritance, path indexes. • [AFP02] Algebraic approach. Store OID-s rather then actual data. • XML-like data models • [ZM98] Select-Project graph structured views as collections of objects. • [AMRVW98] Semistructured data model OEM, query language LOREL. Only atomic updates. Does not handle order. • [QLR02] Dynamic web data. Based on XPath. Maintains path index structure. • [LD00] Hierarchical semistructured data. View defined with WHAX-QL. Does not handle order. • [EWDR02] – Motivation for this work. Algebraic approach. Does not handle order. Large intermediate results.

  25. Conclusions • Proposed order-encoding scheme that migrates XML algebra from ordered to non-ordered bag semantics • Gave first solution to order-sensitive XQuery view maintenance • Handles core of XQuery • Handles complex updates • Proved correctness of approach • Implemented the solution within Rainbow • Experimental evaluation confirms feasibility of solution

  26. For more information • The Rainbow project http://davis.wpi.edu/dsrg/rainbow/ • Related publications • K. Dimitrova, M. El-Sayed  and E. Rundensteiner.  Order-sensitive View Maintenance of Materialized XQuery Views. Technical Report WPI-CS-TR-03-17, May 2003. • M. El-Sayed, K. Dimitrova, E. Rundensteiner, Efficiently Supporting Order in XML Query Processing, WIDM'03, New Orleans, Nov.2003. • X. Zhang, K. Dimitrova, L. Wang, B. Pielech, L. Ding, B. Murphy, M. El-Sayed and E. Rundensteiner. RainbowII: Multi-XQuery Optimization Using Materialized XML Views. SIGMOD DEMO, Jun. 2003. • M. Sayed, L. Wang, L. Ding and E. Rundensteiner. An Algebraic Approach for Incremental Maintenance of Materialized XQuery Views. In Proceedings of WIDM02, page88, 2002.(.ps) • X. Zhang, B. Pielech and E. Rundensteiner. Honey, I Shrunk the Xquery!- An XML Algebra Optimization Approach. In Proceedings of WIDM02, 2002. • X. Zhang, M. Mulchandani, S. Christ, B. Murphy and E. Rundensteiner. Rainbow: Mapping-Driven XQuery Processing System. Proceeding of SIGMOD02, In Demo Session, page 614, 2002.

  27. Thank you !

More Related