Shared Expression Evaluation in Database Query Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In database management systems, computationally expensive operations like hash joins lead to redundant computations, resulting in inefficient use of processing and memory resources due to independent evaluation of expressions across multiple operators in a query execution plan.
Innovation Solution
The system identifies common expressions across different query operators and modifies the execution plan to enable shared evaluation, where the expression is computed once and shared among operators, potentially offloading computations to the storage layer to reduce overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If expressions are independently evaluated for each query operator, then the implementation is simple and straightforward, but computationally expensive operations are redundantly computed leading to inefficient use of processing and memory resources
Solution Approach 1:
The patent merges identical expressions across multiple query operators into a single shared evaluation. The system identifies expressions that are common to multiple operators and evaluates them once, then shares the result among all operators that need it. This eliminates redundant computation while maintaining the simplicity of the overall architecture.
Solution Approach 2:
The patent creates a universal expression evaluation mechanism that serves multiple query operators simultaneously. A single evaluated expression result is made available to multiple operators that share the same expression, allowing the system to achieve multi-functionality without increasing implementation complexity.
2Reliability
If computationally expensive operations like hash joins are performed independently by each operator, then each operator has full control over its execution, but processing and memory resources are wasted due to redundant computations
Solution Approach 1:
The patent combines the evaluation of identical expressions across multiple operators into a single shared evaluation process. This reduces redundant computation and resource consumption while preserving operator independence through a sharing mechanism that allows operators to access the shared evaluation results.
Solution Approach 2:
The patent introduces an intermediary expression sharing mechanism that mediates between independent operators. This intermediary layer allows operators to independently execute their logic while sharing common expression evaluations, thus reducing resource waste without compromising execution independence.
3Ease of operation
If multiple hash join operators compute hash values independently using internal hash functions, then each join operation is self-contained, but the execution overhead becomes significant when the number of hash computations is large
Solution Approach 1:
The patent merges the hash value computation for multiple operators that share the same expression into a single evaluation. This eliminates redundant hash computations and reduces execution overhead while maintaining the self-contained nature of each operator through result sharing.
Solution Approach 2:
The patent performs preliminary evaluation of common expressions before they are needed by multiple operators. By evaluating expressions once in advance and caching the results, the system reduces the execution overhead that would otherwise occur during operator execution.
Data Source
AI summary
Techniques are provided for sharing expression evaluation across a database management system and a storage layer. In an embodiment, a computer identifies, in a query execution plan compiled for a query, a plurality of target operators that includes an expression that computes a common value. A storage layer evaluates the expression that computes the common value during a table scan of stored data indicated by the expression. For at least one target operator of the plurality of target operators, the computer modifies a row input of the at least one target operator to add a column to receive an evaluation result comprising the common value from the storage layer. The query execution plan is performed by a database management system and the storage layer.


