<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Relational Implementation of Multi-dimensional Indexes for Time Series</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Tomasz Nykiel</string-name>
          <email>tnykiel@cs.toronto.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Parke Godfrey</string-name>
          <email>godfrey@cse.yorku.ca</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Toronto</institution>
          ,
          <addr-line>Toronto ON</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>York University</institution>
          ,
          <addr-line>Toronto ON</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Similarity search over time-series data is a useful, but expensive, application. Sequence data can be transformed via an orthonormal transformation, which is then dimensionally reduced, to be indexed. Rtrees and R*-trees have been used for this purpose. These do not scale well, however, for very large datasets. We propose a new indexing data-structure within relational tables, indexed with B+-tree indexes. We employ SQL in the retrieval process, and achieve sequential, instead of random I/O, access. We perform comprehensive experiments to test and compare our proposed technique against existing solutions, and demonstrate it to be scalable and more efficient for very large datasets.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Time-series data record values of a measure at sequential points in time. The
need for search over such data arises in many real-world applications. Mining
astronomical [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ] and biomedical data [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] are large challenges, due to sizes of
the datasets involved. Time-series similarity matching is used as a subroutine in
many applications in knowledge discovery in databases (KDD), such as clustering,
classification, mining association rules, and future trend discovery.
      </p>
      <p>
        Most techniques perform dimensionality reduction, and use spatial access
methods to index the data in the transformed space. The indexes can be used to
store and index all the (contiguous) sub-sequences of a given window size. The
R-tree has been the standard approach for the indexing. Techniques that have
been used for dimensionality reduction include, among others, DFT [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] DWT [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
SVD [
        <xref ref-type="bibr" rid="ref6 ref7">6, 7</xref>
        ], and PAA [
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ].
      </p>
      <p>
        Keogh and Kasetty [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] presented a comprehensive overview of the
problems with existing solutions. First, the indexing approaches do not scale. It is
intended they reside in main memory. They do not perform well as external
indexes—that is, when stored on, and used from, disk—because inherently
random access patterns. Second, the indexes grow exponentially with respect to the
dimensionality. Our research concentrates on developing easy-to-scale indexing
techniques that can be built within, and tuned for, standard relational platforms,
to enable efficient similarity search for very large datasets.
      </p>
      <p>We have developed a multi-dimensional indexing data structure called the
SQL “R” tree (SQLRtree). It does not characterize all the feature points, but
groups them into regions called minimum bounding rectangles (MBRs). These
are then stored in an index tree. The structure is multi-resolutional with respect
to different window sizes. The index tree is mapped as a table which is indexed
with B+-tree indexes. We achieve sequential access patterns in the retrieval
process by judicious design of the underlying indexes and retrieval queries.</p>
      <p>We implement two SQL-based retrieval procedures: PrefixSearch and
MultiMatching. The first does not exploit the index fully, but relies on faster pruning.
The second combines information from different window sizes—or multiple
instances of the same window size—to match more precisely the query sequence.
We investigate the trade-offs between these two approaches. The procedures are
carefully designed and implemented so that the query plans issued by the query
optimizer support fast retrieval and efficient disk access patterns. Our
analysis and experiments confirm this, and demonstrate that our approach is highly
scalable, and outperforms the standard R-tree indexes.</p>
      <p>Ultimately, one might extend relational systems to handle time-series data
naturally, and to embed needed techniques into the platform to handle similarity
search efficiently. An intermediate approach—the one that we take—is to build
indexes for time-series data on top of the existing relational platform, and to
handle similarity queries via SQL. A disadvantage is that one may pay various
overhead, which one could potentially avoid if one built from scratch. The
advantage is that one can leverage the technology of the relational system, such as
buffer pool management, query optimization, and standard, external indexes.</p>
      <p>In §2, we review the relevant work to multidimensional indexing in
timeseries searches. In §3, we present the design of the SQLRtree. In §4, we present
a performance evaluation and analyze the results. In §5, we summarize our
contributions, and offer conclusions.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Background and Related Work</title>
      <p>Indexes can improve greatly the performance for querying time series. This has
two orthogonal aspects: (1) a dimensionality reduction to a small, fixed number
of dimensions (coefficients) to index; and (2) the index data-structure itself.</p>
      <p>A time-series sequence of length n can be considered as a point in n-dimensional
space. This n is usually too large—and likely not fixed—for indexing.
Commonly, eight to twelve (k) coefficients are used. Retrieval is infeasible with more
coefficients, as the index’s size grows rapidly with the number of dimensions.
Once a viable dimensionality reduction is in place, one still has to index these
k-dimensional points efficiently. Our work is focused on this second task.</p>
      <p>One cannot reasonably restrict focus to just sequences that exactly match the
query, as these would be exceedingly rare. Instead, one wants to find sequences
that are within a given distance . Thus, the index structure must support range
queries. The dimensionality reduction technique must preserve distances, so not
to introduce any false dismissals. That is, all sequences that ultimately match to
within are likewise found in the reduced space. This may, however, introduce
false alarms. Any such distance-preserving reduction is called orthonormal.</p>
      <p>
        Agrawal et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] proved that using k initial coefficients of the discrete Fourier
