In-Memory Expression Units Cache Query Results
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database queries with complex expressions consume significant system resources due to repeated computations, and existing solutions like materialized views do not capture intermediary expression results or internal computations that reside solely in memory during query execution.
Innovation Solution
Implementing in-memory expression units (IMEUs) and internal units (IMIUs) to cache and store results of frequently used expressions and computations, allowing database servers to access cached results instead of re-evaluating them, thereby reducing resource consumption and improving query performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If materialized views are used to capture query results, then query performance is improved, but intermediary expression results and internal computations are not captured
Solution Approach 1:
The patent segments the query execution process into distinct components: materialized views for final results and expression units for intermediary computations. This segmentation allows each component to serve its specific function - materialized views handle final query results while expression units capture and reuse intermediate computation results, thereby resolving the contradiction between improving query performance and preserving intermediary information.
Solution Approach 2:
The patent introduces expression units as intermediary components between the query processor and materialized views. These expression units act as mediators that capture, store, and manage intermediary computation results, enabling the system to both improve query performance through caching and preserve intermediary expression results that would otherwise be lost.
2Adaptability or versatility
If complex expressions are evaluated repeatedly, then query flexibility is maintained, but system resources are significantly consumed
Solution Approach 1:
The patent applies preliminary action by pre-computing and caching complex expressions in expression units before they are needed for actual query execution. When queries are executed, the system first checks the expression units for pre-computed results, thereby maintaining query flexibility while significantly reducing the computational resources required for repeated complex expression evaluations.
Solution Approach 2:
The patent changes the state of complex expressions from being dynamically computed to being pre-computed and cached. By transforming expressions into cached computational artifacts in expression units, the system maintains the ability to handle flexible queries while reducing the energy and resource consumption associated with repeated evaluation of the same complex expressions.
3Speed
If in-memory units are created to cache expression results, then query execution speed is improved, but memory usage increases
Solution Approach 1:
The patent makes expression units universal by designing them to handle multiple types of intermediary computations and serve multiple query operations. Rather than creating dedicated memory structures for each specific expression or query, the expression units provide a multi-functional caching mechanism that serves various query types and computation needs, thereby improving query execution speed while optimizing memory usage through shared resources.
Data Source
AI summary
Techniques are described for materializing computations in memory. In an embodiment, responsive to a database server instance receiving a query, the database server instance identifies a set of computations for evaluation during execution of the query. Responsive to identifying the set of computations, the database server instance evaluates at least one computation in the set of computations to obtain a first set of computation results for a first computation in the set of computations. After evaluating the at least one computation, the database server instance stores, within an in-memory unit, the first set of computation results. The database server also stores mapping data that maps a set of metadata values associated with the first computation to the first set of computation results.


