33
1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and Technology Present by Guangyue Jia

1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

Embed Size (px)

Citation preview

Page 1: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

1

The MV3R-Tree: A Spatio-Temporal Access Method for

Timestamp and Interval Queries

Yufei Tao and Dimitris PapadiasHong Kong University of Science and

Technology

Present by Guangyue Jia

Page 2: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

2

Overview

• Motivation

• Related works

• MV3R-tree

• Strong and weak points

• Relation to our project

• Conclusion

Page 3: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

3

Motivation

• Spatio-tempral queries are common.– Data: (tid, sid, x1, y1, x2, y2, t1, t2)– Query: space restriction + time restriction

• Timestamp (or timeslice) query and interval query.

• Process both timestamp and interval query efficiently.

Page 4: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

4

Overview

• Motivation

• Related works

• MV3R-tree

• Strong and weak points

• Relation to our project

• Conclusion

Page 5: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

5

Related works

• MVB-tree: – Multi-version B-tree

• HR-tree– Historical R-tree

• 3D R-tree– 3 Dimension R-tree

Page 6: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

6

MVB-tree• Each entry has the form: <key, tstart, tend, point>

– Insertions and deletions only happen at the current time.

• An entry called alive at a timestamp t if tstart <=t<tend

• Multiple roots and each root has a jurisdiction interval: – Minimum bounding lifespan of all the entries in the root.

• Either none or b · pversion entries are alive for each timestamp t and each node except the roots.– Ensures that entries alive at the same timestamps are mostly

grouped together.

Example of MVB-tree

pversion =1/3

b=6

Page 7: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

7

Overflow

• Insertion is carried out as B-tree except overflows.

• Weak version overflow: block overflow. And it cause version split.

• number of live entries in a new node must be in the range [b·psvu, b·psvo].

• Strong version overflow: number of live entries exceeds b·psvo.

• Strong version overflow cause key split.

Page 8: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

8

Version split

Example of MVB-tree

Example of block overflow and version split

Description:1, When weak version overflow.2, All live entries are copied to a new node.3, tstart modified to the current time.4, tend of the live entries is changed from * to the current time.5, create data redundancy.

Example:

1, insert <28, 4, *> at time 4.

2, A weak version overflow.

3, create new node D and copy the live entries to it.

4, all tstart are set to be 4

5, A ”dies”, all * are replaced by 4.

Page 9: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

9

Underflow

• Deletion is carried out as B-tree except underflows.

• Weak version underflow: number of live entries lower than b·pversion

• Strong version underflow: number of live entries becomes lower than b·psvu.

• Underflow: copy sibling node using only its live entries.

Page 10: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

10

Mergence and key split

<5, 1, *, A><43, 1, *, B><72, 1, *, C>

<5, 1, *><8, 1, *>

<13, 1, *><25, 1, 3><27, 1, 3><39, 1, 3>

<43, 1, *><48, 1, *><52, 1, 2><59, 1, 3><27, 1, 3><68, 1, 3>

<72, 1, *><78, 1, *><83, 1, *><95, 1, 3><99, 1, *>

<102, 1, *>

Root A B C

1, delete entry <48, 1, *> at timestamp 4.

2, B weak version underflow since only entry <43, 1, *> is alive.

3, copy live entries from sibling node C to C´.

3, insert <43, 4, *> into C´cause strong version overflow.

4, key split and node D and E are created.

pversion =psvu=1/3

psvo=5/6

Page 11: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

11

Mergence and key split

<5, 1, *, A><43, 1, *, B><72, 1, *, C>

<5, 1, *><8, 1, *>

<13, 1, *><25, 1, 3><27, 1, 3><39, 1, 3>

<43, 1, *><48, 1, 4><52, 1, 2><59, 1, 3><27, 1, 3><68, 1, 3>

<72, 1, *><78, 1, *><83, 1, *><95, 1, 3><99, 1, *>

<102, 1, *>

Root A B C