transform (DFT) is orthonormal. They called this the F-index. Chan and Fu [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
proved likewise for the discrete wavelet transform (DWT). Other reduction
techniques have been proved to be distance preserving too, making them suitable for
the task. The choice of which reduction is best for time-series queries is still quite
debated. For our work, we use the discrete wavelet transform (DWT).3 Once the
candidate matches are found by the index, it is necessary in a post-processing
step to scan and test the original data, to dismiss the false alarms.
      </p>
      <p>In the literature, first to be considered was whole matching; the query
sequence and the target sequences must have the same length. Sub-sequence
matching generalizes this by allowing the query to be shorter than the target;
the task then is to find best matching sub-sequences among the targets. Some
work fixed the size of the query sequence allowed, as a simplification. Permitting
variable-length queries is, of course, much more useful.</p>
      <p>
        Faloutsos et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] improved on the F-index method for whole-matching
queries by using MBRs. This Gemini Framework is the basis for much of the
subsequent work. One sets a minimum query length of w. Target sequences may
be of varying length. A sliding window of size w is passed over the sequences to
index their contiguous sub-sequences (of length w). For each window placement,
the indexable features are extracted (using one’s choice of orthonormal
transform). A sequence of length n is thus mapped to a curve, or trail, in the feature
space (of the index of k dimensions). This trail consists of n − w + 1 points.
      </p>
      <p>The trail of a given sequence is divided into sub-trails. Each sub-trail is then
represented by its MBR. (An MBR can be represented by its lower left and
upper right corners, thus by two vectors of length k.) Only the MBRs are then
indexed. This still preserves the property of no false dismissals.</p>
      <p>When the query length is w, the algorithm is similar to whole matching.
The query sequence is first mapped into the feature space. Given this query
“point”, all MBRs that intersect with the query rectangle—the query’s point in
the projected, transformed space, plus or minus —are fetched. A post-processing
step examines the retrieved sub-sequences to discard all false alarms.</p>
      <p>The case of queries longer than w is more complex, since the index contains
information only about sub-sequences of length w. The authors introduced two
methods for handling this: PrefixSearch and MultiPiece. PrefixSearch simply
queries with the query’s prefix sequence (Q ) of length w. Of course, this does not
take full advantage of the index and query. MultiPiece splits the query sequence
in p pieces of length w. Each sub-query of length w is then processed, and the
resulting sets of candidate matches are intersected. This takes fuller advantage
of the index to introduce fewer false alarms, but pays extra computational cost.
3 The distance between two sequences x and y of equal length k can be measured
in different ways. The distance preserving reductions preserve with respect to any
proper distance metric. Which metric is best suited to time-series is also still debated.
We use Euclidean distance, a common choice.</p>
      <p>
        The matching task is complicated when the lengths of the data and query
sequences are variable. Kahveci and Singh [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] introduced indexing with multiple
window sizes. Let l be the longest sequence in the database. For some integer b,
2b ≤ |l| ≤ 2b+1. Let the minimum length of a query be 2a, and assume a ≤ b
(which is reasonable). Let s1, s2, . . . , sn be the sequences in the database. One
must then store a grid of indexes Ti,j ; i ranges from a to b, and j from 1 to n.
      </p>
      <p>Search works as follows. Given some query of size x2a, and a range , it is
