# dsdf

Document Sample

```					 Indexing and Range Queries
in Spatio-Temporal Databases

Danzhou Liu, Wei Cui, Yun Fan

School of Computer Science
University of Central Florida
Outline

   Introduction
   The R*-tree
   The TPR-tree
   The TPR*-tree
   Experiments
   Conclusions

2
Introduction
 Spatio-temporal databases
 record moving objects’ geographical locations (sometimes also shapes) at
various timestamps.
 support queries that explore their historical and future (predictive)
behaviors. Applications.
 applications: flight control systems, weather forecast and mobile
computing

 The database stores the motion functions of moving objects.
 For each object o, its motion function gives its location o(t) at any future
time t.
 A predictive window query
 specifies a query region qR and a future time interval qT
 retrieves the set of all objects that will fall in qR during qT.
 our goal: index moving objects so that a predictive window query can be
answered with as few disk I/Os as possible.

 Examples
 Find all airplanes that will be over Florida in the next 10 minutes.
 Report all vessels that will enter the United States in the next hour.         3
Motion Function
 We consider linear motion.
y axis
y axis
10                                                        10
1
8                     -1           -1                     8                       d
-2               d
6                     -2           1                     6
-2 b
1 -2                                2                              a              c
4   1                              -2                    4
a                                 c                          b
1
1
2                                                        2
at time 0                                                        at time 1
x axis                                            x axis
0   2         4            6            8       10       0        2        4          6       8   10

 For each object, the database stores
 Its minimum bounding rectangle (MBR) at the reference time 0
 Its current velocity bounding rectangle (VBR)
 Examples: MBR(a)={2,4,3,4}, VBR(a)={1,1,1,1};
MBR(c)={8,9,3,4}, VBR(c)={-2,0,0,2};
 An update is necessary only when an object’s VBR changes.
4
R*-tree

The R*-tree aims at minimizing:
• the area
•The perimeter of each MBR
•The overlap between two MBRs (e.g., N1, N2) in the same node
•The distance between the centroid of an MBR and that of the node containing it

5
R*-tree Insertion

6
The Time Parameterized R-Tree (TPR-Tree)

 Extends the R-tree by introducing the velocity bounding
rectangle (VBR) in all entries.
 Queries are compared with conservative MBRs of non-leaf
entries.      N1v={-2,1,-2,1} and N2v={-2,0,-1,2}
y axis                                                                y axis
10                                                                    10                                      N2
1     2
8                                                      N2
8                      d
-1            -1
N        1        -2               d
1                                                                   N
-2                                   6      1
6               -2 b                         1
-2
1 -2                      -2            2                                a            c
4         1                     1             -2                     4
a                                  c                            b
1
1
2              -2                            -1                      2
qR
x axis                                                x axis
0         2             4            6             8        10       0          2        4       6       8        10
at time 0                                                            at time 1
7
TPR*-Tree

 Our goal
 index moving objects so that a predictive window query can be
answered with as few disk I/Os as possible.
 A mathematical model that estimates the cost of answering a
predictive window query using TPR-like structures.
 Number of node accesses.
 Application of the model to derive the optimal performance.
 The TPR-tree is much worse than the optimal structure.
 Exam the algorithms of the TPR-tree, identify their
deficiencies, and propose new ones.
 The TPR*-tree.

8
TPR deficiency 1: Choosing sub-tree to insert

 To insert an entry, the TPR-tree picks the sub-tree incurring
the minimum penalty (smallest MBR/VBR enlargement).
y a xis
y a xis
10
10                   the ( absolute) values
of all velocities are 1                                   b                       g
8
8
g
b                                                                                       d
6
6                               a                                                                     p

d                     4
4                                                                                                     a
i (static)                        c
h                         e
e                                                         2
2                                                                                     f       c               h
f
x a xis           i                                       x a xis

10        0               2       4       6       8       10
0           2             4         6           8
time 0                                      inserting p at time 2
 May result in inserting an entry into a bad sub-tree; this
problem is increasingly serious as time evolves.
9
TPR* solution: Choose path
 Aims at finding the best insertion path globally, namely,
among all possible paths.
 Observation: We can find this path by accessing only a few more
nodes (than the TPR-tree algorithm).
y a xis
10                                                        Maintain a heap:
b                       g
8                                                        [(g),0], [(h),0], [(i),20]
d
6
p
the path expanded so far
4                                   a
the accumulated penalty so far
e
2
f       c               h
i                                       x a xis
0               2       4       6       8       10

inserting p at time 2
10
TPR* solution: Choose path
 Aims at finding the best insertion path globally, namely,
among all possible paths.
 Observation: We can find this path by accessing only a few more
nodes (than the TPR-tree algorithm).
y a xis
10
Visit node g:
b                       g
8
[(h),0], [(a,g),3], [(i),20],
d
6
p                     [(b,g),32]
4                                   a

e
2
f       c               h
i                                       x a xis    although nodes a and b are
10
0               2       4       6       8
not visited
inserting p at time 2
11
TPR* solution: Choose path
 Aims at finding the best insertion path globally, namely,
among all possible paths.
 Observation: We can find this path by accessing only a few more
y a xis nodes (than the TPR-tree algorithm).
10
b                       g
Visit node h:
8

d
[(a,g),3], [(d,h),9],
6
p                     [(c,h),17], [(i),20],
4                                 a                     [(b,g),32]
2
e
c               h
The algorithm stops now.
f
i                                       x a xis
0             2       4       6       8       10

inserting p at time 2
12
TPR deficiency 2: Which entries to re-insert

 When a node overflows, some of its entries are re-inserted to defer node
split (the ones that diverge most from the node centroid).
 The entries chosen by the TPR-tree are very likely to be re-inserted back to
the same node, so that a node split is still necessary.
y axis                                         y a xis

10
the ( absolute) values           10
of all velocities are 1                   e

8            e                                 8
c
d                                             d   b
6                                             6                        c
a
b                                4
4
a
2
2
x a xis
x axis
0            2   4           6   8       10
0        2       4       6       8   10
node overflow at time 0                                       time 2

13
TPR* solution: Pick worst

 Aims at selecting entries that can most effectively “shrink” the
MBR or VBR of the node for re-insertion.
 The first step picks an appropriate dimension (either spatial or
velocity) based purely on estimation using our cost model (see
the paper for details).                   y a xis
the ( absolute) values
10
of all velocities are 1
The second step performs sorting on                    8       e                   c
this dimension and decides the                                         d
6
a
entries to be removed .                                        b
–   Example: If the axis chosen in the first step   4

is the x-axis, then the sorting list is
2
{b,d,a,c}. Either b or c is removed.
x a xis
0    2       4       6       8   10
time 0
14
TPR deficiency 3: Tightening MBR in deletion

 Entry deletion requires first finding the entry, which accesses
many nodes of the tree. The TPR-tree uses this fact to tighten
the MBR of non-leaf entries.
 Assume nodes h and i are accessed before e is found; then the TPR-
tree will tighten the MBR of i only (enclosing g and f).
y a xis                                                          y a xis
10
the ( absolute) values
of all velocities are 1                           10                 i
f               i                                                                f
8                                                                8
e
g                                                                    g
6                                                               6
d                                                        e
a                                                                                        d   c
4                                                               4
c                                                b       a
j
b                                                                                            j
h
2                                                               2
h
x a xis                                                              x a xis
0         2           4           6           8       10        0          2               4           6           8       10
time 0                                           deleting e at time 1
15
TPR deficiency 3: Tightening MBR in deletion

 Entry deletion requires first finding the entry, which accesses
many nodes of the tree. The TPR-tree uses this fact to tighten
the MBR of non-leaf entries.
 Assume nodes h and i are accessed before e is found; then the TPR-
tree will tighten the MBR of i only (enclosing g and f).
y a xis                                                          y axis
10
the ( absolute) values
of all velocities are 1                           10                i
f               i                                                               f
8                                                                8
e
g                                                                   g
6                                                               6
d
a                                                                                   d   c
4                                                               4
c                                               b       a
j
b                                                                                       j
h
2                                                               2
h
x a xis                                                         x axis
0         2           4           6           8       10        0         2               4       6           8       10
time 0                                      after deleting e at time 1                               16
TPR* solution: Active tightening

 Assume nodes h and i are accessed before e is found; then
the TPR*-tree will tighten the MBR of both h and i.
y a xis                                                          y a xis
10
the ( absolute) values
of all velocities are 1                           10                 i
f               i                                                                f
8                                                                8
e
g                                                                    g
6                                                                6
d                                                        e
a                                                                                        d   c
4                                                                4
c                                                b       a
j
b                                                                                            j
h
2                                                                2
h
x a xis                                                              x a xis
0          2           4           6           8       10        0          2               4           6           8       10
time 0                                           deleting e at time 1
17
TPR* solution: Active tightening

 Assume nodes h and i are accessed before e is found; then
the TPR*-tree will tighten the MBR of both h and i.
y a xis                                                          y axis
10
the ( absolute) values
of all velocities are 1                           10            i
f               i                                                           f
8                                                                8
e
g                                                               g
6                                                                6
d
a                                                                               d   c
4                                                                4
c                                           b       a
j
b                                                   h                               j
h
2                                                                2

x a xis                                                     x axis
0          2           4           6           8       10        0         2           4       6           8       10
time 0                                      after deleting e at time 1
18
TPR* solution: Active tightening (Cont.)

 Another example: Assume the shaded nodes are
accessed to find e.
 The active tightening can tighten the MBR of n5, n6, n3,
and n4.
 But not n1 and n2.
root
n5 n 6             to be written
back to disk
N5
N6
n1 n 2              n3 n 4         ...

e              ...
N1          N2         N3          N4                    19
Challenge of Migration

 3 Operating Systems:
 Microsoft Windows
 Sun Solaris
 Redhat Fedora Core 1
 2 Compilers: CL, GCC (2.9.5, 3.3.2)
 Difference of Code Conversion
 How close the compilers to the standard?
 Compatibility of Library

20
Experiments: Settings (query and tree)

 Dataset
 50,000 sampled objects’ MBRs are taken from a real spatial dataset NJ [Tiger]
 each object is associated with a VBR such that on each dimension
 The velocity extent is zero (i.e., the object does not change
spatial extents during its movement)
 the velocity value distribution is randomed in range [0,8]
 the velocity can be positive or negative with equal probability.

 We compare TPR*- with TPR-trees.
 Disk page size=1k bytes (node capacity=27 for both trees).
 For each object update, perform a deletion followed by an insertion on each
tree.
 Each predictive query is a moving rectangle, and has these parameters:
 qRlen: The length of the query’s MBR
 qVlen: The length of the query’s VBR
 qTlen: The number of timestamps covered.
21
TPR-tree

22
TPR*-tree

23
Conclusions

 The TPR-tree combines the idea of conservative
MBR directly with the tree construction algorithms
of R*-trees.
 The TPR*-tree improves it by designing algorithms
that take into account the special features for moving
objects.
 Cost model for performance analysis
 The optimal performance of a “hypothetically best
structure”
 Reduce disk I/Os for predictive queries

24
Q&A
Thanks!

26

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 0 posted: 5/7/2013 language: English pages: 26
How are you planning on using Docstoc?