Re-computing Pre-computed Query Results via Reinforcement Learning
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database systems face challenges in efficiently re-computing pre-computed query results due to limited computation resources and the need to balance accuracy with resource utilization, especially when dealing with interrelated query results that require varying amounts of computation resources based on their validity and interdependence.
Innovation Solution
A computation machine employs a Reinforcement Learning algorithm to dynamically determine the optimal number of pre-computed query results to re-compute during a given time interval, optimizing resource usage by considering key performance indicators and minimizing unnecessary re-computations of still valid results.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If pre-computed query results are re-computed frequently to ensure accuracy, then reliability of query results is improved, but computation resources are excessively consumed
Solution Approach 1:
The system dynamically adjusts the re-computation frequency and scope of pre-computed query results based on real-time computation resource availability and result freshness requirements. Different shares of query results are re-computed at different intervals according to their specific needs, rather than using a fixed uniform schedule.
Solution Approach 2:
The system changes the parameter of re-computation timing by determining optimal re-computation moments based on multiple factors including resource availability, result age, and query patterns. This allows the system to adapt re-computation parameters dynamically rather than using static predetermined intervals.
2Stability of the object's composition
If all pre-computed query results are re-computed together, then consistency across results is improved, but computation resources are overwhelmed
Solution Approach 1:
The system segments the set of pre-computed query results into multiple shares, where each share contains a subset of results that can be re-computed independently. This segmentation allows gradual re-computation across different time intervals rather than processing all results simultaneously, reducing peak resource demands while maintaining overall consistency.
3Speed
If pre-computed query results are maintained in a pool for quick access, then response time is improved, but storage resources are consumed
Solution Approach 1:
The system implements a mechanism to discard old pre-computed query results from the pool and recover storage space when resources are needed. New results are computed and stored in the pool as needed, creating a dynamic balance between having results available for quick access and freeing up storage resources when necessary.
Data Source
AI summary
Pre-computed query results stored at a database server are re-computed by a computation machine. The pre-computed query results are composed of a plurality of shares. Each share includes a certain number of pre-computed query results. The computation resources of the computation machine needed to re-compute a pre-computed query result of a first share depend on whether or not other pre-computed query results of the first share are re-computed during a given time interval forming a current re-computation cycle. The computation machine receives a request to re-compute pre-computed query results of at least a first share, determines a number of pre-computed query results in the first share to be re-computed in the current re-computation cycle based on a Reinforcement Learning algorithm, and re-computes the determined number of pre-computed query results in the first share.


