SQLScript Compilation Graph Tracing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional database systems obscure the associations between design-time objects and execution plans, making it difficult for users and developers to identify elements that need modification to address performance or functionality issues.
Innovation Solution
A compilation graph is generated to illustrate delta transformations during the compilation of queries or procedures, facilitating the identification of correlations between design-time and execution-time elements, and enabling plan analysis, error tracing, and monitoring.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If compiler optimizations (SQL statement inlining, dead code elimination, control flow simplification) are applied to design-time objects, then execution plan performance is improved, but the association between design-time objects and execution plan elements is lost
Solution Approach 1:
The patent creates a compilation graph that is a copy of the transformation process, preserving the associations between design-time objects and execution plan elements. The graph nodes represent elements from both stages, and edges represent the transformations applied, allowing users to trace back optimized execution plans to their original design-time sources without affecting the optimization process itself.
Solution Approach 2:
The compilation graph serves as an intermediary structure that bridges design-time objects and execution plans. It captures the delta transformations as a separate representation, allowing users to analyze the correspondence between stages without interfering with the compiler's optimization process or the execution engine's performance.
2Speed
If aggressive optimizations are applied during compilation, then execution speed is improved, but the ability to diagnose performance issues by tracing back to design-time objects is reduced
Solution Approach 1:
The compilation graph provides feedback mechanisms that allow users to trace execution plan elements back to their design-time origins. By representing transformations as graph edges, the system enables diagnostic feedback when performance issues arise, allowing developers to understand what optimizations were applied and to which original code elements, thus facilitating targeted debugging and optimization.
3Manufacturing precision
If design-time objects are heavily transformed during optimization, then execution plan quality is improved, but user understanding of the correspondence between original code and optimized plan is lost
Solution Approach 1:
The patent adds another dimension to the compilation process by creating a graphical representation that exists alongside the traditional compilation pipeline. This compilation graph dimension preserves the transformation history and associations, allowing users to visualize and understand the correspondence between design-time objects and execution plans without compromising the quality of the optimized execution plan.
Data Source
AI summary
A system comprises generation of a parse tree comprising a plurality of query parse nodes, each of the plurality of query parse nodes corresponding to a respective one of a plurality of portions of a script definition, generation of a first intermediate representation tree comprising an intermediate representation node corresponding to a respective one of each of the plurality of query parse nodes, wherein an intermediate representation node represents a logical operation corresponding to the portion of the script definition of the query parse node which corresponds to the intermediate representation node, definition of links between each of the plurality of query parse nodes and its corresponding the intermediate representation node, determination of a second intermediate representation tree, the second intermediate representation tree resulting from an optimizer transformation executed on the first intermediate representation tree, generation of an intermediate representation node corresponding to a transformed first one or more of the intermediate representation nodes of the first intermediate representation tree, definition of links associating the intermediate representation node corresponding to the transformed first one or more of the intermediate representation nodes with the transformed first one or more of the intermediate representation nodes of the first intermediate representation tree, generation of a script execution graph of script execution nodes, each of the script execution nodes corresponding to a second one or more nodes of the second intermediate representation tree, definition of links associating each of the script execution nodes with its corresponding second one or more of the intermediate representation nodes, generation of a graph comprising the plurality of query parse nodes, the intermediate representation nodes, the script execution nodes and the links, and presentation of the graph.


