Abstract
Flash memory continues to improve in price, capacity, reliability, durability, and performance. In addition to consumer and client devices, flash memory is also employed in many servers. Its optimal usage in various classes of server software, including web servers, file-and-print servers, and database servers, requires evaluation and analysis. The present paper analyzes the use of flash memory for database query processing including algorithms that combine flash memory and traditional disk drives.
External merge sort serves as a prototypical query execution algorithm. The excellent access latency of flash memory promises substantially better sort performance than sorting with traditional disks. Surprisingly, this is true only in fairly limited cases. Flash memory as intermediate external storage improves performance in particular in situations with very limited memory.
The most advantageous external sort algorithms combine flash memory and traditional disk, exploiting the fast access latency of flash memory as well as the fast transfer bandwidth and inexpensive capacity of traditional disks. Moreover, graceful degradation is required in multiple ways, both when spilling from memory to flash storage and when spilling from flash to disk. These algorithms are described in detail, including in particular their graceful transition from run generation to merging. Using such graceful degradation and incremental transitions, sorting in a three-level memory hierarchy of RAM, flash memory, and traditional disk can be generalized to database query processing with any number of levels.
Similar content being viewed by others
Notes
Recent high-end flash devices achieve a write bandwidth similar to their read bandwidth, presumably by keeping some space erased at all times ready for immediate writing. The bandwidth of flash devices and disks can be improved by parallelism or “arrays,” but those arrangements improve neither the cost-per-capacity of flash devices nor the access latency of disks.
Sections 3.1 to 3.3 are heavily based on [12].
References
Anon et al. (1985) A measure of transaction processing power. Datamation, 1 April 1985
Andersen DG, Franklin J, Kaminsky M, Phanishayee A, Tan L, Vasudevan V (2009) FAWN: a fast array of wimpy nodes. In: Proceedings of the ACM SIGOPS 22nd symposium on operating systems principles, SOSP ’09. ACM, New York, pp 1–14
Andreou P, Spanos O, Zeinalipour-Yazti D, Samaras G, Chrysanthis PK (2009) FSort: external sorting on flash-based sensor devices. In: DMSN
Bitton D, DeWitt DJ (1983) Duplicate record elimination in large data files. ACM TODS 8(2):255–265
Bayer R, McCreight EM (1972) Organization and maintenance of large ordered indices. Acta Inform 1:173–189
Dewitt DJ, Katz RH, Olken F, Shapiro LD, Stonebraker M, Wood DA (1984) Implementation techniques for main memory database systems. In: ACM SIGMOD, pp 1–8
Graefe G (1993) Query evaluation techniques for large databases. ACM Comput Surv 25(2). doi:10.1145/152610.152611
Graefe G (2006) Implementing sorting in database systems. ACM Comput Surv 38(3). doi:10.1145/1132960.1132964
Graefe G (2007) The five-minute rule twenty years later, and how flash memory changes the rules. In: DaMoN
Graefe G, Bunker R, Cooper S (1998) Hash joins and hash teams in Microsoft SQL Server. In: VLDB Conf, pp 86–97
Gray J, Graefe G (1997) The five-minute rule ten years later, and other computer storage rules of thumb. SIGMOD Rec 26(4):63–68
Graefe G, Harizopoulos S, Kuno HA, Shah MA, Tsirogiannis D, Wiener JL (2010) Database operators for flash-enabled memory hierarchies. IEEE Data Eng Bull 33(4):21–27
Graefe G, Larson P-Å(2001) B-tree indexes and CPU caches. In: IEEE ICDE, pp 349–358
Graefe G, Linville A, Shapiro LD (1994) Sort versus hash revisited. IEEE Trans Knowl Data Eng 6(6):934–944
Gray J, Putzolu GR (1987) The 5 minute rule for trading memory for disk accesses and the 10 byte rule for trading memory for CPU time. In: ACM SIGMOD, pp 395–398
Knuth DE (1973) The art of computer programming. Sorting and searching, vol III. Addison-Wesley, Reading
Lomet DB (2001) The evolution of effective B-tree page organization and techniques: a personal account. SIGMOD Rec 30(3):64–69
Lee S-W, Moon B, Park C, Kim J-M, Kim S-W (2008) A case for flash memory ssd in enterprise database applications. In: SIGMOD, pp 1075–1086
Nyberg C, Barclay T, Cvetanovic Z, Gray J, Lomet DB (1995) AlphaSort: a cache-sensitive parallel external sort. VLDB J 4(4):603–627
Nakayama M, Kitsuregawa M, Takagi M (1988) Hash-partitioned join method using dynamic destaging strategy. In: VLDB, p 468
Ousterhout JK, Douglis F (1989) Beating the I/O bottleneck: a case for log-structured file systems. Oper Syst Rev 23(1):11–28
Selinger PG, Astrahan MM, Chamberlin DD, Lorie RA, Price TG (1979) Access path selection in a relational database management system. In: ACM SIGMOD, pp 23–34
Zhang W, Larson P-Å(1997) Dynamic memory adjustment for external mergesort. In: VLDB Conf, pp 376–385
Acknowledgements
Stavros Harizopoulos, Harumi Kuno, Mehul Shah, and Janet Wiener carefully read earlier drafts and provided many insightful comments. Editor and reviewers also contributed many pertinent and helpful suggestions.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Graefe, G. Sorting in a Memory Hierarchy with Flash Memory. Datenbank Spektrum 11, 83–90 (2011). https://doi.org/10.1007/s13222-011-0062-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s13222-011-0062-6