Database Query Sub-Plan Reuse for Concurrent Throughput
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing large-scale concurrent query methods require regenerating the entire integrated execution plan whenever a query changes, leading to prolonged query response times and reduced efficiency due to wasted time generating static execution plans that cannot be split.
Innovation Solution
A query method and device that determine execution plans for multiple queries, identify and reuse common sub-plans, and allocate shared resources in a data cache to reduce repeated calculations and improve throughput.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Use of energy by moving object
If multiple queries are compiled together into an integrated execution plan, then resource utilization is improved, but query response time increases when queries change
Solution Approach 1:
The patent segments the integrated execution plan into multiple independent sub-plans, each corresponding to a specific query. This allows individual sub-plans to be executed independently without regenerating the entire plan when queries change, thus reducing query response time while maintaining resource utilization benefits of batch processing
Solution Approach 2:
The patent introduces dynamic query result output mechanisms where queries can output results at different times rather than all at once. The execution plan structure is made flexible to accommodate dynamic query completion and result output, allowing the system to adapt to changing query requirements without full plan regeneration
2Productivity
If an integrated execution plan is generated for all queries, then execution efficiency is improved, but adaptability to query changes deteriorates
Solution Approach 1:
The execution plan is divided into independent sub-plans that can be individually modified when queries change. Each sub-plan maintains the efficiency of compiled execution while allowing selective updates without regenerating the entire plan, thus preserving both execution efficiency and adaptability
Solution Approach 2:
The patent creates a universal execution plan structure that can handle multiple queries with different requirements. The plan framework is designed to be multi-functional, accommodating various query types and changes while maintaining overall execution efficiency through a unified planning approach
3Reliability
If the entire integrated execution plan is regenerated when a query changes, then query accuracy is maintained, but time consumption increases
Solution Approach 1:
By segmenting the execution plan into sub-plans, the system can regenerate only the affected sub-plan when a query changes rather than the entire plan. This maintains query accuracy for changed queries while avoiding unnecessary regeneration of unchanged sub-plans, significantly reducing time consumption
Solution Approach 2:
The patent performs preliminary compilation of the overall execution plan structure in advance, identifying sub-plans and their dependencies. This preliminary action enables quick identification of which sub-plans need regeneration when queries change, maintaining accuracy while minimizing regeneration time
Data Source
AI summary
A query method and a query device, where the method includes determining N execution plans respectively corresponding to N query requests according to the received N query requests, determining at least two same first sub-plans, generating a first sub-query result corresponding to any one of the at least two same first sub-plans, and in a process of generating, according to the N query requests, a query result corresponding to each of the N query requests, the same first sub-query result corresponding to any one of the first sub-plans is used for all the same first sub-plans. Hence, a large amount of repeated calculation can be reduced, database system resources are reduced, and query efficiency and a throughput of a database system in a large-scale concurrent query application scenario are improved.


