Updating XML - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Updating XML

Description:

Updating XML -Igor Tatarinov, Zachary G Ives, Alon Y.Halevy, Daniel S.Weld. ACM SIGMOD 2001 ... Implementing update operations when XML is stored in relational ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 31
Provided by: roy59
Category:
Tags: xml | updating | weld

less

Transcript and Presenter's Notes

Title: Updating XML


1
  • Updating XML
  • -Igor Tatarinov, Zachary G Ives, Alon Y.Halevy,
    Daniel S.Weld
  • ACM SIGMOD 2001
  • Presented By
  • Deepanwita Roy

2
Outline
  • Basic update operations
  • XQuery
  • Extensions to XQuery
  • Storing XML in RDBMS
  • Implementing update operations when XML is stored
    in relational database

3
XML
  • Node labeled tree with references
  • Types of XML Content
  • Attribute
  • IDREFs
  • Element
  • PCDATA

4
Outline
  • Basic update operations
  • XQuery
  • Extentions to XQuery
  • Implementing update operations when XML is stored
    in relational database

5
Update Operations
  • Delete(child)
  • Rename(child,name)
  • Insert(content)
  • InsertBefore(ref, content)
  • InsertAfter(ref, content)
  • Replace(child,content)

6
Outline
  • Basic update operations
  • XQuery
  • Extensions to XQuery
  • Storing XML in RDBMS
  • Implementing update operations when XML is stored
    in relational database

7
XQuery(FLWR statements)
  • FOR-LET-WHERE-RETURN
  • FOR loops through each node in the sequence
  • LETbinds variable to the entire sequence of node
  • WHERE evaluating an expression
  • RETURNreturn information

8
XQuery Example
Returns ltbookInfogt element for every book element
that has a publisher child of Addison-Wesley
9
Outline
  • Basic update operations
  • XQuery
  • Extensions to XQuery
  • Storing XML in RDBMS
  • Implementing update operations when XML is stored
    in relational database

10
XQuery Extensions for Updates
  • Extend XQuery with a FOR..LET..WHERE..UPDATE
  • where update is defined as
  • DELETE child
  • RENAME child TO name
  • INSERT contentBEFORE AFTER child
  • REPLACE child WITH content
  • FOR binding IN Xpath-subexpr,..
  • WHERE predicate1,update

11
Example
12
Deletion
Allows dangling references
13
Insertion
14
Replacement
15
Combining operations with nested updates
16
Outline
  • Basic update operations
  • XQuery
  • Extensions to XQuery
  • Storing XML in RDBMS
  • Implementing update operations when XML is stored
    in relational database

17
Storing XML in Relations
  • Mapping XML into Relations
  • XML Results as Outer Unions
  • Access support Relations for Path Expression
    Evaluation

18
Mapping XML into Relations
  • Shared Inlining method exploring the DTD

19
XML Results as Outer Unions
  • Simulates Nested cursor approach
  • Separate tuples in the same stream
  • Output tuples sorted so that child data comes
    after parent data

For the query
20
(No Transcript)
21
Access Support Relations for Path Expression
Evaluation
  • Indexes a specified pathextends to XML mapping
  • Without ASR three joins select Part tuples with
    Number 123 then join with Item,Order,Customer
    relations.
  • With ASR two joins Part and ASR relations and
    then result joined with Customer.

22
Outline
  • Basic update operations
  • XQuery
  • Extensions to XQuery
  • Storing XML in RDBMS
  • Implementing update operations when XML is stored
    in relational database

23
XML Deletion Techniques
  • Trigger-based
  • Using per-tuple triggers
  • Using per-statement triggers
  • Cascading delete
  • ASR-Based Delete(Access Support Relations)

24
Trigger based delete
  • A trigger is a little rule that gets fired
    whenever a certain event occurs.
  • Per-tuple trigger the deleted tuple is still
    accessible as is its id.The trigger should delete
    all tuples from child relations that link to the
    tuple through their parentId attribute.
  • Per-statement trigger the trigger is fired
    after all relevant tuples have been deleted.

25
Cascading Delete
  • First Delete relevant tuples from parent relation
    and then deleting orphaned tuples from their
    children.

Same performance as per-statement based trigger.
26
XML Insertion techniques
  • Tuple-based Insert
  • Table-based Insert
  • ASR-Based Insert

27
Tuple based Insert
  • Querying the source subtree and reading a tuple
    at a time.
  • Every source element given a new identifier.
  • The Sorted Outer Union Tuple partitioned back
    tables.
  • Memory requirementslow
  • Large penalty in terms of number of SQL inserts.

28
Table Based Insert
  • Remap all source tuples in a single operation
  • Insert remapped tuples within each underlying
    table
  • Performance better because it executes a single
    SQL insertion per data relation

29
Conclusions
  • Efficient storage of XML documents in RDBMS
  • Updating XML documents and reflecting it in
    relational database.

30
Thank You.
Write a Comment
User Comments (0)
About PowerShow.com