8
LI 13.3.17 F lecture on 02.05 and 04.05 Topic Persistence / Temporal DS Model : So far we assumed RAM machine Now poinlermachine Insists of r[¥Et\# nodes with root ^ teeth Taft In C NODE = STRUCT 04 ) FIELDS

# Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

LI13.3.17

F lectureon

02.05 and 04.05

TopicPersistence /

TemporalDS

Model: So

far

we assumedRAM machine

Now

poinlermachine

Insistsof

r[¥Et\#

nodes with

root

^

teeth

Taft

In C NODE=

STRUCT

→ 04 ) FIELDS

Page 2: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

Allowedoperations

-

×

=

new node

-

×=

y .

field

-

x. field =

y

-

×=

y+2 (

manipulate data )

-

destroyx ( if

no

pointersto

× )

Temporatdspersstenee

neverdestroy

oldversion

update

→ makes new version

Retroactivity:

next week(

use time travel )

Page 3: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

Persistence

Presentation

mightchange

,

= •/

behavior is

preserved.

Fta

:

onlylatest

update

f.

µ

:

update anyversion

today

#confluent :

merging

two version

(

functional :

impkmentinHASKE#

nevermodify versions

black hole :never

storeupdates

PartialPersistence

-

e

g

superpositionof o and u

.

Driscoll et.

al.

1982 :

ttpointer

machine DS with

*

in

degree<

p=

OG) ( #

pointersto

anynode)

tinsopaoe

can be madepartially persistent

with

to-

OG)

amortized multiplicative overhead

-

OH )space per update

Page 4: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

Et'

#

ItPoaoidnhters

MODS

=p

@PNODE

stores

badPointersLTD[

latest version only W

�2� Allow ⇐

ZpMODS

MOD=

( VERSION,

FIELD,

VALUE)

Historyof OG

) versions.

UPDATE:

If NODE not full

-

add MOD

if

switching pointers→

updateback

pointers

if full

- createnew

NODE ( NODE

'

=

NODE with

#€¥÷/[yIy0s

applied)

¥dynN¥'

Page 5: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

-

change TintoNODE

→ NODE

'

follow NODE

'

pointers

-

change pointersto NODE

NODE ↳follow NODE

'

backpointers

ftp.t#E/arndeIsoidghanse

7[f-|Q : Does it terminate ?

- it ?

NODE

'

Pt=tdAhayis:

§=

C.

£

#mods in nodes

in latest version

£

largeconstant

.

amortized cost

=

+

OC1)

+ OC1) +

p

.

recursion- 2. c.

pa- Za

< c

W-

-

compute A

£ C or

this is 0

+

modifypotential

.

Page 6: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

( .

FuHPersisten= ( Driscoll 89 )

RoblesWe have

a tree of versions ?

X

y§↳.g)

in order traversal

bx bye

>bzezex

Solution Linearize versions

Note bv < bw <

ew<

er⇐ > v is andnestor of

w

Maintainingordered list :

÷ert

,delete OC 1)

-

Order queried

amortized 04)

→ allows usto

maintain tree of NODES

Page 7: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

III

Yen

£

@

VERSIONS ROOT VERSION

,

SUBTREE OF VERSIONS

-

Query:

Scan all MODS✓

@Back

pointersare

alwaysstored

.

p

.

mox inloutdegree

d- # fields

store

ffrdsotntetonohoonsmonotds

Problems. Constantly discharging( Huge cost )

LIMBIFE

'

nsertananse

#

Page 8: # Taft - ETH Z · Persistence Presentation mightchange, = •/ behavior is preserved Fta: only latest update f.: µ update any version today # confluent: merging two version functional:

B%DDy.fi

split of vase