160 likes | 258 Views
Navigation-Driven Evaluation of Virtual Mediated Views. Bertram Ludäscher, SDSC/UCSD Yannis Papakonstantinou, UCSD Pavel Velikhov, UCSD. Integrated Virtual XML View. XMAS View Definition. Querying Virtual Documents. Client Query. MIX m Mediator. Virtual XML View. Virtual XML View.
E N D
Navigation-Driven Evaluation of Virtual Mediated Views Bertram Ludäscher, SDSC/UCSD Yannis Papakonstantinou, UCSD Pavel Velikhov, UCSD
Integrated Virtual XML View XMAS View Definition Querying Virtual Documents Client Query MIXm Mediator Virtual XML View Virtual XML View Virtual XML View Wrapper Wrapper Data Source XML Data Source Data Source
Navigating Virtual Views answer book author Ullman title DB Systems dblp-pubs publication ... publication dblp … author name Ullman pubs publication … publication … db-books@amazon book author Ullman title DB Systems book author …
Navigation Driven Evaluation client navigation commands view definition q( s1 … sn ) result Lazy Mediator source navigation commands s1 sn ... XML source XML source
Modeling Navigations • Navigational commands (subset of DOM): • d (down) • r (right) • f (fetch) p0 d Navigation: c = c1(p0), c2(p1), …, cn(pn-1) where pj = ci(pi-1), i < j p1 d r r r p4 f d d
Query Processing XMAS Query XMAS View Definition Translator Algebraic Plan for the View Algebraic Plan for the Query Composition (qov) Composed Algebraic Plan Rewriter/Optimizer Optimized Plan Optimized Plan Execution
Algebra Example createElement”book”,$List->$Res • concat$A1,$T,$P->$List Value($A1)=Value($A2) getChildren$book,”title”->$T getChildren$auth,”pubs”->$P getChildren$book,”author”->$A1 getChildren$auth,”name”->$A2 getChildrensource,”book”->$book getChildrensource,”author”->$auth
Lazy Mediator Example answer book author Peter XML for … pubs … book book author … Mary All about … pubs Value($A1)=Value($A2) BOOKS $A1 $T Peter XML for smarties Mary All about XML … … DBLP $A2 $P Peter <pubs>…</pubs> Mary <pubs>…</pubs> … …
Efficiency of Lazy Mediators Natural measure: client vs. source navigations navigations • Bounded Browsable: fixed # of source navigations • Browsable: does not require accessing all elements of lists • Unbrowsable: requires accessing lists in entirety materialize Browsable Unbrowsable
Related Work • Pipelined evaluation • Optimizing for first results • Nested Relational Algebras
Further Issues • Granularity of navigation • Optimization wrt navigational complexity • Dealing with order • Quantitative cost model
XMAS Algebra • XMAS algebra contains all familiar relational • operators plus some XML specific ones: • createElementname,ch->e • getChildrene->ch • getNamee->name • groupByg1…gk,v->l • orderByx1…xk • concatenatex,y->z • assign->x • applyf->x • tc : t -> [<source: t > ] • td : [<result: t > ] -> t
Translating result NCs into source NCs root root ... ... tuple tuple tuple tuple t1 tname tch tn t1 tname tch tn te cm c1 ... cm c1 cm c1 ... ... root tuple f/d(tuple)rnamef t0 tn te ... d/d(tuple)rchd identity
Navigational Complexity of Plans Complexity Operators Bounded createElement, getName, concat, Browsable getChildren, groupBy, , , Unbrowsable \, orderBy
Optimizing wrt. Navigational Complexity A class of unbrowsable queries: construct <my_books> <book> $B, $P, $A </book> {$B,$P,$A} </my_books> where pattern($A,$B,$ID1) in S1 and pattern($P,$ID2) in S2 and $ID1 = $ID2 orderByB,P,A N1=N2 pattern($P,$ID2) pattern($A,$B,$ID1)
Optimizing wrt. Navigational Complexity orderByB,P,A ID1=ID2 pattern($A,$B,$ID1) pattern($P,$ID2) ID1=ID2 A1=A B=B1 orderByB pattern($A1,$B,$ID1) pattern($P,$ID2) pattern($A,$B1,$ID1)