updating xml data & transaction support for...

95
Updating XML Data & Transaction Support for XML Saarland University Stefan Bender Christian Fuchs Michael Schmidt Jun, 03 2003

Upload: others

Post on 12-Jul-2020

28 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Upd

atin

g X

ML

Dat

a &

Tra

nsac

tion

Su

ppor

t fo

r X

ML

Saar

land

Uni

vers

ity

Stef

an B

ende

rC

hris

tian

Fuc

hsM

icha

el S

chm

idt

Jun,

03

2003

Page 2: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Ove

rvie

w

Upd

atin

g X

ML

Tran

sact

ion

isol

atio

n in

XM

L ba

ses

Det

ecti

ng c

hang

es in

XM

L do

cum

ents

Page 3: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Stat

e of

the

art

Supp

lier

Cus

tom

er

XM

L

Exch

ange

the

who

le d

ocum

ent;

del

ete

the

old

one;

inse

rt t

he n

ew o

ne

Exch

ange

the

who

le d

ocum

ent;

det

ect

the

chan

ges;

upd

ate

the

old

docu

men

t

Exch

ange

onl

y th

e di

ffer

ence

s be

twee

n th

e ne

w a

nd o

ld d

ocum

ent;

upd

ate

the

old

docu

men

t

Page 4: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Upd

atin

g X

ML

XM

L is

the

de

fact

o da

ta e

xcha

nge

stan

dard

XQ

uery

esta

blis

hed

as X

ML

quer

y la

ngua

ge

is in

depe

nden

t of

the

phy

sica

l sto

rage

of t

he d

ata

expr

essi

ons

are

easy

to

unde

rsta

nd

But

XQ

uery

lack

s th

e ab

ility

to

chan

ge X

ML

data

Poss

ible

sol

utio

n: E

xten

d th

e X

Que

ry la

ngua

ge

Page 5: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Upd

ate

oper

atio

ns f

or X

Que

ryTh

e ex

tens

ion

shou

ld e

xpan

d X

Que

ry t

o a

full

feat

ured

que

ry la

ngua

ge li

ke S

QL

The

exte

nsio

n sh

ould

not

aff

ect

the

prop

erti

es

of X

Que

ry

The

prop

osed

ext

ensi

ons

to X

Que

ry p

rovi

de

the

follo

win

g op

erat

ions

:

Del

ete

Inse

rt /

Ins

ertB

efor

e /I

nser

tAft

er

Ren

ame

/ R

epla

ce

Sub-

Upd

ate

Page 6: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Bas

ic s

truc

ture

of t

he X

Que

ry

exte

nsio

n

FOR

$binding IN Xpath-expr,...

LET

$binding := XPath-expr,...

WHERE predicate,...

UPDATE $binding { subOp {,subOP}*}

subOp:

DELETE $child |

RENAME $child |

INSERT $content [BEFORE | AFTER]$child |

REPLACE $child WITH $content |

FOR $binding IN Xpath-subexpr,...

WHERE predicate,... subOP

Page 7: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

An

exam

ple

docu

men

t<Customers>

<Customer>

<Name>Schmidt</Name>

<Address>

<City>Trier</City>

<State>RLP</State>

</Address>

<Order>

<Date>12.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

<Customer>

<Name>Müller</Name>

<Address>

<City>Saarbrücken</City>

<State>Saarland</State>

</Address>

<Order>

<Date>14.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

</Customers>

Cus

tom

ers

Nam

e

Cus

tom

erC

usto

mer St

ate

Ord

erN

ame

Add

ress

Ord

er

Cit

ySt

ate

Cit

y

Add

ress

Schm

idt

Trie

rR

LP

Mül

ler Sa

arbr

ücke

n

......

...

Saar

land

Qty

Ord

erLi

ne

Item

Kaff

ee1

Ord

erLi

ne

Item

Qty

Tee

2

Dat

e

12.0

5.20

03

Page 8: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Two

exam

ples

on

XQ

uery

ex

tens

ion

FOR

$doc IN document (“Customer.xml”)

$cust IN $doc/customer,

$addr IN $cust/address,

$state IN $addr/state

UPDATE $addr {

DELETE $state

}

Del

ete

Stat

e fr

om A

ddre

ss

FOR

$doc IN document (“Customer.xml”)

$cust IN $doc/customer,

