8
Indexing Continual Range Queries for Location-Aware Mobile Services Kun-Lung Wu, Shyh-Kwei Chen, and Philip S. Yu IBM T.J. Watson Research Center {klwu, skchen, psyu}@us.ibm.com Abstract We study a new main memory-based approach to in- dexing continual range queries to support location-aware mobile services. The query index is used to efficiently an- swer the following question repeatedly: “Which moving ob- jects are currently located inside the boundaries of individ- ual queries?” We present a covering tile-based (COVET) query index, where adjacent covering tiles touch each other only at the edges. A set of virtual tiles are predefined, each with a unique ID. One or more of the virtual tiles are used to strictly cover individual range queries. A COVET in- dex maintains a direct mapping between covering tiles and queries. It allows query evaluation to take advantage of in- cremental changes in object locations. Simulations are con- ducted to evaluate the effectiveness of the COVET index and compare virtual tiles of different shapes and sizes. 1. Introduction Location-aware, or location-based, mobile services have become possible and emerging, thanks to the advances in mobile computing and location-sensing technologies, such as the global positioning systems (GPS). These services can help improve the quality of life by adding location- awareness to many objects of interest, such as humans, taxi cabs, ambulances, laptops, airplanes, trains and cargo ships. Basically, any object that moves can be equipped with location-awareness devices and monitored. One of the most fundamental technical problems for pro- viding location-aware services is to monitor and provide fast answers to continual range queries that locate the mov- ing objects inside the query boundaries. With the results of continual range queries readily available, various kinds of location-aware services can be provided. For example, a taxi cab service company can dispatch a taxi to a cus- tomer at a specific location using the result from a con- tinual range query such as “Finding all the taxi cabs cur- rently located within 5 blocks away from that specific loca- tion.” As another example, a retail store in a shopping mall can distribute timely promotional e-coupons to a customer’s cellphone or PDA using the result from a continual range query such as “Finding all the cellphones or PDAs located within 1/2 mile radius from my store.” The range queries are termed “continual” because they are repeatedly evalu- ated in order to provide the most up-to-date answers as ob- jects continuously to move around. Each range query spec- ifies the boundaries of a region. An efficient index is usually needed for monitoring nu- merous continual range queries over a large number of mov- ing objects. There are generally two different indexing ap- proaches. One is to index the moving objects, and the other is to index the range queries. Various attempts have been proposed to build an index on the moving objects [1, 14, 17, 21]. Because objects may continuously move in unpredictable speed and direction, it is rather difficult to maintain an effective index on the mov- ing objects. Changes in object locations demand updates to the object index, greatly degrading its performance. As a re- sult, certain constraints are usually placed on the moving speed or direction of an object, limiting the applicability of an object index. In contrast, it is more effective to build an index on the range queries because they change less frequently. In this paper, we focus on maintaining a query index for efficient evaluation of continual range queries. This query index is used to quickly retrieve the range queries that contain a given object. The object ID is then inserted into the re- sult lists associated with the covering range queries. Peri- odically, query results are reevaluated after all object IDs are properly inserted into corresponding result lists. For the query results to be useful, the time period be- tween two consecutive reevaluations must be short. As a result, the time for a query reevaluation must be as brief as possible. Moreover, it is important that a query index- ing method can take advantage of incremental changes in object locations because some of the objects may not have moved outside a query boundaries since the last reevalua- tion. Computation can be saved for these objects. Various query indexing methods have been proposed to efficiently match events in the contexts of predicate match- ing [12], pub/sub [2, 7, 25], and continual queries on the In- Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04) 0-7695-2073-1/04 $20.00 © 2004 IEEE

[IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

  • Upload
    syu

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

Indexing Continual Range Queries for Location-Aware Mobile Services

Kun-Lung Wu, Shyh-Kwei Chen, and Philip S. YuIBM T.J. Watson Research Center{klwu, skchen, psyu}@us.ibm.com

Abstract

We study a new main memory-based approach to in-dexing continual range queries to support location-awaremobile services. The query index is used to efficiently an-swer the following question repeatedly: “Which moving ob-jects are currently located inside the boundaries of individ-ual queries?” We present a covering tile-based (COVET)query index, where adjacent covering tiles touch each otheronly at the edges. A set of virtual tiles are predefined, eachwith a unique ID. One or more of the virtual tiles are usedto strictly cover individual range queries. A COVET in-dex maintains a direct mapping between covering tiles andqueries. It allows query evaluation to take advantage of in-cremental changes in object locations. Simulations are con-ducted to evaluate the effectiveness of the COVET index andcompare virtual tiles of different shapes and sizes.

1. Introduction

Location-aware, or location-based, mobile services havebecome possible and emerging, thanks to the advances inmobile computing and location-sensing technologies, suchas the global positioning systems (GPS). These servicescan help improve the quality of life by adding location-awareness to many objects of interest, such as humans,taxi cabs, ambulances, laptops, airplanes, trains and cargoships. Basically, any object that moves can be equipped withlocation-awareness devices and monitored.

One of the most fundamental technical problems for pro-viding location-aware services is to monitor and providefast answers to continual range queries that locate the mov-ing objects inside the query boundaries. With the resultsof continual range queries readily available, various kindsof location-aware services can be provided. For example,a taxi cab service company can dispatch a taxi to a cus-tomer at a specific location using the result from a con-tinual range query such as “Finding all the taxi cabs cur-rently located within 5 blocks away from that specific loca-tion.” As another example, a retail store in a shopping mall

can distribute timely promotional e-coupons to a customer’scellphone or PDA using the result from a continual rangequery such as “Finding all the cellphones or PDAs locatedwithin 1/2 mile radius from my store.” The range queriesare termed “continual” because they are repeatedly evalu-ated in order to provide the most up-to-date answers as ob-jects continuously to move around. Each range query spec-ifies the boundaries of a region.

An efficient index is usually needed for monitoring nu-merous continual range queries over a large number of mov-ing objects. There are generally two different indexing ap-proaches. One is to index the moving objects, and the otheris to index the range queries.

Various attempts have been proposed to build an indexon the moving objects [1, 14, 17, 21]. Because objects maycontinuously move in unpredictable speed and direction, itis rather difficult to maintain an effective index on the mov-ing objects. Changes in object locations demand updates tothe object index, greatly degrading its performance. As a re-sult, certain constraints are usually placed on the movingspeed or direction of an object, limiting the applicability ofan object index.

In contrast, it is more effective to build an index on therange queries because they change less frequently. In thispaper, we focus on maintaining a query index for efficientevaluation of continual range queries. This query index isused to quickly retrieve the range queries that contain agiven object. The object ID is then inserted into the re-sult lists associated with the covering range queries. Peri-odically, query results are reevaluated after all object IDsare properly inserted into corresponding result lists.

For the query results to be useful, the time period be-tween two consecutive reevaluations must be short. As aresult, the time for a query reevaluation must be as briefas possible. Moreover, it is important that a query index-ing method can take advantage of incremental changes inobject locations because some of the objects may not havemoved outside a query boundaries since the last reevalua-tion. Computation can be saved for these objects.

Various query indexing methods have been proposed toefficiently match events in the contexts of predicate match-ing [12], pub/sub [2, 7, 25], and continual queries on the In-

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 2: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

X

A

query range

Figure 1. A query partially intersects withmultiple cells.

ternet [4, 15]. However, these query indexing methods aremostly based on equality predicates, not range predicates.Thus, they are not generally applicable for the evaluation ofcontinual range queries over moving objects.

Query indexing was first proposed for the evaluation ofcontinual queries on moving object in [13, 18]. In [18], anR-tree-based query index was proposed. In order to avoidexcessive location updates, a safe region for each mobileobject was defined. The safe region allows an object not toreport its location as long as it has not moved outside its saferegion. Unfortunately, determining a safe region requires in-tensive computation. In [13], a cell-based query index wasproposed. It was main memory based, and was shown toperform significantly better than an R-tree-based query in-dex [13]. Basically, the monitoring area is partitioned intogrid cells. Each cell maintains two query lists: full and par-tial. The full list stores the IDs of queries that completelycover the cell, while the partial list keeps those that partiallyintersect with the cell. During query reevaluation, these listsare used to find all the queries that contain an object.

However, using partial lists has a drawback.1 Object lo-cations must be compared with query boundaries in orderto identify those queries that truly contain an object. More-over, because of the need for location comparisons, reeval-uation cannot take advantage of the incremental changes inobject locations w.r.t. cells. For example, in Fig. 1, even if anobject has not moved outside a cell, boundary comparisonsagainst all the queries on the partial list are still needed. Thefact that point A is inside a cell X does not imply that A isalso inside the query boundaries.

We propose a COVEring Tile-based (COVET) query in-dexing method. It does not have partial lists. In contrastto cells, where most queries partially intersect with cells,a predefined set of tiles are used to strictly cover individ-

1 When the cell size is 1×1, the approach in [13] does not need a partiallist. However, it will incur a large storage cost (see Section 4.4).

A

query range

S-tile buildingblocks

2x2

1x1

(a)

A

query range

R-tile buildingblocks

2x2

1x2

2x1 1x1

(b)

Figure 2. (a) A query is strictly covered by aset of square-only tiles; (b) A query is strictlycovered by a set of rectangular tiles.

ual range queries. Here, “strictly cover” means (i) all pointsinside the query boundaries are contained inside the cover-ing tiles, and vice versa, and (ii) two tiles can only toucheach other at the edges, there is no overlapping. Figs. 2(a)and 2(b) show two examples of strictly covering a querywith tiles, one with square-only tiles and the other with rect-angular tiles. In contrast to Fig. 1, there is no ambiguity inFigs. 2(a) and 2(b) as to whether point A is covered by thequery because it falls into one of the covering tiles.

There are two important properties associated with cov-ering tiles. First, it does not impose any limit on the mov-ing speed or direction of an object. The COVET indexmaintains a direct mapping between a covering tile and thequeries that contain the tile. For a given object, the COVETindex can be used to enumerate the tiles that contain the ob-ject, which in turn can be used to find the queries that con-tain the object. Second, more importantly, it can capitalizeon the incremental changes in object locations. Computa-tion can be saved for those objects that have not moved out-side a tile.

We describe a simple way to find a set of tiles to strictlycover a range query. We also present an efficient approach todetermining the set of covering tiles for a given object loca-tion. We show an incremental query reevaluation algorithmusing a COVET query index. Two kinds of tiles are consid-ered: square-only tiles and rectangular tiles. Simulations areconducted to evaluate (a) the impacts of tile size and shapeon index storage cost and query reevaluation time and (b)the performance of query reevaluation with a COVET queryindex, as compared with a cell-based query index.

The idea of covering a range query with one or more non-overlapping tiles in COVET is similar to that presented inVCR indexing [24]. However, there are many differences.For example, the covering tiles in COVET only touch eachother on the edges while the virtual construct rectanglesin VCR indexing may overlap with each other. Moreover,

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 3: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

VCR indexing is used for event matching while COVET isused to incrementally evaluate continual range queries overmoving objects.

Although range queries can be treated as rectangles, tra-ditional spatial indexing methods [19], such as an R-tree orany of its variants [9, 11], are less effective because they aremostly disk-based indexing methods. As shown in [13], R-tree-based query indexing is not effective even if it is mod-ified for main memory access. Moreover, the performanceof an R-tree quickly degenerates when the ranges of queriesstart to overlap one another [9, 12].

There are research papers focusing on other issues ofmoving object databases. For example, various indexingtechniques on moving objects have been proposed [1, 5, 6,14, 21, 16, 17]. The trajectories, the past, current, and theanticipated future positions of the moving objects have allbeen explored for indexing. Different constraints are usu-ally imposed to reduce the overhead caused by location up-dates. The data modeling issues of representing and query-ing moving objects were discussed in [8, 10, 20, 23]. Un-certainty in the positions of the moving objects was dealtwith by controlling the location update frequency [22, 23],where objects report their positions when they have devi-ated from the last reported positions by a threshold. Parti-tioning the monitoring area into domains (cells) and mak-ing each moving object aware of the query boundaries in-side its domain was proposed in [3] for adaptive query pro-cessing. Objects must report to the server when they moveacross query boundaries or domain boundaries.

The paper is organized as follows. Section 2 presents theCOVET query index. Section 3 describes the algorithm forincremental query reevaluation with a COVET index. Sec-tion 4 shows the performance evaluation. Finally, Section 5summarizes our paper.

2. Covering tile-based query indexing

2.1. System model

We assume that the monitoring region is partitioned intoan Rx × Ry virtual grid region. The grid coordinates areused to describe range queries and moving objects. Rangequeries are assumed to be rectangles defined along the gridlines. Namely, queries are specified with integer grid coor-dinates.2 However, object locations can be anywhere withinthe monitoring region. Fig. 3(a) shows an example of a

2 Let g denote the physical distance for the side length of a virtual gridcell. If g = 1

10mile, a 50 × 50 square-mile monitoring area can be

represented by a 500 × 500 virtual grid region. If g = 12

mile, thesame monitoring area needs only a 100 × 100 grid region. We as-sume that g is chosen such that all range queries can be approximatelyspecified with integer grid coordinates. If query boundaries need to bespecified in a higher resolution, a smaller g must be used.

13× 13 monitoring region with 2 range queries and 3 mov-ing objects. For example, query q1 : (3, 3, 5, 6) is a rangequery whose bottom-left corner is at (3, 3) and its width is5 and height is 6. Object locations are specified as its x-gridand y-grid coordinates and they can be non-integers, e.g.,o1 : (9.3, 4.15).

2.2. Virtual tiles

For each integer grid point (a, b), where 0 ≤ a < Rx

and 0 ≤ b < Ry, we define a set of B virtual tiles as basicbuilding blocks. These B tiles share the common bottom-left corner at (a, b). Two kinds of virtual tiles are consid-ered: square-only tiles (S-tiles) and rectangular tiles (R-tiles). Assume that Lx = 2kx and Ly = 2ky denote themaximum width and height of a virtual tile, respectively,where 0 ≤ kx, 0 ≤ ky , kx and ky are integers. For S-tiles, Bsq = k + 1, where k = kx = ky . For R-tiles,Brect = (kx + 1)(ky + 1). These basic building blocks aredefined so that a range query of any size can be strictly cov-ered by one or more virtual tiles. For R-tiles, a virtual tilecan be of size 2i × 2j , where 0 ≤ i ≤ kx and 0 ≤ j ≤ ky .Note that R-tiles also contain square tiles when i = j.Figs. 3(b) and 3(c) show examples of basic building blocksfor S-tiles and R-tiles, respectively, where Lx = Ly = 2,Bsq = 2, and Brect = 4.

Each virtual tile has a unique ID. For an R-tile, its ID canbe calculated as follows:

Vrect(a, b, 2i, 2j) = Brect(a + bRx) + j(kx + 1) + i. (1)

The first term is derived by horizontally scanning the inte-ger grid points from (0, 0) to (Rx − 1, 0), then from (0, 1)to (Rx − 1, 1), · · · , until (a − 1, b). There are (a + bRx)such grid points (see Fig. 3(a)). For each such grid point,there are Brect = (kx + 1)(ky + 1) tiles as the basic build-ing blocks. The second and third terms are derived by theID assignment shown in Fig. 3(c). Similarly, for an S-tile,its ID is calculated as follows:

Vsq(a, b, 2i, 2i) = Bsq(a + bRx) + i + 1. (2)

Note that these tiles are virtual. A virtual tile becomes ac-tivated when it is used to cover a range query. Even thoughthere are BRxRy virtual tiles, the number of activated tilesis significantly smaller.

2.3. Query insertion and deletion

To insert a range query q, denoted as (a, b, w, h), we firstfind its covering tiles. Then, the query ID q is inserted intoeach of the ID lists associated with the covering tiles. In thispaper, we assume that, ∀q ∈ Q, Lx = Ly = L = 2k, whereQ is the set of all continual range queries and L is the max-imum side length of a virtual tile.

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 4: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

0,0 5 10

5

10

X

Y

)6,5,3,3(:1q

)5,5,7,6(:2q

)2.5,6.3(:2o)15.4,3.9(:1o

)5.9,5.7(:3o

(a)

(0, 0)

(0, 1)

X(1, 0)

Y

VT: 0

X(2, 0)

Y

(0, 2)

(0, 0)

VT: 1

2;2:only tiles-square == yx LL

(b)

(0, 0)

(0, 1)

(0, 2)

(0, 0)

X(1, 0)

Y

(0, 0)

Y

(0, 1)

X

X(1, 0)

Y

X(2, 0)

Y

(0, 2)

(0, 0)

(2, 0)

VT: 0

VT: 3VT: 2

VT: 1

2;2:r tilesrectangula == yx LL

(c)

Figure 3. (a) An example of specifying range queries and object locations with virtual grid coordi-nates; (b) assigning IDs to square-only tiles; (c) assigning IDs to rectangular tiles.

There are many ways to cover a query with virtual tiles.We present a simple approach. The goal is to use as fewcovering tiles as possible. Conceptually, we cover a hori-zontal strip of the query from the bottom and then moveupwards. Within each horizontal strip, we cover the stripfrom the left towards the right. The height of a strip is cho-sen to be the maximum tile that can strictly fit the strip.Figs. 2(a) and 2(b) show examples of covering a query withS-tiles and R-tiles, respectively. With the same maximumside length L, there are fewer basic building blocks withS-tiles than R-tiles. In general, more virtual tiles are acti-vated to cover a query if S-tiles are used.

After range queries are inserted, the covering tile-basedquery index maintains a mapping, MT⇒Q, from T to Q,where T is the set of virtual tiles and Q is the set of rangequeries. For each tile t ∈ T , there is a query list, denotedas QL(t). Note that t is fully covered by all the queries inQL(t). In other words, t is completely inside the bound-aries of all the queries in QL(t). The data structure for thisCOVET query index includes the query lists and an array ofpointers to the associated query lists.

To delete a query from a COVET index, we first find thecovering tiles for the query, similar to query insertion. Then,the query ID is removed from each QL(t), where t is a cov-ering tile for the query.

2.4. Query search

To find all the queries containing an object, we find allthe tiles that contain that object. Assume that CQ(o) is theset of queries that contain an object o; CT (o) is the set ofpossible tiles that contain an object o. CQ(o) can be com-puted from CT (o) as follows:

CQ(o) = {q|q ∈ QL(t) ∧ t ∈ CT (o)}. (3)

The key step in computing CQ(o) is finding CT (o) be-cause QL(t)’s are maintained by the query index. CT (·)’sfor all possible object locations share two important com-mon properties: constant size and identical gap pattern.These two properties make it efficient to compute CT (·)for any object location.

First, the number of virtual covering tiles is the same forall the object locations. 3 Namely, |CT (oi)| = |CT (oj)|even if oi �= oj . Second, if we sort, in an increasing or-der, the IDs of virtual covering tiles in each CT (·), thensoi

m+1 − soim = s

oj

m+1 − sojm for 1 ≤ m < |CT (·)| and any

two objects oi and oj . Here, soim is the m-th virtual tile in the

sorted CT (oi). In other words, the gap between any two vir-tual covering tiles of matching positions is identical for anytwo locations.

To verify these two properties, let us look at an example.Fig. 4 shows the bottom-left and upper-right corners of cov-ering tiles in CT (o) graphically for an object o whose loca-tion is at (x, y), where a < x < a + 1, b < y < b + 1, aand b are integers. The bottom-left corners of these coveringtiles must reside in the south-west shaded area of (x, y) andthe upper-right corners must reside in the north-east shadedarea of (x, y). It can be easily verified that if any tile whosebottom-left and upper-right corners are positioned in the re-spective shaded areas, it will cover (x, y). The constant sizeand the identical gap pattern properties can be proved byfirst grouping all the drawings in Fig. 4 as a unit and thenmoving it around. When the center is moved from (a, b) toanother point (c, d), the relative positions of all the cover-ing tiles stay the same.

3 Strictly speaking, this is only true for a location that is not in theboundary regions of the monitoring area. The boundary regions aredefined by 0 ≤ x < L or Rx − L ≤ x < Rx or 0 ≤ y < L orRy −L ≤ y < Ry . For simplicity, we focus on locations that are notunder the boundary regions.

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 5: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

X

Y

(a-L, b-L)

(a, b)

(0, 0)

(a+L+1, b+L+1)

pivot point(a+1-L, b+1-L)

(a+1, b+1)

1and1where),( +<<+<< bybaxayx

Figure 4. Finding the virtual covering tiles fora moving object.

With these two properties, we can design an efficientsearch algorithm for computing CQ(o) at location (x, y).We first define a pivot point (PV ) whose location is (�x�+1 − L, �y� + 1 − L), and a pivot tile (PT ) which is de-fined as (�x� + 1 − L, �y� + 1 − L, 20, 20). Namely, thebottom-left corner of PT is at the pivot point PV , and PTis a unit square. Then we pre-compute a difference array D,which stores the differences on the ID’s between the cov-ering tiles in a sorted CT (·) and the pivot tile PT . CT (·)can be efficiently computed at runtime by simple additionsof the pivot tile ID to each element stored in D.

3. Reevaluating queries with a COVET index

Here, we present an incremental reevaluation algorithmbased on a COVET query index. Query results are main-tained in an array of object lists, one for each query. As-sume that OL(q) denotes the object list for q. It containsthe IDs of all objects that are inside the boundaries of q. Weperiodically re-compute all OL()’s taking into account thechanges in object locations since the last reevaluation.

The pseudo code for Algorithm COVET IR is describedin Fig. 5. IR stands for Incremental reevaluation. We as-sume that the object locations used in the last reevaluationare available. These locations are referred to as the old lo-cations,4 in contrast to the new locations for the currentreevaluation. For each oi ∈ O, if the location of oi, de-noted as L(oi), has not been updated since the last reeval-uation, nothing needs to be done for this object. For an ob-ject whose location has been updated, we compute two cov-ering tile sets: CTnew(oi) with the new location data andCTold(oi) with the old location data.

4 A double buffering approach can be used to maintain both the old andnew locations.

Algorithm COVET IRfor (i = 0; oi ∈ O; i + +) {

if (L(oi) has not been updated) { continue; }compute CTnew(oi); compute CTold(oi);for (k = 0; tk ∈ CTnew(oi)−CTold(oi); k ++) {

q = QL(tk);while (q �= NULL) {

insert(oi, OL(q)); q = q → next; }}for (k = 0; tk ∈ CTold(oi)−CTnew(oi); k ++) {

q = QL(tk);while (q �= NULL) {

delete(oi, OL(q)); q = q → next; }}

}

Figure 5. Pseudo code for AlgorithmCOVET IR.

When an object has moved, we need to consider threecases. (1) It has moved into a new tile; (2) It has moved outof an old tile; (3) It has remained inside the old tile. Withboth CTnew(oi) and CTold(oi), we can easily identify thetiles under each case. For any tile tk that is in the new cover-ing tile set but not the old, i.e., tk ∈ CTnew(oi)−CTold(oi),we insert oi to the OL(q) list ∀q ∈ QL(tk). This accountsfor the case that oi has moved into these tiles. On the otherhand, for a tile tj that is in the old covering tile set but notthe new, i.e., tj ∈ CTold(oi) − CTnew(oi), we delete oi

from OL(q) list ∀q ∈ QL(tj). This accounts for the casethat oi has moved out of these tiles. For any tile that isin both covering tile sets, nothing needs to be done. It ac-counts for the case that oi has remained inside the bound-aries of these tiles.

4. Performance evaluation

4.1. A cell-based query indexing approach

For comparison, we describe here the implementation ofa cell-based query indexing (CQI) approach [13]. The entiremonitoring region is partitioned into square cells. Each cellmay contain 1, 4, 16 or 2i virtual grids (see Fig. 3(a)). Eachcell is associated with two lists: full and partial. The par-tial list maintains all the IDs of queries that partially inter-sect with the cell. Comparisons must be performed to checkif a query in the partial list indeed contains an object in thecell. The full list contains all the IDs of queries that fullycontain the cell. No comparison is needed because a queryin the full list is certain to contain any object in that cell.

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 6: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

Algorithm CQI CRfor (i = 0; qi ∈ Q; i + +) { cleanup(OL(qi)); }for (i = 0; oi ∈ O; i + +) {

q = QLP (C(oi));while (q �= NULL) {

if (oi q) { insert(oi, OL(q)); }q = q → next;

}q = QLF (C(oi));while (q �= NULL) {

insert(oi, OL(q)); q = q → next; }}

Figure 6. Pseudo code for Algorithm CQI CR.

The pseudo code for reevaluating queries using CQI isshown in Fig. 6. Due to the use of partial lists, it is dif-ficult, if not impossible, to capitalize on the incrementalchanges in object locations with CQI. Hence, it must per-form a complete reevaluation. In CQI CR, it first cleans upall the OL()’s. CR stands for Complete reevaluation. Then,for each object oi ∈ O, it performs comparisons to test ifoi q for every q ∈ QLP (C(oi)), where C(oi) is the cellID in which oi is located and QLP () is the associated par-tial list. Here, oi q means query q contains object oi. Ifoi q, then oi is inserted into OL(q). For every query qstored in the full list, QLF (C(oi)), oi is simply insertedinto OL(q).

4.2. Simulation studies

Simulations were conducted to (a) study the impacts oftile size and shape and (b) compare COVET with CQI forthe periodic reevaluations of continual range queries. Sinceit has been shown in [13] that a cell-based approach out-performs query indexing schemes based on various R-trees,we focus on comparing our schemes with the cell-basedapproach. We implemented two schemes: COVET IR andCQI CR. For the simulations, the monitoring region wasdefined by Rx = Ry = 500. Queries were representedas a rectangle with width Wx and height Wy with variousbottom-left corners. Both Wx and Wy were randomly cho-sen between 1 and W . The bottom-left corners of the rangequeries are chosen uniformly within the monitoring area.The maximum side length of a tile was L.

A total number of |Q| queries were inserted into thequery index. A total of |O| objects were generated. The ini-tial locations of these moving objects were uniformly dis-tributed within the monitoring area. Then, their subsequentlocations were calculated based on the following rule. Wedefine M as the maximal horizontal or vertical movement

in terms of virtual grids between two consecutive reeval-uations. The new location of a moving object was calcu-lated based on its old location and the horizontal and verti-cal movements, which were independently chosen for mag-nitudes between 0 and M and directions. For the horizon-tal movement, the object was equally likely to move left orright. For the vertical movement, it was also equally likelyto move up or down. Query results were first computed withthe initial object locations. Then, the locations were up-dated based on the movements defined by M . Afterwards,a query reevaluation was performed. We measured the timeit took to complete the reevaluation. Since queries are rel-atively stable, we assumed that there were no changes tothe query index between two query reevaluations. We con-ducted our simulations on an RS6000 44p model 170 ma-chine (CPU 333 MHz; memory size 768 M bytes) runningAIX 4.3.3.

4.3. Importance of tile size and shape

Tile size and shape have important performance impacts.This can be understood by the following equations for com-puting the index storage cost, S:

S =

4BsqRxRy + 8|Q|Csq for square-only tiles

4BrectRxRy + 8|Q|Crect for rectangular tiles,(4)

where Csq and Crect represent the average numbers of cov-ering tiles per query for S-tiles and R-tiles, respectively. Thefirst term is the storage cost for an array of pointers to querylists and the second term is the storage cost for the querylists. Here, we assume each predicate ID requires 4 bytesand each pointer also requires 4 bytes. Each element in aquery list contains a query ID and a pointer to the next ele-ment. Hence, we have the constant 8 in the second term.

Csq and Crect depends on both W and L. With a smallerL, more tiles are needed to cover a query, increasing the sec-ond term of Eq. (4). However, the number of basic build-ing blocks is also smaller, decreasing the first term of Eq.(4). With the same L, Bsq < Brect. Hence, the first termis larger for R-tiles than for S-tiles. However, more tilesare needed to cover a query with S-tiles (see Figs. 2(a)and 2(b)). Hence, the second term is larger for S-tiles thanfor R-tiles.

Query reevaluation time E can be approximately de-scribed as follows:

E = c × |O| × CT (·) × QL(·) × (1 +OL(·)

2), (5)

where c is a constant and CT (·), QL(·), and OL(·) repre-sent the average sizes of a CT (·), QL(·), and OL(·), re-spectively. This assumes that each object moved from one

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 7: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

100

101

102

4

6

8

10

re

−e

va

lua

tio

n t

ime

(se

co

nd

s)

re−evaluation time

100

101

102

6

8

10

12

index s

torage (

M b

yte

s)

max. tile side length

(a) W=40; S−tiles

index storage

100

101

102

0

100

200

re

−e

va

lua

tio

n t

ime

(se

co

nd

s)

re−evaluation time

100

101

1020

20

40

index s

torage (

M b

yte

s)

max. tile side length

(b) W=80; S−tiles

index storage

Figure 7. The impacts of tile size on reevalu-ation time and index storage cost for S-tileswhen (a) W = 40 and (b) W = 80.

tile to another tile between two reevaluations. Hence, it re-quires a deletion from an OL(·), traversing half of it, and aninsertion to the header of another OL(·). CT (·) depends onL. QL(·) depends on L and W . When L is small, QL(·) be-comes large because more tiles are needed to cover a rangequery. When L is large, CT (·) becomes large as well be-cause more building blocks are used.

We conducted many experiments with different W ’s andL’s. The results show that (1) the best reevaluation time canbe achieved when L = 2k, L < W

4 and it is the closest to�W

4 �; (2) the best storage cost can be achieved when L =2k−1. These observations are valid for both S-tiles and R-tiles.

Figs. 7(a) and 7(b) show the reevaluation times and indexstorage costs of a COVET index with S-tiles when W = 40and W = 80, respectively. Figs. 8(a) and 8(b) show thesame for R-tiles. For these experiments, |Q| = 10, 000,|O| = 40, 000, and M = 1. In general, the reevaluationtime and index storage cost both increase if tile size is toosmall or too large. When W = 80, the best reevaluationtime is achieved with L = 16 and the best storage costis achieved with L = 8 (see Figs. 7(b) and 8(b)). Simi-larly, when W = 40, the best reevaluation time occurs whenL = 8 and the best storage cost when L = 4 (see Figs. 7(a)and 8(a)). Moreover, R-tiles require more storage than S-tiles.

4.4. Comparison of COVET indexes with a cell-based index

Now we compare the two COVET indexes with CQI in-dex. For CQI, we used two different cell sizes: 1 × 1 and8 × 8. Figs. 9(a) and 9(b) show the total reevaluation times(in seconds) and the total storage costs (in M bytes), re-

100

101

102

0

5

10

15

re

−e

va

lua

tio

n t

ime

(se

co

nd

s)

re−evaluation time

100

101

102

10

20

30

40

index s

torage (

M b

yte

s)

max. tile side length

(a) W=40; R−tiles

index storage

100

101

102

40

60

80

100

120

140

160

180

re

−e

va

lua

tio

n t

ime

(se

co

nd

s)

re−evaluation time

100

101

102

15

20

25

30

35

40

45

50

index s

torage (

M b

yte

s)

max. tile side length

(b) W=80; R−tiles

index storage

Figure 8. The impacts of tile size on reevalu-ation time and index storage cost for R-tileswhen (a) W = 40 (b) W = 80.

spectively, for the four schemes as |Q| varies from 1,000 to16,000. For this experiment, L = 8, W = 40, M = 1,and |O| = 50, 000. These two figures show that the twoCOVET indexes perform better than the CQI index, espe-cially when |Q| is large. This is because they can capital-ize on the incremental changes in object locations. How-ever, the performance advantage is achieved with a modestincrease in storage cost. This is because we use more vir-tual tiles than cells if the maximum tile size is the same asthe cell size. Between the two COVET indexes, S-tiles re-quire less storage cost than R-tiles. For the cell-based in-dex, a smaller cell size incurs a larger storage cost (see thecase for 1 × 1 cell size). A larger cell size can substantiallyreduce the storage cost, but the total reevaluation time in-creases, especially as |Q| increases. Note that the cell-basedindex with 1×1 is equivalent to COVET with L = 1. How-ever, the storage cost will be too high for both COVET andCQI (see Figs. 7(b), 8(b) and 9(b)).

5. Summary

We have presented a novel query index for efficient eval-uation of continual range queries against moving objects.The objective is to quickly provide answers to continualrange queries that locate the moving objects within thequery boundaries. The new query index is based on the con-cept of strictly covering a range query with one or moretiles. The use of covering tiles removes the ambiguity ofwhether a point is inside the boundaries of a range query.As a result, query reevaluation with the proposed COVETindex can take advantage of the incremental changes in ob-ject locations. We have presented systematic and efficientalgorithms to find a set of tiles to cover a range query andto locate the tiles that contain any object location. We have

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE

Page 8: [IEEE IEEE International Conference on e-Technology, e-Commerce and e-Service, 2004. EEE '04. 2004 - Taipei, Taiwan (2004.03.31-2004.03.31)] IEEE International Conference on e-Technology,

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

x 104

0

5

10

15

20

25

30

35

40

45

total number of range queries (|Q|)

Re

−e

va

lua

tio

n t

ime

(se

co

nd

s)

(a) Evaluation Time

Cell−based (1x1)Cell−based (8x8)COVET (8x8)

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

x 104

0

10

20

30

40

50

60

total number of range queries (|Q|)

To

tal in

de

x s

tora

ge

co

st

(M

byte

s)

(b) Index Storage

Cell−based (1x1)Cell−based (8x8)COVET (8x8)

Figure 9. Comparisons of COVET indexeswith a cell-based index under different |Q|sw.r.t. (a) total reevaluation time, and (b) totalstorage cost.

also described the method to incrementally reevaluate rangequeries using the COVET index.

Simulations have been conducted to evaluate the impactsof tile size and shape and to compare the COVET index witha cell-based index. The results show that (1) tile size shouldnot be too small or too large and the optimal size dependson query size distribution; (2) square-only tiles are gener-ally better than rectangular tiles as they require less storagewhile achieving comparable performance; (3) COVET in-dex performs better than cell-based index in total reevalua-tion time because it can capitalize on incremental changesin object locations.

References

[1] P. K. Agarwal, L. Arge, and J. Erickson. Indexing movingobjects. In Proc. of ACM PODS, 2000.

[2] M. K. Aguilera, R. E. Strom, D. C. Sturman, M. Astley, andT. D. Chandra. Matching events in a content-based subscrip-tion system. In Proc. of Symp. on Principles of DistributedComputing, 1999.

[3] Y. Cai and K. A. Hua. An adaptive query management tech-nique for real-time monitoring of spatial regions in mobiledatabase systems. In Proc. of Int. Performance, Computing,and Communication Conference, 2002.

[4] J. Chen, D. DeWitt, F. Tian, and Y. Wang. NiagaraCQ: Ascalable continuous query system for Internet databases. InProc. of ACM SIGMOD, pages 379–390, 2000.

[5] H. D. Chon, D. Agrawal, and A. E. Abbadi. Query process-ing for moving objects with space-time grid storage model.In Proc. of 3rd Int. Conf. on Mobile Data Management, 2002.

[6] H. D. Chon, D. Agrawal, and A. E. Abbadi. Range and kNNquery processing for moving objects in grid model. MobileNetworks and Applications, to appear.

[7] F. Fabret, H. A. Jacobsen, F. Llirbat, J. Pereira, K. A. Ross,and D. Shasha. Filtering algorithms and implementation forvery fast publish/subscribe systems. In Proc. of the ACMSIGMOD, 2001.

[8] L. Forlizzi, R. H. Guting, E. Nardelli, and M. Scheider. Adata model and data structures for moving objects. In Proc.of ACM SIGMOD, 2000.

[9] V. Gaede and O. Gunther. Multidimensional access methods.ACM Computing Surveys, 30(2):170–231, June 1998.

[10] R. H. Guting, M. H. Bohlen, M. Erwig, C. S. Jensen, N. A.Lorentzos, M. Schneider, and M. Vazirgiannis. A foundationfor representing and querying moving objects. ACM TODS,25(1):1–42, Mar. 2000.

[11] A. Guttman. R-trees: A dynamic index structure for spatialsearching. In Proc. of ACM SIGMOD, 1984.

[12] E. Hanson and T. Johnson. Selection predicate indexing foractive databases using interval skip lists. Information Sys-tems, 21(3):269–298, 1996.

[13] D. V. Kalashnikov, S. Prabhakar, W. G. Aref, and S. E. Ham-brusch. Efficient evaluation of continuous range queries onmoving objects. In Proc. of 13th Int. Conf. on Database andExpert Systems Applications, 2002.

[14] G. Kollios, D. Gunopulos, and V. J. Tsotras. On indexingmobile objects. In Proc. of ACM PODS, 1999.

[15] L. Liu, C. Pu, and W. Tang. Continual queries for Inter-net scale event-driven information delivery. IEEE TKDE,11(4):610–628, July/Aug. 1999.

[16] H. K. Park, J. H. Son, and M. H. Kim. An efficient spa-tiotemporal indexing method for moving objects in mobilecommunication environments. In Proc. of Int. Conf. on Mo-bile Data Management, 2003.

[17] D. Pfoser, C. S. Jensen, and Y. Theodoridis. Novel ap-proaches to the indexing of moving object trajectories. InProc. of VLDB, 2000.

[18] S. Prabhakar, Y. Xia, D. V. Kalashnikov, W. G. Aref, andS. E. Hambrusch. Query indexing and velocity constraintedindexing: Scalable techniques for continuous queries onmoving objects. IEEE Trans. on Computers, 51:1124–1140,Oct. 2002.

[19] H. Samet. Design and Analysis of Spatial Data Structures.Addison-Wesley, 1990.

[20] A. P. Sistla, O. Wolfson, S. Chamberlain, and S. Dao. Mod-eling and querying moving objects. In Proc. of ICDE, 1997.

[21] S. Saltenis, C. S. Jensen, S. T. Leutenegger, and M. A. Lopez.Indexing the positions of continuously moving objects. InProc. of ACM SIGMOD, 2000.

[22] O. Wolfson, S. Chamberlain, S. Dao, L. Jiang, andG. Mendez. Cost and imprecision in modeling the positionof moving objects. In Proc. of ICDE, 1998.

[23] O. Wolfson, A. P. Sistla, S. Chamberlain, and Y. Yesha. Up-dating and querying databases that track mobile units. Dis-tributed and Parallel Databases, 7(3):257–387, 1999.

[24] K.-L. Wu, S.-K. Chen, and P. S. Yu. VCR indexing for fastevent matching for highly-overlapping range predicates. InProc. of 2004 ACM Symp. on Applied Computing, 2004.

[25] K.-L. Wu and P. S. Yu. Efficient query monitoring usingadaptive multiple key hashing. In Proc. of ACM CIKM, pages477–484, 2002.

Proceedings of the 2004 IEEE International Conference on e-Technology, e-Commerce and e-Service (EEE’04)

0-7695-2073-1/04 $20.00 © 2004 IEEE