A Succinct String Dictionary Index in External Memory

Guoqing Zhang, Mei Rong, Guangquan ZhangInternational Journal of Database Theory and Application 2014

Abstract

With the coming of the big data age, more and more string dictionaries need to be processed. The existing string dictionary indexes are either too space-consuming, or lack of locality of reference, making them inapplicable in the external memory environment. Targeted with these problems, first we design a new succinct representation of Patricia trie using LOUDS encoding. Then applying it to external memory indexing problem, we propose a new string dictionary index SB-trie, which is not only succinct on space, but also has good locality of reference, making it I/O efficient in external memory environment. Experiments show that SB-trie consumes less space and has greater searching performance in disk environment.

Introduction

As datasets scale into the "big data" regime, string dictionaries—essential components in search engines, bioinformatics, and database systems—frequently exceed the capacity of main memory (RAM). This necessitates the use of external memory, such as SSDs or hard drives. However, traditional indexing structures face significant hurdles in this environment:

  1. Space Overhead: Conventional indexes like B+trees or standard Tries are pointer-heavy. On modern 64-bit architectures, these pointers consume substantial space, often causing the index to be larger than the raw data it organizes.
  2. Poor Locality of Reference: Searching a standard trie on disk often leads to "pointer chasing," where each character in a query string triggers a jump to a different physical disk location. These random I/O operations are significantly slower than sequential access or RAM operations.

While existing solutions like String B-trees or Front-Coded B+trees attempt to address these issues, they often struggle with space efficiency or performance, particularly when handling short string keys.

Methodology: The SB-trie Architecture

To overcome these challenges, we propose the SB-trie (Succinct B-trie), which integrates several advanced data structure techniques to optimize for both space and I/O efficiency.

Patricia Tries and LOUDS Encoding

The SB-trie utilizes Patricia tries, which collapse non-branching node chains into single nodes with string labels, thereby reducing the total node count. To achieve "succinctness," we employ Level-Order Unary Degree Sequence (LOUDS) encoding. Instead of using bulky 64-bit pointers, LOUDS represents the tree structure as a compact bit array. Navigation is performed using constant-time $O(1)$ bitwise operations (rank and select), drastically reducing the memory footprint.

Two-Level Decomposition

Because LOUDS is most effective for trees with simple labels, we decompose the Patricia trie into an index trie (representing structure) and a label trie (storing string fragments). The SB-trie adopts a two-level architecture similar to a B-tree, consisting of a root index trie that references multiple leaf index tries.

The two-level architecture of the SB-trie, featuring a root index trie and multiple leaf index tries.

To further optimize space, all label tries are merged into a single unifying label trie, eliminating redundant string fragments across the dictionary.

Experimental Evaluation

We evaluated the SB-trie using a real-world dataset of approximately 9.86 million English Wikipedia titles (~201.7 MB). The index was compared against standard B+trees, Front-Coded B+trees (FC), String B-trees, and Google’s LevelDB across various data scales.

Key Results

The experimental results demonstrate the SB-trie's superiority in both space and time:

  • Space Efficiency: The SB-trie consumed only 36% of the original data size (73.1 MB for the Wikipedia dataset). In contrast, standard B+trees required approximately 140% of the original data size.
  • Search Performance: The SB-trie maintained stable search performance as the dataset grew. By caching the root index trie in RAM, the search algorithm typically requires only a single disk I/O to retrieve the necessary leaf node.
Performance comparison: (a) average search time and (b) relative index size across different data scales.

Conclusion

The SB-trie provides a highly efficient solution for string dictionary indexing in external memory. By combining Patricia tries with succinct LOUDS encoding and a two-level architecture, it achieves significant space savings and high search performance. Currently, the SB-trie is a static index; future work will focus on extending this architecture to support dynamic operations such as real-time insertions and deletions.

Summary updated

BibTeX
@article{zhang2014succinct,
  author = {Guoqing Zhang and Mei Rong and Guangquan Zhang},
  title = {{A Succinct String Dictionary Index in External Memory}},
  journal = {International Journal of Database Theory and Application},
  year = {2014},
  doi = {10.14257/ijdta.2014.7.3.02},
}
Figure