[Paper Review] Fast and Tiny Structural Self-Indexes for XML
This paper presents a novel, grammar-compressed structural self-index for XML that enables fast XPath query evaluation with minimal space overhead. By leveraging straight-line tree (SLT) grammars and augmenting them with efficient taggedDesc/taggedFoll operations, the index supports full XPath evaluation—especially for counting and serialization—up to 100x faster than prior systems while using only a fraction of the original data size.
XML document markup is highly repetitive and therefore well compressible using dictionary-based methods such as DAGs or grammars. In the context of selectivity estimation, grammar-compressed trees were used before as synopsis for structural XPath queries. Here a fully-fledged index over such grammars is presented. The index allows to execute arbitrary tree algorithms with a slow-down that is comparable to the space improvement. More interestingly, certain algorithms execute much faster over the index (because no decompression occurs). E.g., for structural XPath count queries, evaluating over the index is faster than previous XPath implementations, often by two orders of magnitude. The index also allows to serialize XML results (including texts) faster than previous systems, by a factor of ca. 2-3. This is due to efficient copy handling of grammar repetitions, and because materialization is totally avoided. In order to compare with twig join implementations, we implemented a materializer which writes out pre-order numbers of result nodes, and show its competitiveness.
Motivation & Objective
- To address the inefficiency and high space cost of conventional structural XML indexes that cannot fully support XPath’s navigational axes.
- To design a self-index that compresses XML tree structure using grammar-based compression (SLT grammars) while preserving full query expressivity.
- To enable fast evaluation of arbitrary tree algorithms and XPath queries directly on the compressed index without full decompression.
- To outperform existing systems in performance for key operations like result counting and serialization, especially in space-constrained environments.
Proposed method
- Compresses XML tree structure into a straight-line tree (SLT) grammar, achieving high compression ratios due to repetitive markup.
- Augments the grammar with bit vectors for each nonterminal and terminal, indicating whether the nonterminal generates the terminal (for fast taggedDesc and taggedFoll operations).
- Provides a generic sequential interface to execute arbitrary tree algorithms (e.g., depth-first traversal, XPath evaluation) directly on the compressed grammar.
- Implements specialized evaluators for XPath result counting and for serialization/materialization of query results, avoiding materialization via efficient grammar traversal.
- Uses a bottom-up approach for path queries, leveraging grammar structure to skip irrelevant nodes and reduce traversal cost.
- Employs bCNF (binary Chomsky normal form) transformation to reduce nonterminal rank, minimizing overhead in automaton evaluation functions.
Experimental results
Research questions
- RQ1Can grammar-compressed tree representations be used to build a self-index that supports efficient, full XPath evaluation without decompressing the original data?
- RQ2To what extent can grammar-based compression reduce index size while maintaining or improving query performance compared to traditional structural indexes?
- RQ3Can specialized evaluators over the grammar index outperform existing systems in performance for common XPath tasks like result counting and serialization?
- RQ4How does the rank of nonterminals in the grammar affect the performance of query evaluation over the compressed index?
- RQ5Can the index be used effectively as a structural synopsis for selectivity estimation and fast serialization in XML databases?
Key findings
- The TinyT index achieves space usage of just 83MB for the 116MB XMark document, demonstrating extreme space efficiency.
- XPath result counting over the index is up to 100x faster than previous systems like MonetDB and Qizx, with a 5ms evaluation time on XMark116M using a TreeRePair grammar.
- Serialization and materialization of query results are 2–3 times faster than existing systems due to efficient handling of grammar repetitions and avoidance of materialization.
- The performance of evaluators is highly sensitive to grammar rank: a grammar with rank 8 took 38ms for a query, while a rank 3 grammar took only 28ms, showing that lower rank improves performance.
- Replacing SXSI’s tree store with the new interface causes only a 4x slow-down but reduces memory usage by a factor of 3, demonstrating a favorable time-space trade-off.
- The index is so small (e.g., 83MB for 116MB of data) that it can be kept in main memory, enabling fast in-memory processing for selectivity estimation and query optimization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.