Database Subquery Result Storage and Verification
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional SQL grammar requires separate verification of subquery results, which can be cumbersome and time-consuming, especially in complex queries that access multiple tables, making it difficult to diagnose and manage query abnormalities.
Innovation Solution
A method for processing queries in a database management system that involves receiving a main query with a subquery, identifying indications for independent management and storage of the subquery's processing result, and determining the appropriate storage type for the subquery's result, allowing it to be stored separately from the main query's result.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If subquery results are verified separately from main query, then query result accuracy can be ensured, but query processing time increases significantly
Solution Approach 1:
The patent combines the execution of main query and subquery into a single processing pass. The query processing unit executes both queries simultaneously and stores subquery results in a temporary storage unit, eliminating the need for separate verification passes and reducing total processing time while maintaining result accuracy.
Solution Approach 2:
The patent performs preliminary storage of subquery results during the main query execution process. By storing subquery results in a temporary storage unit during the same processing pass, the system prepares verification data in advance, avoiding subsequent re-execution and time-consuming separate verification steps.
2Difficulty of detecting and measuring
If complex queries are divided into multiple subqueries for verification, then query debugging becomes possible, but query complexity increases
Solution Approach 1:
The patent introduces a temporary storage unit as an intermediary between the query processing unit and the result verification process. This intermediary stores subquery results during execution, enabling debugging and verification without requiring complex query decomposition, thus simplifying the overall query structure while maintaining detectability.
3Ease of operation
If subquery results are stored independently from main query results, then result verification becomes easier, but storage management complexity increases
Solution Approach 1:
The patent segments storage into distinct functional units: a temporary storage unit for subquery results and the main database storage for final results. This segmentation enables easy verification by allowing independent access to subquery results while the storage management system handles the complexity of coordinating these separate storage areas automatically.
Data Source
AI summary
Disclosed is a method for processing a query in a database management system (DBMS). The method includes: receiving a main query including a subquery; identifying an indication to independently manage a processing result for the subquery in the received main query by parsing the received main query—the indication including storing type information for the processing result of the subquery; determining a storing type for independently storing the processing result for the subquery based on the indication; and storing the processing result for the subquery independently from the processing result for the main query while performing processing for the main query according to the determined storing type.


