15
The Persistent Professor A. Tsakalidis Konstantinos Tsichlas Student of Prof. A. Tsakalidis Ass. Professor, CSD, A.U.Th. ARISTOTLE UNIVERSITY OF THESSALONIKI DEPARTMENT OF INFORMATICS DATA SCIENCE AND ENGINEERING LAB

The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

The Persistent Professor A.

Tsakalidis

Konstantinos Tsichlas Student of Prof. A. Tsakalidis Ass. Professor, CSD, A.U.Th.

ARISTOTLE UNIVERSITY OF THESSALONIKI

DEPARTMENT OF INFORMATICS

DATA SCIENCE AND ENGINEERING LAB

Page 2: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

List Order Maintenance

A. Tsakalidis. Maintaining Order in a Generalized Linked List. Acta Informatica, 21(1):101-112, 1984.

. . . x y z w . . .

U

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 . . . . . .

x y z w

Query: Is x before y? Is label(x) < label(y)?

label(x)=15

Update: Insert x1 after y label(y) < label(x1) < label(z)

Page 3: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

List Order Maintenance

. . . x y z w . . .

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 . . . . . .

x y z w

x1

Insert(y, x1)

Insert(x1, x2)

x2

Insert(x2, x3)??? Needs relabeling…

A. Tsakalidis. Maintaining Order in a Generalized Linked List. Acta Informatica, 21(1):101-112, 1984.

Page 4: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

List Order Maintenance

. . . x z w . . .

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 . . . . . .

x1

Insert(y, x1)

Insert(x1, x2)

x2

Insert(x2, x3)??? Needs relabeling…

y

Query: O(1) w.c. Insert: O(1) amortized

A. Tsakalidis. Maintaining Order in a Generalized Linked List. Acta Informatica, 21(1):101-112, 1984.

Page 5: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Persistence

J.R. Driscoll, N. Sarnak, D. Sleator and R.E. Tarjan. Making Data Structures Persistent. Journal of Computer & System Sciences, 38(1):86-124, 1989.

How to keep the history of a data structure?

How to “move” data without replication?

Persistence List Order

Maintenance

Making External Memory Data Structures Persistent

Range Maxima in External Memory

Graph History in a Distributed Environment

Page 6: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

The DAM (Disk Access Model)

• Counting blocks between 2

levels of memory (cost measure for complexity)

• Models the main bottleneck

• Very Successful l (simplicity)

Limitations

• Parameters B and M are known beforehand

• It does not say anything about multilevel hierarchical memories

• Does not support dynamic M

CPU

RAM

DISK

I/O

M

B

Aggarwal and Vitter 1988

Page 7: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Making External Data Structures Fully Persistent

Focus on dynamic B-trees (although it work for any external memory structure under certain general assumptions):

1. An ephemeral B-tree maintains

the most recent set of elements 2. A partially persistent B-tree

maintains all history of the set of elements as they change

3. A fully persistent B-tree allows for alternate histories

C

1 2 3 4

1 2 3

4 5

6

G.S. Brodal, S. Sioutas, K. Tsakalidis and K. Tsichlas. Fully Persistent B-trees. SODA, pp. 602-614, 2012.

Page 8: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Previous Work – Our Result

Update Cost Range Query

Best Previous

Result

Our Result

nO B

2log

m

B

tnO BB loglog

BnO B 2loglog

B

tnO Blog

Not optimal – related to order maintenance

Page 9: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Our Solution

Fully Persistent B-

tree

Version Tree

v

What is the nearest version to i in v? Cost: log2B

Search(version i, element x)

u What is the nearest version to i in u?

Cost: log2B

We make is O(1) by using ideas from fractional

cascading

Order Maintenance

Page 10: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Range Maxima in Secondary Memory

C. Kejlberg-Rasmussen, Y. Tao, K. Tsakalidis, K. Tsichlas and J. Yoon. I/O-efficient

planar range skyline and attrition priority queues. PODS, pp. 103-114, 2013.

Page 11: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Ideas

1. A B-tree holds all points sorted by x-coordinate.

2. The points in each leaf are structured as a Priority Queue with attrition based on the y-coordinate.

3. For each internal node we persistently concatenate all the PQAs from right to left.

4. All the non-attrited points of the root are the maxima

Page 12: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Looking Deeper…

x

y

Tree

node

PQA PQA

PQA PQAs at the children are

destroyed!!!

Replication is very expensive.

Persistence comes to the rescue.

Page 13: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

A. Kosmatopoulos, K. Tsichlas, A. Gounaris, S. Sioutas and E. Pitoura. HiNode: an asymptotically space-optimal storage model for historical queries on graphs. Distributed and Parallel Databases, 35(3-4):249-285, 2017.

Storing the History of Graphs

Query: What is the impact of Aristotle (in terms of some measure of centrality) during the 18th century?

Page 14: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

Previous Solutions: Snapshots and Logging

Snapshots: The network as it is at some particular time

instance.

Logging: Keeping the update operations between successive

snapshots.

Snapshot at time 0

Updates 1,2,…,k

Snapshot at time k

Snapshot at time m

Why not use Persistence ?

Page 15: The Persistent Professor A. Tsakalidis...List Order Maintenance . . . x y z w . . . 12 13 1814 15 2016 17 19 21 22 23 24 25 26 27 28 29 30 31. . . x y z w x 1 Insert(y, x1) Insert(x1,

A GOOD STUDENT ALWAYS TRIES TO BEST HIS TEACHER.

A GOOD TEACHER ASPIRES HIS STUDENTS TO DO SO.

(IN OUR CASE WE HAVE A VERY

LONG WAY TO GO )

Loneliness, 1982