1, delete entry <48, 1, *> at timestamp 4.

2, B weak version underflow since only entry <43, 1, *> is alive.

3, copy live entries from sibling node C to C´.

3, insert <43, 4, *> into C´cause strong version overflow.

4, key split and node D and E are created.

pversion =psvu=1/3

psvo=5/6

Page 12: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

12

Mergence and key split

<5, 1, *, A><43, 1, *, B><72, 1, *, C><72, 1, *, C´>

<5, 1, *><8, 1, *>

<13, 1, *><25, 1, 3><27, 1, 3><39, 1, 3>

<43, 1, *><48, 1, 4><52, 1, 2><59, 1, 3><27, 1, 3><68, 1, 3>

<72, 1, *><78, 1, *><83, 1, *><95, 1, 3><99, 1, *>

<102, 1, *>

Root A B C

1, delete entry <48, 1, *> at timestamp 4.

2, B weak version underflow since only entry <43, 1, *> is alive.

3, copy live entries from sibling node C to C´.

3, insert <43, 4, *> into C´cause strong version overflow.

4, key split and node D and E are created.

<72, 1, *><78, 1, *><83, 1, *><99, 1, *>

<102, 1, *>

pversion =psvu=1/3

psvo=5/6

Page 13: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

13

Mergence and key split

<5, 1, *, A><43, 1, *, B><72, 1, *, C><43, 1, *, C´>

<5, 1, *><8, 1, *>

<13, 1, *><25, 1, 3><27, 1, 3><39, 1, 3>

<43, 1, 4><48, 1, 4><52, 1, 2><59, 1, 3><27, 1, 3><68, 1, 3>

<72, 1, *><78, 1, *><83, 1, *><95, 1, 3><99, 1, *>

<102, 1, *>

Root A B C

1, delete entry <48, 1, *> at timestamp 4.

2, B weak version underflow since only entry <43, 1, *> is alive.

3, copy live entries from sibling node C to C´.

3, insert <43, 4, *> into C´cause strong version overflow.

4, key split and node D and E are created.

<43, 4, *><72, 1, *><78, 1, *><83, 1, *><99, 1, *>

<102, 1, *>

pversion =psvu=1/3

psvo=5/6

Page 14: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

14

Mergence and key split

<5, 1, *, A><43, 1, *, B><72, 1, *, C><43, 4, *, D><83, 4, *, E>

<5, 1, *><8, 1, *>

<13, 1, *><25, 1, 3><27, 1, 3><39, 1, 3>

<43, 1, 4><48, 1, 4><52, 1, 2><59, 1, 3><27, 1, 3><68, 1, 3>

<72, 1, *><78, 1, *><83, 1, *><95, 1, 3><99, 1, *>

<102, 1, *>

Root A B C

1, delete entry <48, 1, *> at timestamp 4.

2, B weak version underflow since only entry <43, 1, *> is alive.

3, copy live entries from sibling node C to C´.

3, insert <43, 4, *> into C´cause strong version overflow.

4, key split and node D and E are created.

<43, 4, *><72, 1, *><78, 1, *>

D

<83, 1, *><99, 1, *>

<102, 1, *>

E

pversion =psvu=1/3

psvo=5/6

Page 15: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

15

Historical R-tree• The structure maintains an R-tree for each

timestamp.

• Good for timestamp queries.

• Need a lot of space.

Example of an HR-tree

Page 16: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

16

3D R-tree

• Good for time interval queries

A timestamp query in 3D R-tree

Page 17: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

17

Overview

• Motivation

• Related works

• MV3R-tree

• Strong and weak points

• Relation to our project

• Conclusion

Page 18: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

18

MV3R-tree

• Intruduction• MVR-tree• Insertion and overflow handling in MVR-

tree• Reinsertion• Deletion and underflow handling in MVR-

tree• Auxiliary 3D R-tree• Query processing with MV3R-tree

Page 19: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

19

Introduction

