Abstract
As XML documents grow to millions of nodes, traditional in-memory processing becomes infeasible due to memory constraints. This paper presents a novel approach to XML querying by compressing the document's structural "skeleton" into a compact Directed Acyclic Graph (DAG) through subtree sharing. By evaluating XPath queries directly on this compressed representation, the proposed method enables efficient, main-memory query execution for massive datasets with minimal decompression.
Introduction
XML has long served as a standard for data exchange, but its verbosity poses significant challenges for large-scale data management. Large XML documents often exceed the capacity of physical RAM, forcing systems to rely on disk-based "shredding" into relational tables or heavy indexing. These methods frequently incur high I/O costs during structural navigation.
The authors observe that query navigation is primarily driven by the XML "skeleton"—the hierarchy of tags and attributes—rather than the text content itself. However, even these skeletons can be prohibitively large. The challenge lies in compressing this structure such that it remains directly queryable without full decompression.
Methodology: From Trees to DAGs
The core innovation involves borrowing techniques from symbolic model checking, specifically subtree sharing based on bisimulation.
Subtree Sharing
The algorithm identifies identical subtrees within the XML document. If two nodes share the same label and their children are structurally identical, they are merged into a single representation. This process transforms the original XML tree into a compact Directed Acyclic Graph (DAG).
Query Algebra and Lazy Decompression
The authors define a set of operations for "Core XPath," covering essential axes like child, descendant, and parent.
- Upward Axes: Operations such as
parentandancestorare performed directly on the DAG, maintaining its compressed size. - Downward Axes: Operations like
childordescendantmay require "node splitting"—a form of lazy decompression where a shared node is locally duplicated if it needs to be selected for one path but not another.
Despite potential size increases during node splitting, the authors prove that query evaluation is fixed-parameter tractable: linear in the size of the compressed instance and exponential only relative to the (typically small) query size.
Experimental Evaluation
The prototype was evaluated against several diverse XML benchmarks, including SwissProt (457 MB), DBLP, Penn TreeBank, and XMark. These datasets represent a range of structures, from highly regular database-style XML to more "organic" linguistic data.
Key Results
The experiments yielded several significant insights:
- High Compression Ratios: For regular datasets like SwissProt and DBLP, the compressed skeleton's edge count was reduced to 7%–15% of the original tree.
- Rapid Query Performance: Queries on a 457 MB SwissProt file were typically evaluated in 1.6 to 2.8 seconds entirely in main memory.
- Scalability: The growth of the compressed instance size slows as document size increases, indicating excellent scalability for massive datasets.
- Structural Regularity: The method is most effective on schema-compliant XML. Linguistic data (e.g., Penn TreeBank) showed lower compression ratios due to its less repetitive nature.
Conclusion and Future Work
By treating XML navigation as a DAG traversal, this approach allows million-node documents to be queried in RAM. While current work focuses on Core XPath navigation, future directions include extending the system to handle complex joins in XQuery, integrating full-text search indices, and developing techniques for updating compressed DAGs in dynamic environments.
Summary updated