Hierarchy Rearrange Operator for Database Query Plans
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Relational database systems face challenges in efficiently accommodating hierarchical data structures due to their flat nature, requiring manual encoding schemes that can be costly and difficult to maintain, especially when supporting queries and updates, leading to suboptimal performance and increased developer burden.
Innovation Solution
A hierarchical table model is introduced with a NODE column to represent hierarchies, allowing for flexible encoding schemes through hierarchy indexing, which provides primitives for querying and updating hierarchies while maintaining efficient performance and scalability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If hierarchical data is stored in a relational database using manual encoding schemes, then the data can be accommodated in a flat table structure, but the complexity of implementing and maintaining the encoding increases significantly
Solution Approach 1:
The patent introduces a hierarchy table as an intermediary structure between the flat relational database and the hierarchical data. This hierarchy table stores parent-child relationships explicitly, serving as a mediator that translates hierarchical concepts into relational database operations without requiring complex encoding schemes in the application layer
Solution Approach 2:
The patent segments the hierarchical data representation into two separate components: a flat data table for storing node attributes and a hierarchy table for storing structural relationships. This segmentation allows each component to be optimized independently, reducing the complexity of implementing hierarchical operations
2Reliability
If complex encoding schemes are used to represent hierarchies in relational databases, then query capabilities improve, but the burden on developers to implement and maintain the encoding increases
Solution Approach 1:
The patent implements self-service by providing a set of predefined hierarchy operations (such as insertChild, deleteChild, moveSibling) that automatically handle the complex encoding and decoding tasks. These operations work directly with the hierarchy table, eliminating the need for developers to manually implement complex encoding schemes while maintaining efficient query performance
3Adaptability or versatility
If hierarchy logic is outsourced to the application layer, then implementation flexibility increases, but performance deteriorates due to inability to utilize database layer capabilities
Solution Approach 1:
The hierarchy table acts as an intermediary that enables the database layer to natively understand and optimize hierarchical operations. By storing parent-child relationships in the database, the system can leverage database indexing, query optimization, and execution plans to improve performance while maintaining implementation flexibility through the application layer
Data Source
AI summary
A system and method to receive a query against a plurality of data objects that are sorted, at least conceptually, to follow a hierarchical order and support a preorder traversal arrangement and a postorder traversal arrangement; translate the query into an executable query plan including at least one instance of a hierarchy rearrange operator, the hierarchy rearrange operator to rearrange an input including one or more of the plurality of data objects from one of a preorder traversal arrangement and a postorder traversal arrangement to a corresponding opposite thereof; execute the executable query plan including the at least one instance of the hierarchy rearrange operator; and generate a query result based, at least in part, on the input of the one or more plurality of data objects being rearranged in the respective preorder traversal arrangement and a postorder traversal arrangement.