$addr IN $cust/address,

$city IN $addr/city

WHERE $city = “Trier”

UPDATE $addr {

REPLACE $city

WITH

<appellation>

Mainz

</appellation>

}

Rep

lace

eve

ry C

ity

that

is

calle

d “T

rier

” w

ith

“Mai

nz”

Page 9: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Prob

lem

s w

ith

XM

L up

date

sTh

ere

may

be

prob

lem

s w

ith

refe

renc

es w

hen

an e

lem

ent

is in

sert

ed o

r de

lete

d

A c

hang

e on

a n

ode

may

res

ult

in a

n up

date

of

a w

hole

sub

tree

Whe

n de

alin

g w

ith

a R

DB

S, a

sin

gle

upda

te

stat

emen

t co

uld

resu

lt in

mul

tipl

e SQ

L st

atem

ents

Aft

er a

n up

date

the

re m

ay b

e a

conf

lict

betw

een

the

docu

men

t an

d it

s D

TD

Page 10: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

FOR

$doc IN document (“Customer.xml”)

$cust IN $doc/customer,

$addr IN $cust/address,

$state IN $addr/state

UPDATE $addr{

DELETE $state

}

Del

ete

Stat

e fr

om A

ddre

ss

Prob

lem

wit

h D

TD

DT

D

<!ELEMENT Customer

(Name, Address, Order*)>

