Disjunct Trees for Complex Aggregate Expression Matching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing query rewrite mechanisms in database management systems lack the ability to match complex aggregate expressions due to their inability to utilize the distributive property of algebraic operators, leading to inefficient query processing in data warehousing and decision support systems.
Innovation Solution
The proposed solution involves generating and storing disjunct trees for aggregate expressions in materialized views and queries, allowing for the use of algebraic properties like distributivity to rewrite queries that reference materialized views efficiently, thereby matching complex aggregate expressions and reducing the need for frequent base table access.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If query rewrite mechanisms use only associative and commutative properties for matching aggregate expressions, then the matching mechanism is simple to implement, but it cannot match complex aggregate expressions that specify arbitrary numbers of aggregate functions and operators
Solution Approach 1:
The patent segments aggregate expressions into individual disjuncts (separate terms or components) and represents them using disjunct trees. This segmentation allows the query rewrite mechanism to break down complex aggregate expressions into manageable units that can be matched individually, enabling support for arbitrary numbers of aggregate functions and operators while maintaining systematic processing.
Solution Approach 2:
The patent introduces a new dimensional representation by using disjunct trees to represent aggregate expressions. Instead of relying solely on linear algebraic properties (associative and commutative), the disjunct tree structure adds a hierarchical dimension that captures the nested and compositional nature of complex aggregate expressions, enabling more comprehensive matching capabilities.
2Ease of operation
If query rewrite mechanisms support only simple algebraic properties, then the mechanism is easy to operate, but it lacks the ability to match complex aggregate expressions with arbitrary aggregate functions and operators
Solution Approach 1:
By segmenting aggregate expressions into disjuncts and representing them with disjunct trees, the patent maintains operational simplicity through systematic tree traversal and comparison algorithms while simultaneously gaining the ability to handle complex aggregate expressions with arbitrary functions and operators.
Solution Approach 2:
The disjunct tree serves as an intermediary representation between the original aggregate expression and the matching process. This intermediary structure simplifies the matching operation by providing a standardized format for comparison while enabling the system to handle complex expressions that would otherwise be difficult to process directly.
3Reliability
If the system performs full aggregation operations on base tables, then accurate results are obtained, but query execution time becomes unacceptably long when the data warehouse contains very large amounts of data
Solution Approach 1:
The patent enables query rewrite mechanisms to identify and use materialized views that contain pre-computed aggregated data. By performing aggregation operations in advance and storing results in materialized views, the system can rewrite queries to retrieve pre-aggregated data instead of performing full aggregation on base tables, significantly reducing query execution time while maintaining result accuracy.
Data Source
AI summary
In one embodiment, a plurality of materialized views is stored, where each view includes a set of aggregate expressions. Storing each materialized view comprises identifying one or more disjuncts in the set of aggregate expressions, generating a set of disjunct trees that represent the set of aggregate expressions, and storing the set of disjunct trees. When a query that requests aggregated data is received, one or more disjuncts are identified in an aggregate expression specified in the query. A disjunct tree for the disjuncts in the query is generated. Based on the disjunct tree for the query and on the set of disjunct trees for each materialized view, a particular materialized view is determined from the plurality of materialized views. The query is rewritten into an equivalent query that references the particular materialized view, where the equivalent query would retrieve the requested aggregated data from the particular materialized view.


