Hierarchical Key Compression in Tree Data Structures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional B-tree and B+ tree data structures for database systems require extensive locking and traversal, leading to inefficiencies in data access and storage, particularly in handling key-value pairs with duplicated components and in managing concurrent access.
Innovation Solution
Implement key compression by representing keys hierarchically and using an index to reduce duplication, and employ cached-locking techniques to minimize locking operations, allowing direct access to leaf nodes and reducing the need for full tree traversal.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If conventional B-tree or B+ tree data structures are used to store key-value pairs, then data access can be performed in logarithmic time, but the keys require extensive storage space due to duplication of shared portions
Solution Approach 1:
The key is segmented into a shared portion and a unique portion. The shared portion is stored once in the internal node, while the unique portion is stored in the leaf node. This segmentation eliminates duplication of common key prefixes across multiple key-value pairs, significantly reducing storage space requirements.
Solution Approach 2:
The patent implements a nested structure where the internal node contains a prefix index that points to shared key portions, and leaf nodes contain the complete key-value pairs. The leaf node structure embeds references to the internal node's shared portions, creating a nested hierarchy that reduces redundancy while maintaining efficient access paths.
2Productivity
If conventional B-tree traversal algorithms are used, then data can be accessed systematically, but extensive locking operations are required for each node traversal
Solution Approach 1:
The patent extracts the locking mechanism from the traversal process by implementing cached-locking. Instead of locking each node during traversal, the system caches lock information and performs locking only when necessary, separating the traversal logic from the locking operations and reducing overall locking overhead.
Solution Approach 2:
The system performs preliminary locking by acquiring locks on parent nodes before traversing to child nodes. This preliminary action allows subsequent traversals to proceed without repeated locking operations, as the lock state is cached and reused, significantly reducing locking overhead for sequential access patterns.
3Speed
If full tree traversal is performed for each access, then all nodes can be searched systematically, but the access time increases from O(1) to O(log n)
Solution Approach 1:
The patent implements caching of previously accessed nodes and their lock states. When a key-value pair is accessed, the system caches the resulting node references and lock information. Subsequent accesses can utilize this cached information to skip traversal steps, achieving O(1) access time for repeated queries while maintaining the systematic traversal capability when needed.
Solution Approach 2:
The patent applies different access strategies to different parts of the tree based on access patterns. Frequently accessed nodes are kept in cache with their lock states, allowing rapid access without full traversal. Less frequently accessed nodes maintain the systematic B-tree traversal structure. This local optimization achieves fast access for hot data while preserving systematic search capability for cold data.
Data Source
AI summary
System, method, and computer program product key compression and cached-locking are described. A computer system can store database files or operating system files in a tree data structure. The system can store data or metadata as key-value pairs in nodes of the tree data structure. The keys in the key-value pairs can have a hierarchical structure, which may or may not correspond to the tree data structure. The system can compress the keys by reducing duplicated storage of shared portions of the keys. The system can use an index in a tree node to represent the hierarchical structure of the key-value pairs stored in that tree node. To access a value in a key-value pair, the system can identify the tree node to search, query the index in that tree node to locate the value, and then access the value at the indexed location.


