Optimizing R-tree for flash memory
Introduction
Recently, flash memory as well as flash-based solid state drives (SSDs) has been widely used in computer systems to accelerate I/O efficiency, owing to its superior features compared with magnetic disks, e.g., smaller size, lighter weight, lower power consumption, shock resistance, lower noise, and faster read performance (Chang and Kuo, 2005, Wu and Kuo, 2006, Xiang et al., 2008). Thus, many people have proposed to use flash memory in spatial databases in recent years (Koltsidas and Viglas, 2011, Lv et al., 2011, Sarwat et al., 2011, Sarwat et al., 2013, Wu et al., 2003). Due to the special features of flash memory that differ from magnetic disks, many data structures and algorithms in spatial data management, such as spatial indices, have to be re-considered.
However, it is not a trivial task to optimize a spatial index for flash memory. Existing spatial indices such as R-tree (Chawla and Sun, 2006, Guttman, 1984, Theodoridis and Sellis, 1996) are mostly proposed for improving search performance. On the other side, they usually have poor update performance. For example, R-tree is a balanced spatial tree index that offers high search performance. However, its balanced structure will incur bottom-up updates on the tree, i.e., insertions and deletions will cause updates on leaf nodes propagating up to the root node. As flash memory has a slow random-write speed, R-tree will achieve poor performance on flash memory (Wu et al., 2003). In addition, as flash memory has a limited erasure count because of its erasure-before-write feature, we have to consider new techniques for R-tree to reduce the erasures to flash memory so as to extend the life cycle of flash memory. As a consequence, optimizing spatial indices for flash memory will lead to substantial re-designs on index structures. In order to reduce random writes to flash memory, we need to revise some key features of traditional spatial indices such as R-tree.
There are also some previous studies focusing on flash-based spatial indexes (Lv et al., 2011, Sarwat et al., 2011, Sarwat et al., 2013, Wu et al., 2003). Most of them are based on R-tree and employ a lazy updating policy to reduce the costly random writes and erasure operations on flash memory. According to the lazy updating policy, all updates to leaf nodes are cached in main memory, and the node with the most updates is written to flash memory in case of buffer replacement. The advantage of the lazy updating mechanism is that it can combine several writes to a leaf node into one write and therefore the overall writes to R-tree can be reduced. However, although we can merge a few writes into one operation, the writes to leaf nodes will still impose node-splitting operations on the tree, which will probably introduce many writes to flash memory. Another problem in existing work is that the buffer replacement algorithms they proposed only consider the update count of the cached nodes and always choose the nodes with the most updates as the victim. This will result in poor performance if the evicted node is to be visited soon, because the temporal locality of buffer references indicates that a recently updated page is much likely to be re-referenced soon.
This paper presents the first optimization on R-tree for reducing node-splitting operations on the index. The motivation of the paper is to postpone node-splitting operations by introducing overflow nodes to R-tree and making R-tree be an unbalanced tree. In addition, we propose a new buffering scheme to cache updates to R-tree, which can further reduce random writes to flash memory. In summary, we make the following contributions in this paper:
- (1)
We propose a flash-optimized spatial tree index called Flash-Optimized R-tree (FOR-tree). FOR-tree is the first optimization on R-tree that considers reducing node-splitting operations by using overflow nodes. FOR-tree is designed as an unbalanced tree but it can reduce random writes and further erasures to flash memory. We also propose a merge-back algorithm for overflow nodes, which can efficiently reduce the read overhead on FOR-tree.
- (2)
We design new search and update algorithms to adapt the unbalanced structure of FOR-tree. Compared with previous work on flash-aware R-trees, our algorithms can reduce more random writes on flash memory, especially for skewed access patterns.
- (3)
We propose a new buffering scheme to maintain node updates in a write buffer. The new scheme uses both the update count and the cold/warm attribute of the buffered nodes to select the victim during the buffer replacement process. Compared with previous update-count-based algorithms, our proposal introduces fewer random writes on flash memory.
- (4)
We conduct extensive experiments on both real SSDs and a flash memory simulation framework, and run one million transactions to evaluate the performance of FOR-tree. The results show that FOR-tree outperforms its competitors considering various metrics such as write count, erasure count, and run time.
The rest of the paper is organized as follows. In Section 2, we review related work. In Section 3, we propose the general design of FOR-tree. In Section 4, we describe the operations on FOR-tree. Section 5 explains the buffering scheme of updates. Section 6 covers the experimental results, and finally Section 7 concludes the paper and discusses the future work.
Section snippets
Related work
Due to the characteristics that random writes are much slower than sequential writes and random reads on flash memory, it is common to reduce the number of random writes so as to obtain high update performance. Some flash-aware indices sacrifice sequential writes and random reads to avoid random write operations, such as write-optimized B-tree (Graefe, 2004) and CHC-Tree (Byun & Hur, 2009).
Generally, the update performance on flash memory can be improved by buffering updates in memory and
General design of FOR-tree
To address the problems of RFTL and FAST-Rtree, we propose an improved spatial index tree structure for flash memory storage system, which is called FOR-tree (Flash-Optimized R-tree). FOR-tree aims for achieving high update performance while maintaining acceptable search performance. Its general idea is to improve R-tree by deferring node splitting on R-tree. This is done by using overflowing nodes to record the insertions on leaf nodes, which in turn results in an unbalanced tree structure.
Operations on FOR-tree
This section describes the operations on FOR-tree. Section 4.1 discusses update operations including insertions and deletions, and Section 4.2 focuses on search operations.
Buffering scheme for FOR-tree
Aiming to further remove the random writes to flash memory, in this section, we propose a new buffering scheme for FOR-tree. The basic idea is to buffer the updates to P-nodes and O-nodes in main memory, which are then flushed to flash memory in an efficient way.
We use a hash table named as Update Buffer Table to store all updates to the nodes in FOR-tree. Each entry in Update Buffer Table represents a unique FOR-tree node and contains information about < update_type, modify_count, buffer_list>.
Experimental setup and data set
In this section, we compare FOR-tree with the traditional R-tree, and flash-aware spatial indexes. There are mainly two flash-aware spatial indexes proposed before, namely RFTL and FAST-Rtree. However, as discussed in Sarwat et al., 2011, Sarwat et al., 2013, FAST-Rtree is proved to be superior to RFTL. Therefore, FAST-Rtree is the state-of-the-art work, and in our experiment we finally compare the R-tree, FAST-Rtree, and FOR-tree.
The experiments are conducted both on our flash memory
Conclusion and future work
In this paper, we focus on optimizing R-tree for flash memory and propose a new spatial index called Flash-Optimized R-tree (FOR-tree). The major contributions of this paper are threefold. First, we propose the overflow-page-based approach to reduce node-splitting operations on R-tree, which can defer node-splitting operations by allowing the unbalanced structure of R-tree. We also devise an efficient merge-back algorithm to merge overflow pages into R-tree so as to improve the read performance
Acknowledgments
This work is partially supported by the National Science Foundation of China under the Grant (61379037, 61472376) and the OATF project funded by University of Science and Technology of China.
References (36)
- et al.
An index management using CHC-cluster for flash memory databases
Journal of Systems and Software
(2009) - et al.
On efficient reverse skyline query processing
Expert Systems with Applications
(2014) - et al.
AD-LRU: An efficient buffer replacement algorithm for flash-based databases
Data and Knowledge Engineering
(2012) Location-based grid-index for spatial query processing
Expert Systems with Applications
(2014)- et al.
Exploiting location information for web search
Computer in Human Behaviors
(2014) - et al.
Lazy-adaptive tree: An optimized index structure for flash devices
Proceedings of VLDB Endowment
(2009) - Beckmann, N., Kriegel, H., Schneider, R., & Seeger, B. (1990). The R∗-tree: An efficient and robust access method for...
- Bouganim, L., Jónsson, B., & Bonnet, P. (2009), uFLIP: Understanding flash IO patterns. In Proceedings of the 4th...
- et al.
LR-tree: A logarithmic decomposable spatial index method
The Computer Journal
(2003) - et al.
Efficient management for large-scale flash-memory storage systems with resource conservation
ACM Transactions on Storage
(2005)
SLOM: A new measure for local spatial outliers
Knowledge and Information Systems
Algorithms and data structures for flash memories
ACM Computing Surveys
Cited by (28)
Parallel algorithm for improving the performance of spatial queries in SQL: The use cases of SQLite/SpatiaLite and PostgreSQL/PostGIS databases
2021, Computers and GeosciencesCitation Excerpt :The SQLite/SpatiaLite system uses the VirtualSpatialIndex (SpatiaLite, 2017a), which is a development of the powerful R*-tree system (Beckmann et al., 1990). Proprietary indexing systems have also been created, such as ones based on and enjoying the benefits of saving databases on SSD drives (for example, the efficient framework system, called eFIND (Carniel et al., 2019) and the flash-optimized unbalanced R-tree index (Jin et al., 2015)) and used to process efficient spatial queries in wireless communication environments (Park, 2014), analyze BIM data (Solihin et al., 2017), or manage LiDAR data in Oracle Spatial (Schön et al., 2013). Each indexing system differs about creation time, the number of references to the original data, and speed of operation (Roumelis et al., 2017).
LB-Grid: An SSD efficient Grid File
2019, Data and Knowledge EngineeringCitation Excerpt :They proposed the use of overflow nodes to alleviate the increased update cost in flash memory and discuss some criteria for re-balancing the tree. OR-tree [48] and FOR-tree [49] aim to reduce small random writes by utilizing overflow nodes to the leaves of an R-tree. New algorithms were designed for reading and updating the tree, as well as a cost-based operation for merging back the overflow nodes.
A generic and efficient framework for flash-aware spatial indexing
2019, Information SystemsCitation Excerpt :In addition, random writes can lead to high costly erase-before-update operations and thus, sequential writes are preferable. To deal with these characteristics, some flash-aware spatial indices have been proposed in the literature [11–18]. Among them, FAST-based indices [14] distinguish themselves by providing efficiency and data durability.
Optimizing B<sup>+</sup>-tree for hybrid memory with in-node hotspot cache and eADR awareness
2024, Frontiers of Computer ScienceSpatial Index Structures for Modern Storage Devices: A Survey
2023, IEEE Transactions on Knowledge and Data Engineering