Multi-Host B-Tree Construction with Incremental Subtree Grafting
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for building B-trees in database management systems face issues of tree imbalance, increased search time variability, and data unavailability during construction, particularly when dealing with unsorted or sorted data streams, leading to inefficient and time-consuming re-balancing processes.
Innovation Solution
A method for constructing balanced B-trees in a multi-host environment by creating and appending data structures using a 'bottom-up' approach, employing global locks and incremental grafting of sub-trees, allowing simultaneous data access and minimizing re-balancing needs.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a top-down approach is used to build B-trees from unsorted records, then the tree can be constructed incrementally, but the tree becomes unbalanced and search time increases
Solution Approach 1:
The patent inverts the traditional top-down construction approach by using bottom-up construction. Instead of inserting records into a root node and working downward, the system constructs leaf nodes first and works upward to create the complete B-tree structure. This inversion ensures the tree remains balanced throughout construction, maintaining optimal search times while still allowing incremental building of the data structure.
2Ease of manufacture
If records are stored with reserved space for future insertion, then future insertions can occur without moving existing records, but storage space is wasted
Solution Approach 1:
The patent implements dynamic space management in B-tree nodes. Instead of statically reserving fixed space for future insertions, the system dynamically allocates space as needed during bottom-up construction. When nodes are split during the bottom-up process, space is automatically reorganized to accommodate new records without pre-reservation, eliminating wasted space while maintaining insertion efficiency.
3Reliability
If the entire tree is locked during sub-tree appending, then data consistency is maintained, but user access to other parts of the tree is blocked
Solution Approach 1:
The patent segments the locking mechanism from the entire tree to only the specific sub-tree being appended. During bottom-up construction, locks are applied selectively to the root node and rightmost leaf node of the sub-tree being constructed, while other parts of the B-tree remain accessible to users. This segmentation maintains data consistency for the constructed portion while allowing concurrent access to existing data, improving operational efficiency.
4Stability of the object's composition
If re-balancing is performed after tree construction, then the tree becomes balanced, but construction time increases and data is unavailable during re-balancing
Solution Approach 1:
The patent performs preliminary balancing actions during the construction process itself through bottom-up construction. By building the tree from leaf nodes upward and performing splits during construction, the tree is inherently balanced when completed, eliminating the need for separate re-balancing operations. This preliminary action ensures both tree balance and continuous data availability, as the tree is balanced incrementally rather than requiring a disruptive post-construction re-balancing phase.
Data Source
AI summary
A processor-based method of building and appending data structures in a multi-host environment includes creating and storing data into a first data structure having a first root node, a first right leaf node and a plurality of other leaf nodes and non-leaf nodes defining multiple hierarchical levels; allowing a search of the first data structure to proceed while creating a second data structure that includes a second root node, a second left leaf node and a plurality of leaf nodes and non-leaf nodes defining multiple hierarchical levels; receiving a command to append the second data structure to the first data structure during searching the first data structure; creating a global lock for all hosts in the multi-host environment to the first root node and the first right leaf node of the first data structure while allowing access to the plurality of other leaf nodes and non-leaf nodes of the first data structure; updating the first root node and the first right leaf node with information about the second data structure; committing the update of the first root node and the first right leaf node; releasing the global lock to the first root node and the first right leaf node; and sending updated copies of the first root node and the first right leaf node to other hosts in a multi-host environment.