partitioned as by “binary representation” into non overlapping sub-queries. Each
sub-query is then a different window size. That is, the query Q is partitioned to
Q1, Q2, . . . , Qt with |qi| = 2ci and a ≤ c1 &lt; . . . &lt; ci &lt; . . . &lt; ct ≤ b. A search
for Q1 using the first row in the index is performed, using the corresponding
window size. This repeats for the remaining segments of Q. An advantage of the
approach over MultiPiece is that the number of sub-queries is smaller compared
The drawback is that it uses more storage for the different window sizes.4</p>
      <p>
        Most work has chosen for its index data structure to use R-trees (or
R*trees). The R-tree spatial index was introduced by Guttman [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. It is similar
to the B-tree, but better suited for multi-dimensional data. It splits the space
into hierarchically nested minimum bounding rectangles (MBRs). These MBRs
are permitted to overlap. An R-tree node may have a variable number of entries,
with a pre-specified minimum and maximum number of entries to store. As with
a B-tree, each node must be filled to at least half capacity, with the exception
of the root node. A non-leaf node records the MBR that encloses its children,
and identifiers for them. A leaf entry stores the MBR of the data elements
belonging to it, and identifiers for them. While R-trees provide no guarantees on
worst-case performance, they have been found to work well in many real-world
applications.5
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], the authors pursue a goal similar to ours. They simulate R-trees
in relational tables with B+-tree indexes to handle multi-dimensional data. Our
technique indexes the MBRs in a different way, exploiting the locality of patterns
in time series, enabling sequential scans.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Design of the SQLRtree</title>
      <p>Our key concern is to design the physical database and access methods (SQL
queries) to ensure access is primarily via sequential reads. We err on the side
of simplicity in our design, to ensure scalability. We build the SQLRtree
“index” in tables. We use B+-tree indexes to support fast retrieval. The SQLRtree
building and retrieval procedures are then implemented via recursive SQL, in
a simple, declarative manner. We assure the procedures are translated by the
query optimizer into efficient query plans that exploit the indexes as we intend.</p>
      <sec id="sec-3-1">
        <title>4 Methods for compressing their index were proposed in [12].</title>
        <p>
          5 A number of variants of this basic idea have followed, including the R*-tree,
introduced by Beckmann et al. [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]. This uses a revised node-split algorithm to force
reinsertions to achieve better balance. The overhead of this reinsertion algorithm,
however, is significant, and would be infeasible for very large datasets.
SQLRtree. The SQLRtree data-structure is similar to the R-tree. It is a tree of
hierarchically nested, k -dimensional bounding boxes. Each node has a variable
number of children, not to exceed some fixed ceiling. Each non-leaf node stores
the MBR of the children nodes, and identifiers for the children. Each leaf-node
stores the MBR of its underlying feature points, and the information needed
to identify them. Feature points are grouped according to (identifiers of) their
sequence positions. Thus, the only information needed to identify the children
of a node is the identifier of the first child and the number of children. Each tree
indexes one given sequence at one given window size.6 To index all sequences, a
forest of trees is constructed for each window size, and for each sequence.
Functionality. The following operations on the SQLRtree are supported.
        </p>
        <p>Bulk-build. This is used to build initially the tree, and capitalizes on
sequential I/O. Feature points are placed in the same order as in their sequences. Each
sequence can be scanned with a sliding window to group the feature points into
level 0 boxes. Once the level 0 nodes are finished, the level 1 nodes are
created with the same strategy. Each node contains a fixed number of children (the
fan-out parameter). The bulk build continues until just a single node is created.
Here, MBRs are grouped geographically, which is a distinct departure from the
R-trees. This will not result in optimal box grouping. However, it is possible to
bulk-build the tree (critical for very large datasets). Due to data locality in the
actual data (adjacent data points in the time series do not change dramatically,
on average), our MBRs should still be compact and filter well.</p>
        <p>Insertions. For time-series data, insertions take place at the end of the
