clude prefix and regular expression match, and a
generic incremental NN search for SP-GiST-based in-
dexes.
3. We conducted extensive experiments from within Post-
greSQL to compare the performance of SP-GiST in-
dexes against the B+-tree and R-tree. Our results show
that a disk-based SP-GiST trie performs more than 2
orders of magnitude better than the B+-tree for a regu-
lar expression match search, and that a disk-based SP-
GiST kd-tree performs more than 300% better than an
R-tree for a point match search.
4. We realized a disk-bsed suffix tree index using SP-
GiST to support substring match searching. Our exper-
iments demonstrate that the suffix tree performs more
than 3 orders of magnitude better than existing tech-
niques.
5. We made the PostgreSQL version of SP-GiST
available for public access and download at:
www.cs.purdue.edu/spgist.
The rest of this paper proceeds as follows. In Section 2, we
highlight related work. In Section 3, we overview space-
partitioning trees, the challenges they have from database
indexing point of view, and how these challenges are ad-
dressed in SP-GiST. Section 4 describes the implementation
of SP-GiST inside PostgreSQL. Section 5 presents a new
nearest-neighbor search functionality for SP-GiST. In Sec-
tion 6, we present the performance results of a disk-based
SP-GiST trie vs. the B+-tree for string data sets, and a disk-
based SP-GiST kd-tree and PMR quadtree vs. the R-tree
for two-dimensional point and line segment data sets, re-
spectively. Section 7 contains concluding remarks.
2 Related Work
Multidimensional searching is a fundamental operation
for many database applications. Several index structures
beyond B-trees [6, 11] and hash tables [14, 31] have been
proposed for multidimensional data, e.g., [17, 29, 33, 35].
These index structures include the R-tree and its variants,
e.g., [7, 20, 34], the quadtree and its variants, e.g., [15,
18, 26, 41], the kd-tree [8] and its disk-based variants,
e.g., [9, 32], and the trie and its variants [2, 10, 16]. Ex-
tensions to the B-tree have been proposed to index multidi-
mensional data, e.g., [5, 13]. Extensible indexing frame-
works have been proposed to instantiate a variety of in-
dex structures in an efficient way and without modifying
the database engine. Extensible indexing frameworks are
first proposed in [38]. GiST (Generalized Search Trees) is
an extensible framework for B-tree-like indexes [21]. SP-
GiST (Space Partitioning Generalized Search Trees) is an
extensible framework for the family of space-partitioning
trees [3, 4, 19]. Extensible indexing structures are impor-
tant in the context of object-relational database management
systems to support new data types. The implementation of
GiST in Informix Dynamic Server with Universal Data Op-
tion (IDS/UDO) is presented in [27]. Commercial databases
have supported extensible indexing frameworks, e.g., IBM
DB2 [1], and Oracle [37]. The performance of various in-
dex structures have been studied extensively. For example,
a model for the R-tree performance is proposed in [40]. R-
tree and quadtree variants are compared in [24] and from
within Oracle Spatial in [28].
3 Space-partitioning Trees: Overview, Chal-
lenges, and SP-GiST
The main characteristic of space-partitioning trees is
that they partition the multi-dimensional space into disjoint
(non-overlapping) regions. Refer to Figures 1, 2, and 3, for
a few examples of space-partitioning trees. Partitioning can
be either (1) space-driven (e.g., Figure 2), where we decom-
pose the space into equal-sized partitions regardless of the
data distribution, or (2) data-driven (e.g., Figure 3), where
we split the data set into equal portions based on some cri-
teria, e.g., based on one of the dimensions.
There are many types of trees in the class of space-
partitioning trees that differ from each other in various
ways. Without loss of generality, and for the simplicity of
this discussion, we highlight below some of the important
variations in the context of the trie data structure.
• Path Shrinking (refer to Figure 1) - The problem is
that we may want to avoid lengthy and skinny paths
from a root to a leaf. Paths of one child can be col-
lapsed into one node. For example, the Patricia trie
allows for leaf-shrinking (Shrinking single child nodes
at the leaf level nodes, e.g., Figure 1(b)), while it is
also possible to allow for path-shrinking (Shrinking
single child nodes at the non-leaf level nodes, e.g., Fig-
ure 1(c)), or even no shrinking at all (Figure 1(a)).
• Node Shrinking (refer to Figure 2) - The problem is
that with space-driven partitions, some partitions may
end up being empty. So, the question is: Do we al-
low that empty partitions be omitted? For example,
the difference between the standard trie (Figure 2(a))
and the forest trie (Figure 2(b)) is that the latter allows
for empty partitions to be eliminated.
• Clustering - This is one of the most serious issues
when addressing disk-based space-partitioning trees.
The problem is that tree nodes do not map directly to
disk pages. In fact, tree nodes are usually much smaller
than disk pages. So, the question is: How do we pack
评论