An Algebraic Approach For Incremental Maintenance of Materialized XQuery Views - PowerPoint PPT Presentation

About This Presentation
Title:

An Algebraic Approach For Incremental Maintenance of Materialized XQuery Views

Description:

An Algebraic Approach For Incremental Maintenance of Materialized XQuery Views – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 27
Provided by: defau635
Learn more at: https://davis.wpi.edu
Category:

less

Transcript and Presenter's Notes

Title: An Algebraic Approach For Incremental Maintenance of Materialized XQuery Views


1
An Algebraic Approach For Incremental Maintenance
of Materialized XQuery Views
  • Maged EL-Sayed, Ling Wang, Luping Ding, and Elke
    A. Rundensteiner
  • DSRG Lab, Computer Science Dept.
  • Worcester Polytechnic Institute

2
Materialized Views
  • Why Views?
  • Data warehouses
  • Information Integration
  • Information Inter-portability
  • Why Materialized?
  • Speeding up data retrieval
  • Query optimization
  • Focus on materialized views built using XQuery

View
Query
RDB
XML
other Sources
3
Updating Materialized Views
  • Updates to sources are common
  • Views need to be maintained to be consistent with
    sources.
  • How to update views
  • Re-computation
  • Incremental update

4
Related Work
  • Relational Model GM95, ZGMHW95, AASY98,
    ZR00, KR02
  • Data updates, schema changes, relevant updates,
    algebraic-based propagation, concurrent updates,
    extended SQL, batch updates.
  • XML model ARGOS QCR01
  • XQL, local cash indexes, relevant updates
  • Semi-structured data AMRVW98
  • Lorel query language

5
Goal
  • Efficient update propagation for updates on XML
    views
  • To handle different updates type
  • Element insert, delete, and change
  • Attribute insert, delete, and change
  • To handle any XML view defined by XQuery

6
Our Approach XPROP
  • Uses XAT algebra Rainbow
  • Uses update primitives to update XML
  • Algebraic-rules for updates
  • For each algebraic update
  • For each update primitive
  • Propagate only relevant updates

XML View
Update
Algebra Tree
XQuery Definition
XML Source
XML Source
XML Source
Update
7
Background XML Algebra
  • XAT Algebraic Operators Rainbow
  • XML Operators ex. Navigate
  • SQL Operators ex. Select
  • Special Operators ex. Function
  • XAT Data Model Rainbow
  • XAT table can hold
  • Atomic values
  • Elements/attributes
  • Collection of elements

b s
ltentrygte1lt/entrygt ltreviewsgtrlt/reviewsgt
ltentrygte2lt/entrygt ltreviewsgtrlt/reviewsgt
ltentrygte3lt/entrygt ltreviewsgtrlt/reviewsgt
? s2, entry b
s2
ltreviewsgtrlt/reviewsgt
S reviews.xml s2
8
Example
ltbibgt ltbook year"1992"gt
lttitlegtAdvanced Programming in the Unix
environmentlt/titlegt ltauthorgtDarcy
Gerbarglt/authorgt ltpublishergtAddison-Wesl
eylt/publishergt lt/bookgt ltbook
year"2000"gt lttitlegtData on the
Weblt/titlegt ltauthorgtSerge
Abiteboullt/authorgt ltpublishergtMorgan
Kaufmann Publisherslt/publishergt lt/bookgt
ltbook year"1994"gt lttitlegtTCP/IP
Illustratedlt/titlegt ltauthorgtW.
Stevenslt/authorgt ltpublishergtAddison-Wesl
eylt/publishergt lt/bookgt lt/bibgt
ltreviewsgt ltentrygt lttitlegtData on the
Weblt/titlegt ltreviewgt A very good
discussion of semi-structured database
systems and XMLlt/reviewgt lt/entrygt
ltentrygt lttitlegtAdvanced Programming in
the Unix environmentlt/titlegt ltreviewgtA
clear and detailed discussion of UNIX
programminglt/reviewgt lt/entrygt
ltentrygt lttitlegtTCP/IP
Illustratedlt/titlegt ltreviewgtOne of the
best books on TCP/IPlt/reviewgt
lt/entrygt lt/reviewsgt
reviews.xml
bib.xml
9
XQuery Example
  • Retrieve book title for all books published by
    Morgan Kaufmann Publishers and their respective
    reviews

