Download ppt

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Updating XQuery Views
Published over Relational Data
Ling Wang
Advisor: Elke A. Rundensteiner
Co-Advisor: Kathi Fisler
1
Outline
Motivation
• Related Work
• Background:
XML, XML Views, XQuery Update Extension
• Problem Definition:
- Characterize the XML View Update Problem (XVUP)
- Correct Translatability
- Classify subproblems: RUP, PUP
• Update Strategy for PUP
•
•
•
•
Rainfall System
Experimental Study
Contributions
Conclusion
2
Motivation
• XML is a standard for exchanging data between web applications
• But RDBMS is mature data management technology:
- Reliable persistent storage technique
- Mature query optimization technique
• XML Management Systems using Relational technology
- SilkRoute (AT&T), XPERANTO (IBM), RAINBOW (WPI)
- Features:
# provide reliable persistent storage
# support XML view mechanism for XML data publishing
# support queries over XML views
• Systems must support update to become viable system
3
XML View Update
• View update problem in Relational databases is hard
- What is a correct translation?
- How to eliminate ambiguity in translation?
• XML view update offers new challenges
- Mappings:
Data model mapping: XML vs. Relational
Query language mapping: XQuery vs. SQL
- Consistency :
Constraints in different schemas such as
XML schema, Relational schema,
XML view schema
XQuery update
XML View
View Query
Default View
SQL Update
RDBMS
eg: Schema reducing (IDREF), Schema increasing (Duplicate)
4
Related Work
1.
Umeshwar Dayal, Philip A. Bernstein, On the Updatability of
Relational Views, IEEE 1978.
First work, describe criteria of correct update translation.
2.
F Bancilhon and N. Spyratos, Update Semantics of Relational Views,
ACM Transactions on Database Systems, 1984
Complementary theory to eliminate ambiguous in update translation.
3.
A. M. Keller, Barsalou, Siambela and Wiederhold, Updating
Relational Databases through Object-Based Views, SIGMOD 1991
View update problem in Object-base views.
4.
Tatarinov Ives, Alon Halevy and Daniel Weld, Updating XML,
SIGMOD 2001
XQuery update extension, XML view update performance
5
Where we are
Motivation
Related Work
 Background:
XML Views, XQuery Update Extension
• Problem Definition:
- Characterize the XML View Update Problem (XVUP)
- Correct Translatability
- Classify subproblems: RUP, PUP
• Update Strategy for PUP
•
•
•
•
Rainfall System
Experimental Study
Contributions
Conclusion
6
XML Schema
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema“ elementFormDefault="qualified">
<xs:elementname="bib">
<xs:complexType>
<xs:sequence>
<xs:elementname="book" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:elementname="bookid" type="xs:string" nillable="false"/>
<xs:elementname="title" type="xs:string" nillable="false"/>
<xs:elementname="author">
<xs:complexType>
<xs:sequence>
<xs:elementname="aname" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
……
</xs:complexType>
</xs:element>
</xs:schema>
7
XML document
Bib.xml
<bib>
<book year="1994">
<bookid>98001</bookid>
<title>TCP/IP Illustrated</title>
<author>
<aname>W. Stevens</aname>
</author>
<publisher>
<pname>Addison-Wesley</pname>
<location>San Francisco</location>
</publisher>
<review>
One of the best books on TCP/IP.
</review>
</book>
<book year="1992">
<bookid>98002</bookid>
<title>Programming in Unix</title>
<author>
<aname>Bram Stoker</aname>
</author>
<publisher>
<pname>Addison-Wesley</pname>
<location>Boston</location>
</publisher>
<review>
A clear and detailed discussion of UNIX programming.
</review>
</book>
<book year="2000">
<bookid>98003</bookid>
<title>Data on the Web</title>
<author>
<aname>Serge Abiteboul</aname>
<aname>Peter Buneman</aname>
<aname>Dan Suciu</aname>
</author>
<publisher>
<pname>Morgan Kaufmann Publishers</pname>
<location>New York</location>
</publisher>
<review>
A very good discussion of semi-structured database
systems and XML.
</review>
</book>
</bib>
8
XQuery update
Example Database ( Inlining)
XML View
View Query
Default View
SQL Update
RDBMS
book
IID
PID
bookid
title
author_IID
year
1.0
0.0
98001
TCP/IP Illustrated
11.0
1994
2.0
0.0
98002
Programming in Unix
21.0
1992
3.0
0.0
98003
Data on the Web
31.0
2000
review
author
IID PID review
1.0
1.0
IID PID aname
One of the best books on
TCP/IP.
1.0
11.0 W.Stevens
2.0
21.0 Bram Stoker
1.0
31.0 Serge Abiteboul
2.0
31.0 Peter Buneman
3.0
31.0 Dan Suciu
2.0
2.0
A clear and detailed discussion of
UNIX programming.
3.0
3.0
A very good discussion of semistructured database systems and
XML.
publisher
IID pname
location
Legend:
1.0
Addison-Wesley
San Francisco
Primary Key
2.0
Addison-Wesley
Boston
Unique Key
3.0
Morgan Kaufman
publishers
New York
Non Key
9
XQuery update
Default View
XML View
View Query
Default View
SQL Update
RDBMS
- Bridging the gap between Relational database and XML data models
- Show database structure, 1:1 mapping
<publisher>
<DB>
</row>
<book>
<IID>1.0</IID>
<row>
<PID>1.0</PID>
<IID>1.0</IID>
<pname>Addison-Wesley</pname>
<PID>0.0</PID>
<location> SanFrancisco</location>
<bookid>98001</bookid>
<row>...
<title>TCP/IP Illustrated</title>
</publisher>
<author_IID>11.0</author_IID>
<review>
<year>1994</year>
<row>
</row>...
<IID>1.0</IID>
</book>
<PID>1.0</PID>
<author>
<review>
<row>
One of the best books on TCP/IP.
<IID>1.0</IID>
</review>
<PID>11.0</PID>
</row>...
<aname>W. Stevens</aname>
</review>
</row>...
</DB>
</author>
10
XQuery update
XML View
XML View
View Query
Default View
SQL Update
RDBMS
- Information hiding
- User specific data wrapping
View Query
<bib>
FOR $book in document("default.xml")/book/row
RETURN{
<book year=$book/year/text() bookid= $book/bookid/text()>
<title>$book/title/text()</title>,
<author>
FOR $aname in document("default.xml")/author/row
WHERE $book/author_IID = $aname/PID
RETURN{
<aname>$aname/aname/text()</aname>}
</author>
</book>
}
</bib>
Virtual XML View
<bib>
<book year="1994“ bookid=“98001”>
<title>TCP/IP Illustrated</title>
<author>
<aname>W. Stevens</aname>
</author>
</book>
<book year="1992“ bookid=“98002”>
<title>Programming in Unix</title>
<author>
<aname>Bram Stoker</aname>
</author>
</book>
<book year="2000“ bookid=“98003”>
<title>Data on the Web</title>
<author>
<aname>Serge Abiteboul</aname>
<aname>Peter Buneman</aname>
<aname>Dan Suciu</aname>
</author>
</book>
</bib>
11
XQuery update
XQuery Update Grammar
XML View
View Query
Default View
SQL Update
- XQuery does not support update operations
- Update extension for XQuery language proposed in [SIGMOD2001]
- FLWU Expression
RDBMS
FOR $binding1 IN Xpath-expr,…..
LET $binding := Xpath-expr,…
WHERE predicate1,…..
updateOp,……
Where updateOp is defined as :
UPDATE $binding {subOp {, subOp}* } and subOp is :
DELETE $child |
INSERT ( $bind [BEFORE | AFTER $child]
| new_attribute(name, value)
| new_ref(name, value)
| content [BEFORE | AFTER $child] ) |
REPLACE $child WITH ( new_attribute(name, value)
| new_ref(name, value)
| content ) |
FOR $sub_binding IN Xpath-subexpr,…..
WHERE predicate1,……….
updateOp.
12
XQuery update
Update XQuery example
XML View
View Query
Default View
SQL Update
RDBMS
Insert update
FOR $book IN document(“bib.xml")/book
LET $author:=$book/author
WHERE $book/title = “TCP/IP Illustrated”
UPDATE $author{
INSERT
<aname>"Peter Naughton "</aname>
}
Updated view
<bib>
<book year="1994“ bookid=“98001”>
<title>TCP/IP Illustrated</title>
<author>
<aname>W. Stevens</aname>
<aname>"Peter Naughton "</aname>
</author>
</book>
<book year="1992“ bookid=“98002”>
<title>Programming in Unix</title>
<author>
<aname>Bram Stoker</aname>
</author>
</book>
<book year="2000“ bookid=“98003”>
<title>Data on the Web</title>
<author>
<aname>Serge Abiteboul</aname>
<aname>Peter Buneman</aname>
<aname>Dan Suciu</aname>
</author>
</book>
</bib>
13
Where we are
Motivation
Related Work
 Background:
XML Views, XQuery Update Extension
 Problem Definition:
- Characterize the XML View Update Problem (XVUP)
- Correct Translatability
- Classify subproblems: RUP, PUP
• Update Strategy for PUP
•
•
•
•
Rainfall System
Experimental Study
Contributions
Conclusion
14
General Characterization of XVUP
Instance
Information
Acyclic Dependency / Cyclic Dependency
BCNF / 3NF / 2NF
Assumption
Exploring space
RDB Schema
RDB Content
View Query
Integrity Constraints
(Key, FK)
Local Constraints
(Not Null, domain)
Nested queries
Duplicates
Deletion
Key Exposition
Insertion
Non Correlation predicates attribute exposition
Replacement
Correlation predicates attributes exposition
Rename
Set of each
Group Update
Hierarchy Consistency
( Recursion )
( Aggregation )
Order
( Schema Change )
Modification
Language
15
Problem Definition:
- Characterize the XVUP
- Schema mapping in XVUP
- Classify subproblems: RUP, PUP
- Update operation
- Correct translatability
Schema Mapping in XVUP
Constraints in
XML Schema/DTD
Domain of
element/attributes
Key Constraints
Referential Integrity
Constraints (Foreign
Key)
Optional element
Nillable attributes
Cardinality
constrains
Hierarchy
Loading
Constraints in
Relational
Database schema
Domain Constraints
of attribute in
relation
Primary key /
unique key of table
Foreign key between
tables
Attributes is Null /
Not null
Table definition
Choice
Inclusion
dependency
(ID/IDREF)
Sequence
View Query
XML View Schema
Constraints in
Filtered XML View
Schema
Domain
Constraints in
Extracted XML
View Schema
?
Cardinality
?
Hierarchy from view
query
Cardinality
Null/Not null
Hierarchy
Duplication
FSchema
ESchema
Global Constraints
16
Example of FSchema vs. ESchema
View Query
<bib>
FOR $book in document("default.xml")/book/row
RETURN{
<book year=$book/year/text()>
<bookid>$book/bookid/text()</bookid>,
<title>$book/title/text()</title>,
<author>
FOR $aname in document("default.xml")/author/row
WHERE $book/author_IID = $aname/PID
RETURN{
<aname>$aname/aname/text()</aname>}
</author>
</book>}
</bib>
Relational database
Eschema:
Hierarchy: book = parent(bookid)
Cardinality: (book:aname) = (1:n)
Fschema:
book
IID
PID
bookid
title
author_IID
year
1.0
0.0
98001
TCP/IP Illustrated
11.0
1994
bookid (Not Null)
title (Varchar(256))
author
IID PID aname
1.0
11.0 W.Stevens
17
Problem Definition:
- Characterize the XVUP
- Schema mapping in XVUP
- Classify subproblems: RUP, PUP
- Update operation
- Correct translatability
Partition for XVUP Problem Space
• Publishing-based Update Problem (PUP)
- General problem ---- updating freely constructed XQuery view.
- Touching all features in Language dimension.
• Round-trip Update Problem (RUP)
- Simplest special problem.
- View has same schema
as original XML
document
- No abnormal case exists.
XML View
View Query
XML Doc+Schema
2
1
RDBMS
RUP
PUP
18
XML View Update Operation
• Complete vs. Partial update
- Complete ---- insert/delete/replace a fully
specified view-element instance
- Partial ---- insert/delete/replace a component
of view-element instance
• Valid vs. Invalid update
- Valid ---- Never against any constraints in
ESchema, Fschema (domain+null).
Update translation.
- Invalid ---- Against Constraints.
Rejected.
Problem Definition:
- Characterize the XVUP
- Schema mapping in XVUP
- Classify subproblems: RUP, PUP
- Update operation
- Correct translatability
Complete
<bib>
<book year="1994">
Partial
<bookid>98001</bookid>
<title>TCP/IP Illustrated</title>
<author>
<aname>W. Stevens</aname>
</author>
</book>
<book year="1992">
<bookid>98002</bookid>
<title>Programming in Unix</title>
<author>
<aname>Bram Stoker</aname>
</author>
</book>
<book year="2000">
<bookid>98003</bookid>
<title>Data on the Web</title>
<author>
<aname>Serge Abiteboul</aname>
<aname>Peter Buneman</aname>
<aname>Dan Suciu</aname>
</author>
</book>
19
</bib>
Correct Update Translatability
Problem Definition:
- Characterize the XVUP
- Schema mapping in XVUP
- Classify subproblems: RUP, PUP
- Update operation
- Correct translatability
• No side effect
Only desired update is performed on view.
• One step changes
- Each database tuple affected by at most one step of update operation
- Implications: No order between update operations
Could affect same table several times
• Minimal changes
- No valid translation is subset of current translation
- No extraneous updates
• Replacement cannot be simplified
- Two replaces could get same result, pick simple one
- Replace minimum attribute set / non-key replacement
• No insert-delete pairs
- Replace is cheaper than Insert/Delete pair
20
Where we are
 Motivation
 Related Work
 Background
 Problem Definition
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
•
•
•
•
Rainfall System
Experiment Study
Contributions
Conclusion
21
Problem for PUP
Instance
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
Information
Assumption
Exploring space
Nested queries
Duplicates
Exposition feature
Key Exposition
Non Correlation predicates attribute exposition
Correlation predicates attributes exposition
Hierarchy Consistency
( Recursion )
( Aggregation )
Language
Modification
22
Exposition Completeness
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
• Key Exposition
- Primary key of underlying relation has to be exposed
- except automatic generated key
(implication: user has right to update it)
• Non Correlation predicates attribute exposition (select condition)
- variable involved in predicates has to be exposed
eg: $book/bookid = “98004”
bookid has to be exposed in view result
• Correlation predicates attribute exposition (join condition)
- variable involved in predicates has to be exposed
eg: $book/authorid = $author/id
then authorid in book table, id in author table have to be exposed
• Complete Exposition
23
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
Construction Consistency
• Reason: freely construct the view query
• Confliction between FSchema and ESchema
• View structure could be inconsistent with RDB,
causing side-effect in update translation.
book
IID
PID
bookid
title
author_IID
year
1.0
0.0
98001
TCP/IP Illustrated
11.0
1994
2.0
0.0
98002
Advanced Programming in the Unix
environment
21.0
1992
3.0
0.0
98003
Data on the Web
31.0
2000
publisher
IID
pname
location
1.0
Addison-Wesley
San Francisco
2.0
Addison-Wesley
Boston
3.0
Morgan Kaufman
publishers
New York
24
Construction Consistency
<bib>
FOR $book IN document("default.xml")/book/row,
$publisher IN document("default.xml")/publisher/row
WHERE $book/author_IID = $publisher/IID
RETURN
<book>
$book/bookid,
$book/title,
<publisher_info>
$publisher/pname
</publisher_info>
</book>
</bib>
<bib>
FOR $book IN document("default.xml")/book/row,
$publlisher IN document("default.xml")/publisher/row
WHERE $book/IID = $publisher/IID
RETURN
<publisher_info>
$publisher/pname,
<book>
$book/bookid,
$book/title
</book>
</publisher_info>
</bib>
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
View Query Example1 ---- Consistent
<bib>
<book>
<bookid>98001</bookid>
<title>TCP/IP Illustrated</title>
<publisher_info>
<pname> Addison-Wesley</pname>
</publisher_info>
</book>
Delete
……
</bib>
View Query Example2 ---- Inconsistent
<bib>
Side Effect
<publisher_info>
<pname> Addison-Wesley </pname>
<book>
<bookid>98001</bookid>
<title>TCP/IP Illustrated</title>
</book>
Delete
</publisher_info>
25
……
</bib>
How to find inconsistent construction?
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
• Implicit hierarchy in Relational context:
- Table vs. Attribute
- Key vs. Foreign-Key
BOOK
bookid
title
year
authorid
name
pname
location
review
AUTHOR
bookid
Then, book is parent of all its attributes, book is parent of author
View Relationship Graph (VRG) to describe hierarchy in ESchema
• Hierarchy in View context
- Return clause in FLWR expression
- Variable binding in FOR clause
View Schema Graph (VSG) to describe hierarchy in FSchema
26
Hierarchy in relational context:
View Relationship Graph
book/row/bookid
Reducing Operator:
- Rename
- Add
- Delete
book
book/row/title
publisher
Publisher/row/pname
Hierarchy in view context:
View Schema Graph
bib
Rename
bib
book
book/row/bookid
book/row/title
Publisher_info
Publisher_info
publisher/row/pname
Publisher/row/pname
book/row/bookid
book
book/row/title
27
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
Duplicate
- Two vertexes in VSG are exposed from same relational attribute.
- Partial updates touching duplicate elements are not translatable.
why? Cause ambiguous/inconsistent effect on underlying relation.
book
publisher
book/row/title
author
publisher/row/pname
book/row/title
author/row/aname
update
28
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
View Updatability in PUP
View Features
Exposition
complete
Consistency
Update Type
No
Duplication
Complete
Update
Partial
Update
Well-formed View
Y
Y
Y
Y
Y
Y
Y
N
Y
Case 1
Y
N
Y
Y
Case 2
Y
N
N
Y
Case 3
N
Y
Y
N
N
N
Y
N
N
N
N
N
Y
N
N
N
N
N
N
N
29
Case study in PUP
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
• Case 0: Well-formed View
Complete Exposition + Consistent Construction + No Duplication
• Case 1: Complete Exposition + Consistent + Duplication
Partial update + touch one side of duplication is not translatable
• Case 2: Complete Exposition + In-Consistent + No-Duplication
sub-tree rooted at inconsistent edge is not updatable
• Case 3: Complete Exposition + In-Consistent + Duplication
case 1  case 2
30
Round-Trip Update Problem (RUP)
 Update Strategy for PUP
Exposition completeness
Construction consistency
Duplicate
View updatability in PUP
- View is the same structure and semantics as the original XML document.
- RUP falls into Well-formed View.
- Any Valid Updates on it are always Translatable.
book
IID
PID
bookid
title
author_IID
year
<bib>
<book year="1994">
review author
<bookid>98001</bookid>
IID PID aname
IID PID review
<title>TCP/IP Illustrated</title>
<author>
publisher
<aname>W. Stevens</aname>
</author>
IID pname
location
<publisher>
<pname>Addison-Wesley</pname>
<location>San Francisco</location>
</publisher>
Complete exposition? YES
<review>
Construction consistency? YES
One of the best books on TCP/IP.
NO Duplication? YES
</review>
</book>
……
<bib>
31
Where we are
 Motivation
 Related Work
 Background
 Problem Definition
- Characterize the XML View Update Problem (XVUP)
- Correct Translatability
- Classify subproblems: RUP, PUP
 Update Strategy for PUP
 Rainfall System
• Experiment Study
• Contributions
• Conslusion
32
View Query
User Query
Result XML
Legend
XQuery Parser
Parsed Tree
XAT
XAT
XQuery View
Manager
Information
Collecter
XAT Generator
View
Query
View
Analyzer
Valid Update
Checker
Process Step
XAT
View Composer
Meta -Data
Materialized
data
XAT
XAT Rewriter
View Query XAT
XAT
XAT
Update
Decomposer
SQL Generator
Rainbow
Query
Engine
Update
Propagator
Update
Translator
Process Flow
Data Flow
XAT Executor
Multiple SQL
updates
Rainfall
SQL
RDBMS
RDBMS
Oracle
Sybase
SQL-Server
DB2
33
Update Decomposition Algorithm
Function updateDecomposition (XAT t)
begin
XATleaves  get all leave node of XAT t
resultUpdate  new array of RelationalUpdate
for ( all node n in XATleaves )
up  new RelationalUpdate
up.updateType  same type as root node type of XAT t
while ( n is not null )
opUpdateDecomp(node, up)
n  parent of node n
decideUpdateType (up)
put up into resultUpdate
distinctResultUpdate(resultUpdate)
End
Function decideUpdateType (RelationalUpdate up)
begin
if ( up.updateType is insert or replace )
do nothing
else
if ( up.updateType is delete )
if ( up.updateColumns include all attributes of relation up.tableName )
up.updateType  delete
else
up.updateType  replace
end
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
34
Update Decomposition
Tagger
Join
Function opUpdateDecomp( XATNode n, RelationalUpdate up)
Begin
if ( n is a Navigate node )
up.tableName  get table name from n if it has one
Nav
Nav
else
if ( n is a Select node or a Join node )
up.whereClause  condition in predicate of node n
Source
Source
else
if ( n is a Tagger node )
if ( up.updateType is delete )
if ( n.DOMpattern matches DOM pattern of the element node to be inserted )
up.updateColum.columnName  extract names of attributes from Tagger pattern
if ( up.updateType is insert )
if ( n.DOMpattern matches DOM pattern of the element node to be inserted )
up.updateColumn.columnName  extract names of attributes from Tagger pattern
up.updateColumn.columnValue  extract attribute values from pattern of inserted element
if ( up.updateType is replace)
if ( n.DOM pattern matches DOM pattern of the element node to replacing )
up.updateColum.columnName  extract names of attributes from Tagger pattern
up.updateColumn.oldColumnValue  extract old values from relational database
up.updateColumn.columnValue  extract values from pattern of the replacing element
else do nothing
return up
35
end
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
Fundamental ---- connection
We divide Foreign key as three types:
X1
FK
X2
Ownership
connection
Subset connection
Referencing
connection
X1=UK/PK(R1),
X2PK(R2)
X1=UK/PK(R1),
X2=PK(R2)
X1=UK/PK(R1),
X2  NK/UK(R2),
1:n
1:[0,1]
1:n
Cardinality
Representation
Inner-going
R1
R2
R
R1
R2
R1
R2
Outer-going
36
Example for delete propagation
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
-Dependency Island
- Referencing peninsula
1. Delete
Book
2. Delete
3. Delete
Author
Prices
5. Replace
Publisher
4. Delete
Review
PhoneBook
State
37
Example for insert propagation
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
3. Checking
1. Extend
2. (C1) Insert
(C2) Reject
(C3) Replace
Book
Author
Review
Prices
PhoneBook
Publisher
State
38
Where we are
 Motivation
 Related Work
 Background
 Problem Definition
- Characterize the XML View Update Problem (XVUP)
- Correct Translatability
- Classify subproblems: RUP, PUP
 Update Strategy for PUP
 Rainfall System
 Experiment Study
• Contributions
• Conclusion
39
Updating vs. Re-loading
Time(ms)
1000000
900000
800000
700000
600000
500000
400000
300000
200000
100000
0
200
400
600
Inline Loading
800
1000
1200
File S ize
(elements/file)
Delete
Note: (1) Loading strategy: shared inlining. (2) View is same complexity with document
(RUP)
40
Translation for different update types
Time(ms)
35000
30000
25000
20000
15000
10000
5000
0
200
400
600
Delete
800
Insert
1000
1200
File S ize
(elements/file)
Replace
Note: (1) Same View between update types (2) Update is same granularity
41
Performance among different translation steps
Time(ms)
20000
17500
15000
ViewQuery
12500
UserQuery
XAT Optimization
10000
View Analysis
Update Decompososition
7500
Update Translation & Propagation
Execution
5000
2500
0
Delete
Insert
Replace
Update Type
Note: (1) Database size: number of books= 800.
(2) Same view between different update types
(3) Update is translatable (4) Update has same granularity
42
Where we are
 Motivation
 Related Work
 Background
 Problem Definition
- Characterize the XML View Update Problem (XVUP)
- Correct Translatability
- Classify subproblems: RUP, PUP
 Update Strategy for PUP
 Rainfall System
 Experiment Study
 Contributions
• Conclusion
43
Contributions
• Characterize and propose a classification of the XML
view update problem, and describe the updatability of each
class.
• Present a decomposition-based update translation
algorithm that correctly translates XQuery updates on
views into a set of SQL-level updates.
• Implement Update System Framework (Rainfall) to
implement the proposed strategy.
• Provide experimental results studying the performance of
update strategies.
44
Conclusion
• We study the view update problem in XML context and
provide solution for solving this problem
• Future work.
- Order sensitive view update
- Batch update processing
- Performance in update translation
- Choose trigger for query plan optimization
- Use index speeding up path expression evaluation
- Use materialized view XAT to improve performance
- re-write and optimize XAT
- How to deal with schema changes
45
Thanks
• Advisor: Prof. Elke A. Rundensteiner.
• Co-advisor: Prof. Kathi Fisler.
• Group member: Mukesh Mulchandani in Rainfall
system implementation.
• Xin Zhang and Rainbow group members in base
system supporting.
46
Appendix
Algorithm used in our Update Strategy
47
Dependency Island /Reference Peninsula
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
• Dependency Island (DI) of root relation R
- Rooted at R.
- Maximal sub-tree.
- All inner-going ownership and subset connections of R.
• Referencing Peninsula (RP) of root relation R
- A relation Rj
- Directly connected to any relation of dependency island Rk via
Reference connection Rk
Rj
• Referenced Continent( RC) of root relation R
- Rooted at R.
- Maximal sub-tree.
- All outer-going ownership / subset / reference connections of R.
DI
R
RP
RC
48
View Mapping Graph (VMG) for
running example
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
book
author
publisher
review
49
Delete Propagation
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
Assuming update is to delete a tuple t from relation R.
(1)Isolate the dependency island DI of r.
(2)For each relation in DI of r, delete all tuples dependent on t.
(3)For each reference peninsula attached to DI of r, perform a replacement on
the foreign key of each matching tuple.
(4) For relations in DI of r that has dependency island, deletion is propagated(
repeatedly, if necessary) to their DI.
(5) For those relations involved in deletion, replacement is executed on their RP.
50
Insertion Propagation
 Rainfall Update System
Fundamental concept
Update decomposition
Update propagation
Assuming update is to insert a tuple t into relation R.
(1)Extend the view tuple t as t' with values for the attributes that have been
exposed out in the view definition.
(2) Case 1: An identical tuple exists in R, reject the update.
(3) Case 2: If t' does not match any key of underlying database relation, perform
an insertion in R. Further, for RC of R, a check-insertion operation is done.
(4)Case 3: If t' matches the key of an existing tuple, but some values for non-key
attributes differ. If R has dependency island, reject the update, otherwise,
performe replacement of t with t'.
51