Tree Structure Node Insertion Using Interval Gaps
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for implementing tree structures within relational databases are inefficient, particularly in managing node additions, deletions, and movements, as they either require complex SQL operations or are limited by fixed tree depths and string lengths.
Innovation Solution
A tree structure system where each node has an ID, left value, right value, and tree node interval, with child nodes having a pointer to their parent, allowing for efficient insertion, deletion, and movement of nodes by reusing gaps or creating overflow nodes, and updating database entries accordingly.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If the adjacent list technique is used where each tree node stores a pointer to its parent, then the tree structure can be implemented in a relational database, but retrieving children of a node over multiple levels requires multiple SQL statements reducing efficiency
Solution Approach 1:
The patent introduces a new dimension to the data model by adding left and right values to each node, creating a node interval that represents the hierarchical space. This allows the system to retrieve entire subtrees using range queries on the interval values, transforming a multi-step hierarchical traversal into a single efficient SQL query that operates on the newly created dimensional space.
2Adaptability or versatility
If the string set technique is used where the hierarchy is mapped to a string field, then the tree structure can be represented, but the length of the string implies a fixed tree depth and modification requires complicated database operations
Solution Approach 1:
The patent changes the parameters used to represent hierarchical position from fixed-length strings to dynamic intervals defined by left and right values. This parameter change allows the tree depth and structure to be flexible without being constrained by predetermined string lengths, while simplifying modification operations to basic interval arithmetic rather than complex string manipulations.
3Productivity
If traditional methods are used for inserting nodes into a tree structure, then the tree can be updated, but the operations are inefficient and do not utilize available space effectively
Solution Approach 1:
The patent performs preliminary actions by maintaining node intervals and tracking available spaces in the tree structure. When a node needs to be inserted, the system has already prepared the interval information, allowing it to quickly identify suitable insertion positions and allocate appropriate spaces without performing time-consuming searches or recalculations during the actual insertion operation.
Data Source
AI summary
Systems and methods are provided for inserting a new node into a tree structure for use within a database system, wherein the tree structure comprises one or more parent nodes having space there under, and one or more child nodes; wherein each node comprises an identification, a left value, a right value, a width, and a tree node interval; each child node comprises of a pointer to the associated parent node of the child node; and the new node is a child node having an identification corresponding to the identification of a parent node. The method may comprise determining the identification of the parent node of the new node, determining the width of the new node, determining whether a gap exists in the tree structure for a parent node having an identification equal to the determined parent node identification, and if a gap exists, inserting the new node into the gap if the width of the gap is equal to or greater than the width of the new node.