sequences. As feature-point placement is the same as in the sequence, new points
fall to the right shoulder of the SQLRtree. No redistribution is necessary.</p>
        <p>Deletions. Deletions usually take place at the beginning of the sequences, and
affect only the left shoulder of the tree. No redistribution is necessary.</p>
        <p>Retrieval. The input of a search is a query box. The search begins with the
root node. For each considered node, it is determined whether the query box
intersects with the node’s MBR. If not, the node’s sub-tree is pruned. If so, the
process continues recursively down the sub-tree.</p>
        <p>
          Relational Schema. The SQLRtree and the original data are stored in tables.
Thus, they do not rely on main-memory structures. The database system collects
detailed statistics on the tables on each column. The schema is as follows.
SEQVAL stores the original data. Each row represents a data sample via a
sequence identifier, an offset, and the value itself (a double precision float).
BRECT stores the information about the nodes in the SQLRtree: the sequence
id, the window size, the node’s level in the tree, and its offset within its level.
The row also includes the two vectors describing the bounding rectangle. Finally,
included are the identifier of the first child and the number of children. For
indexing eight dimensional (8d) space, its columns are SEQ ID, WIND SIZE,
LEVEL, LEVEL ID, N0, . . ., N7, X0, . . ., X7, FIRST ID, and CNT. The N’s
and the X’s are doubles, representing MBR’s “corners”; the rest are integers.
6 We apply the multi-resolution approach of [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] for more efficient retrieval.
        </p>
        <p>In addition, we use the database’s indexing facility to enable fast access. A
unique, clustered, B+-tree index is declared on each of the two fact tables.
ICLSEQVAL indexes SEQVAL by sequence identifier and offset. Its key is SEQ ID
asc, OFFESET asc. VALUE is an included column in the index.</p>
        <p>ICLBRECT indexes BRECT by sequence identifier, window size, level, and the
identifier within the level. Its key is SEQ ID asc, WIND SIZE asc, LEVEL asc,
LEVEL ID asc.7 As ICLBRECT is clustered, the records are sorted by the index
key. As all the children of a qualifying node need to be fetched, this can be done
now by sequential reads.</p>
        <p>
          Retrieval Procedures. It cannot be assumed, of course, that the SQLRtree
will contain a window size that matches the length of the query. We adapt
two retrieval procedures. The first, PrefixSearch, uses only a prefix of the query
of a length equal to one of the stored window sizes (as in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]). The second,
MultiMatching, uses the subsequent parts as well (similar to [
          <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
          ]).
        </p>
        <p>Our PrefixSearch procedure is implemented by a recursive SQL query. Fig. 1(a)
shows a generated SQL query for this based on a given query and threshold that
traverses the SQLRtree to fetch all matching leaf node identifiers. The
example SQL query uses a window size of 32. The recursive base fetches the root
of the tree. The query box is tested against the MBR, represented by columns
N0, ..., N7 and X0, ..., X7, which represents the lower “left” and upper “right” of
7 The feature vectors themselves cannot be included in the index without incurring
significant space overhead.
the eight-dimensional MBR. The numbers are representing the query point plus
or minus ; they are derived on the fly from user query.</p>
        <p>The recursive part iterates level by level over the previous level’s qualifying
nodes. The join is on the identifier of the first child, and the number of children, as
described above. The recursion continues until either no remaining nodes qualify,
or it reaches level 0 of the SQLRtree, the leaf nodes. Since the feature points
underlying the leaf nodes are clustered positionally, the index record suffices to
determine the offsets to the data records to examine. The SQL query itself does
not dictate how this will be executed. The query optimizer determines that.</p>
        <p>MultiMatching is executed as follows. First, the index is searched using the
prefix of the query point, as in PrefixSearch. Then, for each matching leaf node,
the subsequent segments of the query are checked. These leaf nodes can be
located based on the offsets in the query and on the identifier of the leaf node that
matched the prefix. Thus, the leaf nodes corresponding to subsequent segments
of the query can be fetched directly from the BRECT table.</p>
        <p>
          We have choices for how we match the subsequent segments. The segments
