Query Runtime Error Position Tracking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging runtime errors in database management systems is cumbersome and time-consuming due to the lack of precise position information for symbols causing the errors in long and complex queries.
Innovation Solution
A system and method that provide position information for runtime errors by scanning queries to determine the position of symbols, incorporating this information into a parse tree, optimizer tree, and query execution plan, and including it in exception messages to facilitate error debugging.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If position information is not provided for runtime errors, then the error message structure remains simple, but debugging becomes cumbersome and time-consuming
Solution Approach 1:
The patent applies preliminary action by determining and storing position information of query symbols during the parsing phase, before runtime errors occur. The parser assigns position data to each symbol in the query, and this information is preserved through the optimization stages and included in runtime error messages, eliminating the need for additional error analysis during execution.
Solution Approach 2:
The patent uses the parse tree as an intermediary structure that carries position information from the parsing stage through to the query execution stage. The position information is embedded in the parse tree nodes and transferred through the optimization process, serving as a mediator that connects the original query structure with the final error reporting mechanism.
2Measurement precision
If position information is tracked through parse tree and optimizer tree, then error location precision is improved, but system complexity increases
Solution Approach 1:
The patent merges position information tracking with the existing parse tree and optimizer tree structures. Instead of creating separate tracking mechanisms, the position data is integrated into the node structures of these existing trees, allowing precision error location without adding separate complex systems for tracking.
Solution Approach 2:
The parse tree and optimizer tree structures serve multiple functions: they perform their traditional roles in query processing while simultaneously carrying position information for error tracking. This multi-functionality eliminates the need for dedicated error tracking structures, reducing overall system complexity while maintaining precision.
Data Source
AI summary
A query is parsed and positions of symbols of the query are determined. A parse tree including the positions of the symbols is generated based on the parsed query. The parse tree is sent to a DBMS optimizer. The parse tree is transformed into an optimizer tree. The optimizer tree includes the positions of the symbols of the query.Based on the optimizer tree, a query execution plan is generated for the execution of the query. The positions of the symbols of the query is copied from the optimizer tree into the query execution plan. The query execution plan is sent to a query execution engine.The query is executed in accordance with the query execution plan. When a runtime error is detected, an exception message associated with the runtime error is displayed. The error message includes an error code and the positions of the symbols of the query.