<!ELEMENT Name (#PCDATA)>

<!ELEMENT Address (City, State)>

<!ELEMENT City (#PCDATA)>

<!ELEMENT State (#PCDATA)>

Page 11: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Effe

ct o

f a s

ingl

e up

date

<Customers>

<Customer>

<Name>Schmidt</Name>

<Address>

<City>Trier</City>

<State>RLP</State>

</Address>

<Order>

<Date>12.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

<Customer>

<Name>Müller</Name>

<Address>

<City>Saarbrücken</City>

<State>Saarland</State>

</Address>

<Order>

<Date>14.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

</Customers>

Cus

tom

ers

Nam

e

Cus

tom

erC

usto

mer St

ate

Ord

erN

ame

Add

ress

Ord

er

Cit

ySt

ate

Cit

y

Add

ress

Schm

idt

Trie

rR

LP

Mül

ler Sa

arbr

ücke

n

......

...

Saar

land

Qty

Ord

erLi

ne

Item

Kaff

ee1

Ord

erLi

ne

Item

Qty

Tee

2

Dat

e

12.0

5.20

03

Page 12: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Effe

ct o

f a s

ingl

e up

date

<Customers>

<Customer>

<Name>Schmidt</Name>

<Address>

<City>Trier</City>

<State>RLP</State>

</Address>

<Order>

<Date>12.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

<Customer>

<Name>Müller</Name>

<Address>

<City>Saarbrücken</City>

<State>Saarland</State>

</Address>

<Order>

<Date>14.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

</Customers>

Cus

tom

ers

Nam

e

Cus

tom

erC

usto

mer St

ate

Ord

erN

ame

Add

ress

Ord

er

Cit

ySt

ate

Cit

y

Add

ress

Schm

idt

Trie

rR

LP

Mül

ler Sa

arbr

ücke

n

......

...

Saar

land

Qty

Ord

erLi

ne

Item

Kaff

ee1

Ord

erLi

ne

Item

Qty

Tee

2

Dat

e

12.0

5.20

03

Page 13: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Effe

ct o

f a s

ingl

e up

date

<Customers>

<Customer>

<Name>Schmidt</Name>

<Address>

<City>Trier</City>

<State>RLP</State>

</Address>

<Order>

<Date>12.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

<Customer>

<Name>Müller</Name>

<Address>

<City>Saarbrücken</City>

<State>Saarland</State>

</Address>

<Order>

<Date>14.05.2003</Date>

<OrderLine> ...

</Order>

</Customer>

</Customers>

Cus

tom

ers

Nam

e

Cus

tom

erC

usto

mer St

ate

Ord

erN

ame

Add

ress

Ord

er

Cit

ySt

ate

Cit

y

Add

ress

Schm

idt

Trie

rR

LP

Mül

ler Sa

arbr

ücke

n

......

...

Saar

land

Qty

Ord

erLi

ne

Item

Kaff

ee1

Ord

erLi

ne

Item

Qty

Tee

2

Dat

e

12.0

5.20

03

Page 14: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Stor

ing

XM

L do

cum

ents

in a

re

lati

onal

dat

abas

e sy

stem

Exam

ple

DT

D

<!ELEMENT Customer

(Name, Address, Order*)>

<!ELEMENT Name (#PCDATA)>

<!ELEMENT Address (City, State)>

<!ELEMENT City (#PCDATA)>

<!ELEMENT State (#PCDATA)>

<!ELEMENT Order

(Date, OrderLine*)>

<!ELEMENT Date (#PCDATA)>

<!ELEMENT OrderLine( Item, qty)>

<!ELEMENT Item (#PCDATA)>

<!ELEMENT qty (#PCDATA)>

Tabl

e: C

usto

mer

Tabl

e: O

rder

Tabl

e: O

rder

Line

IDPa

ren

tID

Nam

eC

ity

Stat

e

10

Schm

idt

Trie

rR

LP

20

Mül

ler

Saar

brüc

ken

Saar

land

IDPa

ren

tID

Da

teO

rder

Lin

e

11

12.0

5.03

1

21

12.0

5.03

2

32

14.0

5.03

3

IDPa

ren

tID

Item

QT

Y

11

Kaf

fee

1

21

Tee

2

32

Kaf

fee

3

Page 15: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

XM

L up

date

in R

DB

SA

sin

gle

upda

te (

like

dele

te)

can

affe

ct

mul

tipl

e re

lati

ons

in t

he d

atab

ase

Prob

lem

Cor

rect

ness

Effi

cien

cy

Solu

tion

Cas

cadi

ng D

elet

e

Trig

ger

Acc

ess

Supp

ort

Rel

atio

ns

Page 16: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Con

clus

ion

Upd

atin

g X

ML

is s

till

imm

atur

e

Exte

ndin

g X

Que

ry s

eem

s re

ason

able

Furt

her

inve

stig

atio

n ne

eds

to b

e do

ne in

thi

s ar

ea

Wha

t if

tw

o ap

plic

atio

ns t

ry t

o m

odif

y th

e sa

me

elem

ent?

Page 17: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Isol

atin

g in

XM

L B

ases

Isol

atio

n is

a v

ital

par

t fo

r th

e co

rrec

tnes

s of

da

taba

ses.

Any

act

ion

on t

he d

ata

mus

t be

pr

even

ted

from

wor

king

on

inte

rmed

iary

dat

a ge

nera

ted

by o

ther

act

ions

.

Tran

sact

ion:

Sequ

ence

of

Ope

rati

ons

on o

ne o

r m

ore

data

base

s, w

ith

the

follo

win

g gu

aran

teed

(A

CID

) at

trib

utes

Page 18: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

AC

ID a

ttri

bute

s

Ato

mic

ity:

All

chan

ges

of a

tra

nsac

tion

are

co

mm

ited

ent

irel

y or

not

at

all

Con

sist

ency

: A

tra

nsac

tion

tra

nsfo

rms

data

fr

om o

ne v

alid

sta

te t

o an

othe

r va

lid s

tate

Isol

atio

n:

Ever

y tr

ansa

ctio

n w

orks

on

the

data

as

if t

here

wer

e no

par

alle

l tra

nsac

tion

s

Du

rabi

lity

: C

omm

ited

cha

nges

are

per

sist

ent,

ev

en in

cas

e of

a h

ard-

or

soft

war

e fa

ilure

Page 19: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Ope

rati

ons

Cla

ssif

icat

ion

By a

ctio

n:re

adin

g or

wri

ting

By

dom

ain:

cont

ent o

r st

ruct

ure

Rep

rese

ntat

ive

set

of s

truc

ture

ope

rati

ons

sd:

sele

ct d

ocum

ent

root

nthF

:re

trie

ve t

he n

-th

child

in t

he c

hild

list

nthB

:sa

me,

but

cou

ntin

g ba

ckw

ards

del:

dele

te n

ode

ins:

inse

rt n

ode

Page 20: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 21: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T1

T2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 22: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T1

T2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 23: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T1

T2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 24: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T1

T2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 25: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T1

T2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 26: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Exam

ple

4 Po

inte

rs p

er n

ode

Firs

t an

d la

st c

hild

Left

and

rig

ht s

iblin

g

2 Tr

ansa

ctio

ns3

42

1

5

T1

T2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 27: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Two

phas

e lo

ckin

g ba

sed

prot

ocol

s

Doc

2PL

Nod

e2PL

NO

2PL

OO

2PL

Tim

esta

mp-

base

d pr

otoc

ol

Dyn

amic

com

mit

ord

erin

g

Cor

e pr

otoc

ols

for

sync

hron

izin

g re

ad a

nd w

rite

ope

rati

ons

Page 28: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Two

phas

e lo

ckin

g

Lock

s ar

e as

soci

ated

wit

h ea

ch d

ata

item

A t

rans

acti

on h

as t

o ac

quir

e a

shar

ed (

S) lo

ck

for

read

ing

a da

ta it

em o

r an

exc

lusi

ve (

X)

lock

to

mod

ify

it

An

excl

usiv

e lo

ck c

onfl

icts

wit

h al

l oth

er lo

cks

All

lock

s ar

e ac

quir

ed b

efor

e an

y lo

ck is

re

leas

ed

A t

rans

acti

on h

olds

all

lock

s un

til c

ompl

etio

n

Page 29: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Doc

2PL

lock

the

who

le

docu

men

t

34

2

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 30: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Doc

2PL

lock

the

who

le

docu

men

t

T 2 h

as t

o w

ait

unti

l T1

com

mit

s3

42

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 31: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Nod

e2PL

lock

par

ent

node

s

34

2

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 32: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Nod

e2PL

lock

par

ent

node

s

T 2 h

as t

o w

ait

unti

l T1

com

mit

s

34

2

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 33: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

NO

2PL

lock

nod

es w

hose

po

inte

rs a

re t

rave

rsed

or

mod

ifie

d

34

2

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 34: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

NO

2PL

lock

nod

es w

hose

po

inte

rs a

re t

rave

rsed

or

mod

ifie

d

T 2 h

as t

o w

ait

unti

l T1

com

mit

s3

42

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 35: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

OO

2PL

lock

onl

y po

inte

rs

34

2

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 36: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

OO

2PL

lock

onl

y po

inte

rs

T 2 a

nd T

1 ca

n be

ex

ecut

ed a

t th

e sa

me

tim

e3

42

1

5

T 1T

2

sd

=> 1

sd

=> 1

nthF(2)=> 3

nthB(1)=> 4

del

Delete 3nthF(1)=> 5

Page 37: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Ano

ther

exa

mpl

e

34

2

1 67

5

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Is O

O2P

L en

ough

?

Page 38: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Ano

ther

exa

mpl

e

34

2

1 67

5

Is O

O2P

L en

ough

?

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 39: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Ano

ther

exa

mpl

e

34

2

1 67

5

Is O

O2P

L en

ough

?

In t

his

situ

atio

n O

O2P

L le

ads

to a

dea

dloc

k!

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 40: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol

Bas

ic id

ea is

to

impl

icit

ly k

eep

mul

tipl

e ve

rsio

ns o

f the

doc

umen

t

Use

mar

ks t

o de

note

del

eted

res

pect

ivel

y in

sert

ed n

odes

Elim

inat

e m

arks

and

rem

ove

dele

ted

node

s fr

om d

ocum

ent

whe

n th

e tr

ansa

ctio

n co

mm

its

Ass

ign

ever

y tr

ansa

ctio

n a

uniq

ue t

imes

tam

p

Ope

rati

ons

of a

tra

nsac

tion

inhe

rit

tim

esta

mp

Page 41: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

TI

Not

pos

sibl

eN

ot p

ossi

ble

DI

Not

pos

sibl

eN

ot p

ossi

ble

II

Not

pos

sibl

eN

ot p

ossi

ble

Ope

rati

ons

opF

fini

shed

opS

sche

dule

d

Act

ions

TTr

aver

seD

Del

ete

IIn

sert

Rel

atio

n <

TS d

enot

es

the

tim

esta

mp

orde

r

Page 42: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

1 67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 43: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

1 67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 44: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

1 67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 45: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 46: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 47: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 48: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 49: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 50: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 51: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

2

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 52: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

2

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 53: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

2

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 54: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

2

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 55: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Tim

esta

mp-

base

d pr

otoc

ol 34

67

5

opF

opS

opF

<T

S op

Sop

F >

TS

opS

TT

No

conf

lict

No

conf

lict

DT

Igno

re (

c.a.

)Tr

aver

se

IT

Trav

erse

(c.

a.)

Igno

re

TD

Mar

k de

lete

dA

bort

TS

DD

Not

pos

sibl

eA

bort

TS

ID

Blo

ck T

S th

en

mar

k de

lete

d

Not

pos

sibl

e

1

Del

eted

Del

eted

2

T 1T 2

sd

=> 1

sd

=> 1

nthF(1)=> 2

nthB(1)=> 4

del

Delete 2del

Delete 4

sd

=> 1

sd

=> 1

nthB(1)=> 4

nthF(1)=> 3

nthF(1)=> 7

nthF(1)=> 6

Page 56: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Con

clus

ion

Wha

t ab

out

Dyn

amic

com

mit

ord

erin

g?

Leve

l of

para

llelis

m d

epen

ds o

n th

e gr

anul

arit

y of

lock

ing

The

prot

ocol

s sh

own

are

desi

gned

for

nat

ive

XM

L ba

ses

Trad

itio

nal D

BS

coul

d be

nefi

t fr

om t

hose

pr

otoc

ols

by e

.g. i

ntro

duci

ng a

spe

cial

ized

Tr

ansa

ctio

n M

anag

er

Perf

orm

ance

eva

luat

ion

is s

till

mis

sing

Page 57: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Det

ecti

ng c

hang

es in

XM

L do

cum

ents

Impo

rtan

t fo

r in

tern

et s

earc

h en

gine

s

Freq

uent

cha

nges

of o

nlin

e in

form

atio

n

Prob

ably

don

't w

ant

to r

ebui

ld w

hole

inde

x

Con

tinu

ous

quer

y sy

stem

s (t

rigg

er s

yste

ms)

Rea

ct o

n th

e ch

ange

of a

doc

umen

t

Ver

sion

ing

of X

ML

docu

men

ts(l

ike

CV

S us

es d

iff o

n te

xt fi

les)

Page 58: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

XY-

Dif

f

Dev

elop

ed a

s pa

rt o

f a

web

cra

wle

r

Con

side

rs X

ML

docu

men

t tr

ees

orde

red

Des

igne

d to

wor

k on

ave

rage

in li

near

tim

e us

ing

a gr

eedy

alg

orit

hm

Res

ulti

ng d

iffs

are

not

alw

ays

opti

mal

Page 59: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

XY-

Dif

f

Page 60: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

hing

and

wei

ghti

ng

11

AB

Page 61: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

hing

and

wei

ghti

ng

3

11

AB

CA

B

Page 62: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

hing

and

wei

ghti

ng

5

31

11

AB

CA

BD

ECA

BD

Page 63: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

hing

and

wei

ghti

ng

11

72

1

15

31

11

1

AB

CA

BD

FCA

BD

E

GEF

CA

BD

HIHJ

KG

EFC

AB

DIH

J

Page 64: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

hing

and

wei

ghti

ng

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D

FCA

BD

E

GEF

CA

BD

HIHJ

KG

EFC

AB

DIH

J

Cha

nged

Nod

e

Page 65: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

hing

and

wei

ghti

ng

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 66: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Cre

ate

prio

rity

que

ue f

or t

he

wei

ghts

, sta

rt w

ith

the

root

nod

e

Prio

rity

que

ue:

11,

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 67: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Com

pare

nod

es

Prio

rity

que

ue:

11,

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 68: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

h va

lue

of t

he r

oot

node

is d

iffe

rent

=

> a

dd c

hild

ren

of r

oot

to p

rior

ity

queu

e

Prio

rity

que

ue:

11, 7

, 2, 1

,

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 69: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Has

h va

lue

of t

he r

oot

node

is d

iffe

rent

=

> a

dd c

hild

ren

of r

oot

to p

rior

ity

queu

e

Prio

rity

que

ue:

11, 7

, 2, 1

,

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 70: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Rep

eat

unti

l dif

fere

nces

are

fou

nd

Prio

rity

que

ue:

11, 7

, 2, 1

,

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 71: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Rep

eat

unti

l dif

fere

nces

are

fou

nd

Prio

rity

que

ue:

11, 7

, 2, 1

, 1, 5

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 72: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Rep

eat

unti

l dif

fere

nces

are

fou

nd

Prio

rity

que

ue:

11, 7

, 2, 1

, 1, 5

, 3, 1

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 73: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Rep

eat

unti

l dif

fere

nces

are

fou

nd

Prio

rity

que

ue:

11, 7

, 2, 1

, 1, 5

, 3, 1

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 74: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Rep

eat

unti

l dif

fere

nces

are

fou

nd

Prio

rity

que

ue:

11, 7

, 2, 1

, 1, 5

, 3, 1

11

72

1

15

31

11

1

A AB B

CA

BX

AB

D D

FCA

BD

FXA

BD

E E

GEF

CA

BD

GEF

XA

BD

H HIH IHJ J

KG

EFC

AB

DIH

JK

GEF

XAB

DIH

J

Cha

nged

Nod

e

Page 75: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Dis

adva

ntag

e of

XY-

Dif

f

Tend

ency

to

mis

mat

ch n

odes

whe

n gu

ided

by

its

gree

dy m

atch

ing

rule

s

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

1M

2M

3M

ike

Goo

dman

M1

M2

M3

Page 76: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Dis

adva

ntag

e of

XY-

Dif

f

Tend

ency

to

mis

mat

ch n

odes

whe

n gu

ided

by

its

gree

dy m

atch

ing

rule

s

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

1M

2M

3M

ike

Goo

dman

M1

M2

M3

Page 77: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

1M

2M

3M

ike

Goo

dman

M1

M2

M3

Page 78: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

1M

2M

3M

ike

Goo

dman

M1

M2

M3

Page 79: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eTi

tle

Titl

eTi

tle

Mov

ies

Act

or

Mik

eJo

hnso

nM

1M

2M

3M

1M

2M

3

Page 80: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Mov

ies

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

M1

M2

M3

Mik

eJo

hnso

nM

1M

2M

3

Page 81: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eG

oodm

anM

1M

2M

3M

ike

John

son

M1

M2

M3

Page 82: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eG

oodm

anM

1M

2M

3M

ike

John

son

M1

M2

M3

Page 83: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Bill

Goo

dman

M1

M2

M3

Mik

eJo

hnso

nM

1M

2M

3

Page 84: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Bill

Goo

dman

M1

M2

M3

Mik

eJo

hnso

nM

1M

2M

3

Page 85: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Bill

Goo

dman

M1

M2

M3

Mik

eJo

hnso

nM

4M

2M

3

Page 86: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Bill

Goo

dman

M1

M2

M3

Mik

eJo

hnso

nM

4M

2M

3

Page 87: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

e

Bill

Goo

dman

M1

M2

M3

Page 88: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

e

Nam

eM

ovie

s

Act

or

Bill

Goo

dman

M1

M2

M3

Page 89: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Page 90: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Act

ors

Act

or

Nam

eM

ovie

s

Firs

tNam

eLa

stN

ame

Titl

eTi

tle

Titl

eFi

rstN

ame

Last

Nam

eTi

tle

Titl

eTi

tle

Nam

eM

ovie

s

Act

or

Mik

eJo

hnso

nM

4M

2M

3B

illG

oodm

anM

1M

2M

3

Page 91: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

X-D

iff

Dev

elop

ed f

or d

atab

ase

appl

icat

ions

Con

side

rs X

ML

docu

men

t tr

ees

unor

dere

d

Des

igne

d to

pro

duce

opt

imal

dif

fs

Cha

nge

dete

ctio

n on

uno

rder

ed t

rees

isN

P-co

mpl

ete

Nee

ds t

o co

mpa

re e

very

nod

e in

the

old

do

cum

ent

wit

h ev

ery

node

in t

he n

ew o

ne

Sign

ific

antl

y sl

ower

tha

n X

Y-D

iff

Page 92: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Perf

orm

ance

Page 93: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Qua

lity

Page 94: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

Con

clus

ion

Use

of

heur

isti

cs t

o sa

ve t

ime

Use

of

XM

L st

ruct

ure

Two

diff

alg

orit

hms

for

diff

eren

t pu

rpos

es

Mor

e ap

prop

riat

e th

an u

nix

diff

Page 95: Updating XML Data & Transaction Support for XMLresources.mpi-inf.mpg.de/d5/teaching/ss03/xml... · XQuery established as XML query language is independent of the phys ical storage

EOF