can be equal lengths. The longest possible prefix can be used, and then the
subsequent parts use smaller window sizes. Fig. 1(b) shows the subsequent filtering
step after fetching leaf nodes that match the query point.8 In the example, the
leaf occupancy is 32 and the window size is 32, as well. The subsequent filtering
process involves only qualifying leaf nodes, from level 0. These are accessed
directly from the BRECT table. Regardless of the technique used, there is always
the need to scan the original data to prune the false alarms, which is further
discussed in [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
4
4.1
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Experiments</title>
      <sec id="sec-4-1">
        <title>The Setup</title>
        <p>Environment. The machine used in the evaluation is a server with two
quadcore Intel Xeon 3.20 GHz processors. The storage consists of 3.2Tb RAID system.
The main memory size is 4Gb. The RDBMS used is IBM DB2 v 9.1.3. The buffer
pool size in each experiment was set conservatively at 40Mb.</p>
        <p>
          Datasets. Three synthetic datasets were used, due to the lack of publicly
available very large time-series. We used Brownian noise data [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Dataset 1 and
2 were approximately 30Gb, each holding a sequence of length 1,000,000,000.
Dataset 3 was 120Gb, holding a sequence of 4,000,000,000 data samples. The
definition of Brownian noise is xt+1 = xt + δ where δ ∈ [−step, +step]. The delta
was chosen uniformly at random within plus or minus step. The parameters were
set to x0 = 1.5 and step = 0.001 [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. A number of control probes (of length 270)
were inserted uniformly at random into the data, enabling us to determine in
advance the query selectivity. The query selectivities were 0.1% for Datasets 1
and 3, and 0.001% for Dataset 2. For each dataset, indexes were built for window
        </p>
        <sec id="sec-4-1-1">
          <title>8 The PrefixSearch step is omitted for brevity.</title>
          <p>
            sizes varying from 32 to 128, for dimensionalities varying from 8 to 32. Extensive
experiments can be found in [
            <xref ref-type="bibr" rid="ref16">16</xref>
            ].
          </p>
          <p>
            The only research that we are aware of for very large time-series is [
            <xref ref-type="bibr" rid="ref17">17</xref>
            ];
however, this is for a very large number of sequences of fixed length and only for
whole matching. Our index is to support sub-sequence matching and
accommodates variable length queries and arbitrary sequence lengths.
          </p>
          <p>
            Scenarios. We tested our technique under multiple scenarios. For evaluating
PrefixSearch, three prefix test scenarios are considered, each using a different
window size (w) to match the query prefix: 32, 64, and 128. The prefix is matched
with the same distance as for the whole query. For evaluating MultiMatching,
six multi scenarios are evaluated. Five of these test the technique using a single
window size (as in [
            <xref ref-type="bibr" rid="ref11">11</xref>
            ]): 2*128, 2*64, 4*64, 2*32, and 8*32. Three of these—
2*128, 4*64, and 8*32—use as much of the query sequence as possible. Two of
these—2*64 and 2*32—do not, but allow us to evaluate the overhead introduced
by the MultiMatching filtering (in multiple stages) versus the benefit of increased
selectivity. The last multi test, 128+64+32, uses the multi-resolutional approach.
First, PrefixSearch is applied with a 128 length prefix. Then, window sizes 64
and 32 are used in two filtering steps. In the scenarios with multi-stage matching,
the distance threshold is applied to each segment.
          </p>
          <p>We evaluated the standard R-tree approach.9 The indexes were built at only
window size 32 due to the requisite preprocessing time. This one window size
suffices to show the infeasibility of the standard approach for large datasets. For
the standard approach, we tested prefix 32, multi 2*32, and multi 8*32.</p>
          <p>The query used for testing is the same as the probe inserted in the data
in the generation phase. The distance is set to a value which allows more
sub-sequences match than just the number of probes inserted. We compare the
indexing techniques only, without checking candidates against actual data.
4.2</p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>Query Plans</title>
        <p>We next consider the query plans generated by the query optimizer to traverse
the SQLRtree. We show that the query plans behave as we designed.
PrefixSearch. Fig. 2(a) shows the plan automatically generated by DB2 for
PrefixSearch. The plan first identifies the original data offsets that are candidates.
All windows starting at these offsets must be examined.</p>
        <p>Base Case. The right side of the tree, operators (25) and (27), access the root
node of the SQLRtree in BRECT. The access path uses the index ICLBRECT,
as expected. The root record is fetched, and tested against the query rectangle.
Recursion. Operator (11) scans the qualifying nodes from the previous iteration.
The nodes are joined with their children via nested-loop join (9). Operator (16)
fetches the children, accessing the BRECT table—indirectly, via an index-only
plan—using the clustered B+-tree index ICLBRECT (22). For each ICLBRECT
index entry, the record is fetched from the BRECT table and checked against
the query box. Since the ICLBRECT index is clustered on appropriate columns,
9 We did not consider R*-trees here as the time to construct them would be prohibitive.
(a) PrefixSearch.</p>
        <p>(b) MultiMatching.
fetched children nodes are on sequential pages. This exploits data locality, as
many pages that are needed are already in the buffer pool. Once the current
level is evaluated, the recursion iterates for the next level.</p>
        <p>MultiMatching. Fig. 2(b) shows an example of the MultiMatching plan.
Prefix. The omitted part on the left is the same as in the previous example. It
evaluates the candidate leaf nodes that match the prefix of the query.
Subsequent Segments. Once a leaf node has qualified, the two subsequent
segments are checked. Two nested loop joins (3) and (5) fetch the leaf nodes that
contain the subsequent segments of the qualifying sub-sequences. The logical
SQLRtree is not traversed; rather, these leaf nodes are fetched directly, (36)
and (41), using the ICLBRECT index. Once a subsequent-segment leaf node is
fetched, the BRECT table is accessed to retrieve its MBR.</p>
        <p>When the segments are all the same window size, the leaf nodes fetched by
(34) and (39) are likely to be already in the buffer pool. This also true of the
index pages when the ICLBRECT index is accessed in (36) and (41), because the
SQLRtree nodes are clustered by level identifier. However, when the segments
are of different sizes, different pages have to be accessed, which increases the I/O
load. When more segments of the query are used, the query plan is analogous.
4.3</p>
      </sec>
      <sec id="sec-4-3">
        <title>Time Results</title>
        <p>We present a performance analysis. First, we demonstrate that R-trees are not
scalable to very large datasets. Next, we present results for the SQLRtree.</p>
        <p>Dataset 1 is generated to have low selectivity with the probe query; that
is, there are a high number of matches. Dataset 2 is reasonably highly selective,
which allows us to measure likely performance of our method in real applications.</p>
        <p>Fig. 3. R-trees: 8d &amp; 16d.
(a) Number of fetched MBRs</p>
        <p>For Datasets 1 and 3, the probe is inserted, on average, at every 1000 offsets.
The fan-out of the SQLRtree is set to 32. This means that each level 0 node
covers 32 offsets in the original sequence; so each level 1 node covers 1024 points.
Since the probe distribution is uniform, all level 1 nodes are likely to intersect
with the query rectangle. This implies that all level 0 nodes have to be examined
(worst-case scenario). In the case of the R-tree approach, this is not the case. As
bounding boxes are clustered based on their neighborhoods, the whole structure
does not likely have to be traversed. Our results show, however, that SQLRtree
outperforms R-trees in this scenario. For Dataset 2, the probe is inserted, on
average, at every 100,000 offsets. The datasets each consist of one sequence.
However, note that multiple sequences are easily accommodated in our schema.
R-Tree. For the standard approach, Fig. 3(a) reports the execution times for
the two datasets for each of the scenarios described above. The execution times
for Dataset 1 are high (up to 20 minutes), even though the number of bounding
boxes fetched in prefix 32 did not exceed 6% of the total. It has been claimed
that R-trees work efficiently for queries with selectivities of up to 10%.</p>
        <p>The time to perform multi 2*32 and multi 8*32 for Dataset 1 were longer—
two and eight times (2 hours), respectively—than for prefix 32, which confirms
minimal page reuse. For Dataset 2, the time needed for multiple matching did
not grow linearly with the number of segments. This suggests that many pages
are reused subsequently. However, the times are still up to 11 minutes. Fig. 3(b)
presents the results for the test that used 16 coefficients for indexing. The
retrieval time went dramatically up (up to 4 hours). The standard R-tree indexing
technique is not efficient for large datasets or high-dimensional indexing.
SQLRtree. We report the performance of the SQLRtree under the different
scenarios for Dataset 1, for 8d and 32d trees. Fig. 4 reports the number of fetched
(a) 8d
boxes (a) and the time spent (b). For the 8d structure in multi-matching, the time
needed for 2-stage matching is 15% higher than for the prefix search only. For
4stage matching, it is 25% more, and for 8-stage, 45% higher. This demonstrates
beneficial locality in the buffer pool. For multi 128+64+32 involving different
window sizes, the performance degrades significantly, since the locality effect
enjoyed by single-size filtering is lost. For the 32d index, the time is never more
than 50% higher than for the 8d indexing. The 8-stage matching for this took
only 389 seconds. The R-tree using 16 coefficients took more than 4 hours.</p>
        <p>We next consider Dataset 2 (higher selectivity). Fig. 5 reports the results
for the 8d and 16d trees. Only for case of prefix 32 for 8 dimensions the R-tree
yields similar performance as our technique. In other cases the use of SQLRtree
introduces remarkable savings. Interestingly, the 16d index performs better than
the 8d one. Its greater precision allows for more aggressive pruning.</p>
        <p>We evaluated the SQLRtree on Dataset 3 of four billion data samples (120
Gb), generated with the same parameters as Dataset 1, yielding the same
selectivity with respect to the query. The index was only built for a window size
of 32—the scenario closest to worst case—as the selectivity of the query prefix
of length 32 is the lowest. We tested both PrefixSearch and MultiMatching. The
resulting SQLRtree is four times the size of the index for Dataset 1, and so sized
up linearly. Fig. 6 reports the comparison of execution times for 8d and 16d
between the test cases for Datasets 1 and 3. The times scale linearly also.</p>
        <p>The experiments demonstrate the performance of the SQLRtree does not
degrade significantly with query selectivity. Even in the worst case scenario,
the appropriate data alignment yields significant speed-up. Our technique scales
linearly with respect to the dimensionality and scales to high dimensionality.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>There has been little research devoted to efficient indexing for similarity search
that scales to datasets of tens or hundreds of gigabytes. We have proposed a
novel index data structure called the SQLRtree, mapped onto standard
relational structures, together with the retrieval procedures. It uses B+-tree indexes
to ensure access optimization. The design handles efficient retrieval for range
queries with low selectivity, and can use any orthonormal dimensionality
reduction technique and any distance metric. Our technique has the advantage that it
is realized in external storage, which makes it easily scaled. We establish via
performance evaluation that our technique scales to very large datasets efficiently.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Subba</given-names>
            <surname>Rao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Priestley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.B.</given-names>
            ,
            <surname>Lessi</surname>
          </string-name>
          ,
          <string-name>
            <surname>O.</surname>
          </string-name>
          :
          <article-title>Applications of time series analysis in astronomy and meteorology</article-title>
          .
          <source>London Chapman and Hall</source>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>2. : MACHO project. http://wwwmacho.anu.edu.au/</mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Zeger</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Irizarry</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peng</surname>
          </string-name>
          , R.:
          <article-title>On time series analysis of public health and biomedical data</article-title>
          .
          <source>Technical Report 1054</source>
          , Johns Hopkins University (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Agrawal</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faloutsos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swami</surname>
            ,
            <given-names>A.N.</given-names>
          </string-name>
          :
          <article-title>Efficient similarity search in sequence databases</article-title>
          . In: FODO '
          <fpage>93</fpage>
          . (
          <year>1993</year>
          )
          <fpage>69</fpage>
          -
          <lpage>84</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>K.</given-names>
            <surname>Chan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.W.</given-names>
            <surname>Fu</surname>
          </string-name>
          :
          <article-title>Efficient time series matching by wavelets</article-title>
          .
          <source>In: ICDE '99</source>
          . (
          <year>1999</year>
          )
          <fpage>126</fpage>
          -
          <lpage>133</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Kanth</surname>
            ,
            <given-names>K.V.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Agrawal</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Singh</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Dimensionality reduction for similarity searching in dynamic databases</article-title>
          .
          <source>SIGMOD Rec</source>
          .
          <volume>27</volume>
          (
          <issue>2</issue>
          ) (
          <year>1998</year>
          )
          <fpage>166</fpage>
          -
          <lpage>176</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Korn</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jagadish</surname>
            ,
            <given-names>H.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faloutsos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Efficiently supporting ad hoc queries in large datasets of time sequences</article-title>
          .
          <source>SIGMOD Rec</source>
          .
          <volume>26</volume>
          (
          <issue>2</issue>
          ) (
          <year>1997</year>
          )
          <fpage>289</fpage>
          -
          <lpage>300</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Keogh</surname>
            ,
            <given-names>E.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pazzani</surname>
            ,
            <given-names>M.J.:</given-names>
          </string-name>
          <article-title>A simple dimensionality reduction technique for fast similarity search in large time series databases</article-title>
          . In: PAKDD '
          <fpage>00</fpage>
          . (
          <year>2000</year>
          )
          <fpage>122</fpage>
          -
          <lpage>133</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Yi</surname>
            ,
            <given-names>B.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faloutsos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Fast time sequence indexing for arbitrary lp norms</article-title>
          . In: VLDB '
          <fpage>00</fpage>
          . (
          <year>2000</year>
          )
          <fpage>385</fpage>
          -
          <lpage>394</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Keogh</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kasetty</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>On the need for time series data mining benchmarks: A survey and empirical demonstration</article-title>
          .
          <source>In: KDD</source>
          . (
          <year>2002</year>
          )
          <fpage>102</fpage>
          -
          <lpage>111</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Faloutsos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ranganathan</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manolopoulos</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Fast subsequence matching in time-series databases</article-title>
          .
          <source>SIGMOD Rec</source>
          .
          <volume>23</volume>
          (
          <issue>2</issue>
          ) (
          <year>1994</year>
          )
          <fpage>419</fpage>
          -
          <lpage>429</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Kahveci</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Singh</surname>
            ,
            <given-names>A.K.</given-names>
          </string-name>
          :
          <article-title>Variable length queries for time series data</article-title>
          . In: ICDE '
          <fpage>01</fpage>
          . (
          <year>2001</year>
          )
          <fpage>273</fpage>
          -
          <lpage>282</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Guttman</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>R-trees: a dynamic index structure for spatial searching</article-title>
          . In: SIGMOD '
          <fpage>84</fpage>
          . (
          <year>1984</year>
          )
          <fpage>47</fpage>
          -
          <lpage>57</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Beckmann</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kriegel</surname>
            ,
            <given-names>H.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seeger</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <string-name>
            <surname>The</surname>
            <given-names>R</given-names>
          </string-name>
          *
          <article-title>-tree: An efficient and robust access method for points and rectangles</article-title>
          . In: SIGMOD '
          <fpage>90</fpage>
          . (
          <year>1990</year>
          )
          <fpage>322</fpage>
          -
          <lpage>331</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. Bo¨hm,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Berchtold</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Kriegel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.P.</given-names>
            ,
            <surname>Michel</surname>
          </string-name>
          ,
          <string-name>
            <surname>U.</surname>
          </string-name>
          :
          <article-title>Multidimensional index structures in relational databases</article-title>
          .
          <source>JIIS</source>
          <volume>15</volume>
          (
          <issue>1</issue>
          ) (
          <year>2000</year>
          )
          <fpage>51</fpage>
          -
          <lpage>70</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Nykiel</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Indexing in similarity searches in time series data</article-title>
          .
          <source>Master's thesis</source>
          , York University (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Shieh</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Keogh</surname>
          </string-name>
          , E.:
          <article-title>iSAX: indexing and mining terabyte sized time series</article-title>
          . In: KDD '
          <fpage>08</fpage>
          . (
          <year>2008</year>
          )
          <fpage>623</fpage>
          -
          <lpage>631</lpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>