• An idea to deal with both timestamp and interval queries.• MVR-tree + 3DR-tree

Overview of an MV3R-tree

Page 20: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

20

MVR-Tree• Multi-version R-tree.• Can contain multiple R-trees.• Each entry has the form <s, tstart, tend, pointer>

A small MVR-tree with height 2

b=3

pversion=1/3

1, A to G are object boxes.

2, H, I, and J are leaf nodes.

3, C, I and K are alive (unbounded).

Page 21: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

21

Insertion and overflow handling in MVR-tree

• Not overflow in intermediate nodes:– Set tstart to the current time.

• Overflow in intermediate nodes:

Insertion in intermediate nodes

Page 22: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

22

Insertion and overflow handling in MVR-tree

• Not overflow in leaf nodes:– Set tstart to the current time.

• Overflow in leaf nodes:

Insertion in leaf nodess

Page 23: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

23

Reinsertion• Any leaf node of MVR-trees can store a

reinserted entry.

• Different from MVB-tree.

• If general key split fails.

Page 24: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

24

Deletion and underflow handling in MVR-tree

• Not underflow in intermediate nodes: – Modify tend from * to the current time.

• Underflow in intermediate nodes:– Set tend of its live entries to current time.

• All entries are dead.

– Reinsert these entries to the most recent logical R-tree after setting tstart=current time.

– MVB-tree handle underflows by merging with sibling nodes.

Page 25: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

25

Deletion and underflow handling in MVR-tree

• Not underflow in leaf nodes: – Modify tend from * to the current time.

• Underflow in leaf nodes:– First attempt to borrow a live entry from a sibling node. – entry reinsertion if the heuristic fails (cause redundancy).

Borrowing a live entry from a sibling node

1, At timestamp 2, entry A1 is deleted.

2, node A weak version underflow.

3, version condition must still be satisfied in B after removal. (removal of B2 or B3 can cause weak version underflow for timestamp 1.)b=8,

Pversion=1/3

Page 26: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

26

Auxiliary 3D R-tree

• In order to process long time interval queries.

• 3D R-tree is built on the leaves of the MVR-tree.

• Whenever a leaf node of the MVR-tree is updated, the change is propagated to its entry in the 3D R-tree.

Page 27: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

27

Query processing with MV3R-tree

• Choose between 3D R-tree and MVR-tree.– 3D R-tree is preferable for long time interval queries.– MVR-tree is good for timestamp queries.– Threshold is given for short time interval queries.

• When use MVR-tree, it choose the MVR-trees whose roots´jurisdiction interval cover the queried timestamp or interval.

• Duplicate visits for time interval queries.– Duplicate data is created in version split or entry

reinsertion.

Page 28: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

28

Overview

• Motivation

• Related works

• MV3R-tree

• Strong and weak points

• Relation to our project

• Conclusion

Page 29: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

29

Strong and weak points

• Strong points:– Appropriate related work and good structural

sequence.– Good graphic explaination method.

• Weak points:– No method to decide the parameters.– Does not give a solution to deal with the

duplicate visit to the same node via different parents in query processing with MVR-trees.

Page 30: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

30

Overview

• Motivation

• Related works

• MV3R-tree

• Strong and weak points

• Relation to our project

• Conclusion

Page 31: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

31

Relation to our project

• Similar work to our project but different direction.

• MVB-tree is the extension of B-tree which we use in our project.

• Many ideas can be used in our project.

Page 32: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

32

Overview

• Motivation

• Related works

• MV3R-tree

• Strong and weak points

• Relation to our project

• Conclusion

Page 33: 1 The MV3R-Tree: A Spatio- Temporal Access Method for Timestamp and Interval Queries Yufei Tao and Dimitris Papadias Hong Kong University of Science and

33

Conclusion

• MV3R-tree can handle both timestamp and interval queries efficiently.

• But update process is complex.

• Choose between MVR-tree and 3D R-tree is important.

• Duplicate can only be reduced but not be avoided.