ltResultgt FOR a IN document("bib.xml")/book,
b IN document("reviews.xml")/entry
WHERE a/title b/title and
a/publisher "Morgan
Kaufmann Publishers" RETURN
ltBook_Reviewgt a/title, b/review
lt/Book_Reviewgt lt/Resultgt
ltResultgt ltBook_Reviewgt lttitlegtData on the
Weblt/titlegt ltreviewgt A very good discussion
of semi-structured database
systems and XML lt/reviewgt lt/Book_Reviewgt lt/Res
ultgt
Materialized View
View Definition
10
From XQuery to Algebra Tree
TltResultgtcol13lt/ Result gt col14
Agg col13
  • Operators
  • S Source
  • Navigate
  • J Join
  • T Tagger
  • Agg aggregate

TltBook_Reviewgtcol11col12lt/Book_Reviewgt col13
J ((col11 col5) AND (col7 "Morgan
Kaufmann Publishers")) col1, col12
?b, title col5
?a, publisher col7
?b, review col12
?a, title col11
? s1, book a
?s2, entry b
S bib.xml s1
S reviews.xml s2
11
Sample XAT Execution
col5 col12
lttitlegtt1lt/titlegt ltreviewgtr1lt/reviewgt
lttitlegtt2lt/titlegt ltreviewgtr2lt/reviewgt
lttitlegtt3lt/titlegt ltreviewgtr3lt/reviewgt
ltreviewsgt ltentrygt lttitlegtData on the
Weblt/titlegt ltreviewgt A very good
discussion of semi-structured database
systems and XMLlt/reviewgt lt/entrygt
ltentrygt lttitlegtAdvanced Programming in
the Unix environmentlt/titlegt ltreviewgtA
clear and detailed discussion of UNIX
programminglt/reviewgt lt/entrygt
ltentrygt lttitlegtTCP/IP
Illustratedlt/titlegt ltreviewgtOne of the
best books on TCP/IPlt/reviewgt
lt/entrygt lt/reviewsgt
?b, title col5
col12 b
ltreviewgtr1lt/reviewgt ltentrygte1lt/entrygt
ltreviewgtr2lt/reviewgt ltentrygte2lt/entrygt
ltreviewgtr3lt/reviewgt ltentrygte3lt/entrygt
?b, review col12
b
ltentrygte1lt/entrygt
ltentrygte2lt/entrygt
ltentrygte3lt/entrygt
? s2, entry b
s2
ltreviewsgtrlt/reviewsgt
reviews.xml
S reviews.xml s2
12
XPROP Update Primitives
  • XML Update primitives (xmlup) applies to XML
    documents
  • AddAtt(att, valu, pos)
  • DeleteAtt(pos)
  • ChangeAtt(valu, pos)
  • AddEle(el, pos)
  • DeleteEle(pos)
  • ChangeEle(el, pos)
  • XAT Update primitives (xatup) applies to XAT
    tables
  • InsertTuple (tup, ord)
  • DeleteTuple (id)
  • ChangeTuple (xmlup, ucol, id)

13
Update Propagation in XAT Table
  • XAT Update Primitives
  • InsertTuple (tup, ord)
  • DeleteTuple (id)
  • ChangeTuple (xmlup, ucol, id)
  • Example
  • ChangeTuple (DeleteEle(Author2book), col1, 2)

Xmlup ucol id
pos
col1 P ID
ltBookgtb1lt/Bookgt 1 1
ltBookgt ltAuthorgt.. lt/Authorgt ltAuthorgt.. lt/Authorgt lt/Bookgt 1 2
14
XPROP Update Primitives
XML View
XAT
XQuery Definition
XML Source
XML Source
XML Source
15
Update Propagation Example
  • Change publisher element of first book element
    to "Morgan Kaufmann Publishers"

ltResultgt ltBook_Reviewgt lttitlegtAdvanced
Programming in the Unix environmentlt/titlegt
ltreviewgtA clear and detailed discussion of UNIX
programminglt/reviewgt lt/Book_Reviewgt
ltBook_Reviewgt lttitlegtData on the Weblt/titlegt
ltreviewgt A very good discussion of
semi-structured database systems and
XMLlt/reviewgt lt/Book_Reviewgt lt/Resultgt
Effect on View
XAT
Update to the source
ChangeEle(ltpublishergtMorgan Kaufmann
Publisherslt/publishergt, book1.publisher1
bib)
bib.xml
reviews.xml
16
Update Propagation in XAT (I)
?b, title col5
?a, publisher col7
col11 a P ID
lttitlegtt1lt/titlegt ltbookgtb1lt/bookgt 1 1
lttitlegtt2lt/titlegt ltbookgtb2lt/bookgt 2 2
lttitlegtt3lt/titlegt ltbookgtb3 lt/bookgt 3 3
col12 b P ID
ltreviewgtr1lt/reviewgt ltentrygte1lt/entrygt 1 1
ltreviewgtr2lt/reviewgt ltentrygte2lt/entrygt 2 2
ltreviewgtr3lt/reviewgt ltentrygte3lt/entrygt 3 3
?a, title col11
?b, review col12
a P ID
ltbookgtb1lt/bookgt 1 1
ltbookgtb2lt/bookgt 1 2
ltbookgtb2lt/bookgt 1 3
b P ID
ltentrygte1lt/entrygt 1 1
ltentrygte2lt/entrygt 1 2
ltentrygte3lt/entrygt 1 3
? s1, book a
? s2, entry b
s2 ID
ltreviewsgtrlt/reviewsgt 1
s1 ID
ltbibgtblt/bibgt 1
S bib.xml s1
S reviews.xml s2
bib.xml
reviews.xml
17
Update Propagation in XAT (II)
Agg col13
col13 P ID
ltBook_Reviewgt lttitlegtt1lt/titlegt ltreviewgtr2lt/reviewgt ltBook_Reviewgt 2 2
ltBook_Reviewgt lttitlegtt2lt/titlegt ltreviewgtr1lt/reviewgt ltBook_Reviewgt 1 1
7
InsertTuple(2 ,2, ltBook_Reviewgt
lttitlegtt1lt/titlegt ltreviewgtr2lt/reviewgt
lt/Book_Reviewgt, 1)
TltBook_Reviewgtcol11col12lt/Book_Reviewgt col13
col12 col11 P ID
ltreviewgtr2lt/ review gt lttitlegtt1lt/titlegt 1 2 2
ltreviewgtr1lt/ review gt lttitlegtt2lt/titlegt 2 1 1
6
InsertTuple(2 ,1, 2, lttitlegtt1lt/titlegt,
ltreviewgtt2lt/ review gt, 1)
J ((col11 col5) AND col7 ("Morgan
Kaufmann Publishers")) col1, col12
5
col7 col11 P ID
ltpublishergtp1lt/publishergt lttitlegtt1lt/titlegt 1 1
ltpublishergtp2lt/publishergt lttitlegtt2lt/titlegt 2 2
ltpublishergtp3lt/publishergt lttitlegtt3lt/titlegt 3 3
col5 col12 P ID
lttitlegtt1lt/titlegt ltreviewgtr1lt/reviewgt 1 1
lttitlegtt2lt/titlegt ltreviewgtr2lt/reviewgt 2 2
lttitlegtt3lt/titlegt ltreviewgtr3lt/reviewgt 3 3
ChangeTuple( ChangeEle (ltpublishergt Morgan
Kaufmann Publishers lt/publishergt ,publisher),
col7, 1)
?b, title col5
?a, publisher col7
18
Update Propagation in XAT (III)
10
XML View
AddtEle (ltResultgtltBook_Reviewgt.. lt/Book_Reviewgt
ltResultgt, 1 Result)
col14 P ID
ltResultgt ltBook_Reviewgt lttitlegtt2 lt/titlegt ltreviewgtr1lt/reviewgt ltBook_Reviewgt lt/Resultgt 1 1
9
ltBook_Reviewgt lttitlegtt1lt/titlegt
ltreviewgtr2lt/reviewgt ltBook_Reviewgt
ChangeTuple(AddtEle (ltResultgt ltBook_Reviewgt..
lt/Book_Reviewgt ltResultgt, 1 Result), col14,
1)
TltResultgtcol13lt/ Result gt col14
col13 P ID
ltBook_Reviewgt lttitlegtt2lt/titlegt ltreviewgtr1lt/reviewgt ltBook_Reviewgt 2, 1 1
8
ltBook_Reviewgt lttitlegtt1lt/titlegt
ltreviewgtr2lt/reviewgt ltBook_Reviewgt
ChangeTuple(AddtEle( ltBook_Reviewgt
lttitlegtt1lt/titlegt ltreviewgtr2lt/revi
ewgt lt/Book_Reviewgt, 1), col13, 1)
Agg col13
19
System Architecture
XML View
Legend
RAINBOW
System Module Storage Data
XPROP
Propagation Rules
XAT
Maintainer .
Intermediate Materialization
Update Handle
XML Query Manager
XML Source
XML Source
XML Source
Update
Our system is built as an extension to the
Rainbow system developed at WPI
20
Experimental Result
21
Summery
  • One of the first algebraic incremental view
    maintenance approaches for XML
  • Proposed a set of update primitive for updating
    XML documents
  • Handle general updates on XML
  • Proposed propagation rules to handle updates
    incrementally

22
Future Work
  • Use references in XAT tables
  • Batch updates
  • XAT tree rewrite
  • Extensive Experiments

23
  • Rainbow Project
  • http//davis.wpi.edu/dsrg/rainbow/index.html
  • XPROP Extension
  • http//davis.wpi.edu/dsrg/xprop/index.html

24
Extension to XAT Table
  • We need extra information
  • Tuple ID (ID)
  • Tuple parent ID (P)

col2 col1 P ID
ltAuthorgta1lt/ Author gt ltBookgtb1lt/Bookgt 1 1
ltAuthorgta2lt/ Author gt ltBookgtb1lt/Bookgt 1 2
ltAuthorgta3lt/ Author gt ltBookgtb2lt/Bookgt 2 3
?cols, Author col2
col1 P ID
ltBookgtb1lt/Bookgt 1 1
ltBookgtb1lt/Bookgt 1 2
? s1, book col1
s1 ID
ltbibgtblt/bibgt 1
S bib.xml s1
bib.xml
25
Update Position
  • Update Position (pos) Niagara
  • Entry point part (EP)
  • Relative forward part (RF)
  • Example book2.author1 bib
  • EP can be
  • element name ex. book2.author1 bib
  • XML fragment order ex. author2 1
  • Null ex. Null Null
  • RF can be
  • set of elements/attributes with order ex.
    book2.author1 bib
  • Null ex. Null Book

26
Update Position and XAT
Update position
Data type in XAT
Example
col1
55
Atomic Value
Null Null
col1
ltBookgt ltAuthorgt ltLastgt ltLastgt ltAuthorgt ltBookgt
Author1.last1 Book
Element/attribute
col1
ltAuthorgt ltLastgt ltLastgt ltAuthorgt ltAuthorgt ltLastgt ltLastgt ltAuthorgt
Collection
last1 2
Write a Comment
User Comments (0)
About PowerShow.com