Method for merging and calculating output columns
A collection and expression technology, applied in the field of database query optimization, can solve problems such as large computing resource occupancy, achieve the effects of eliminating overhead, improving execution efficiency, and reducing usage
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0052] There are columns X, Y, and Z in table T1, and in the metadata inside the database, the ID of X is smaller than the ID of Y, and the ID of Y is smaller than the ID of Z. Currently, the following SQL needs to be processed:
[0053] SELECT SUM(X+Y), AVG((X+Y)*Z) FROM T1.
[0054] Inside the database, after the SQL is analyzed, a syntax analysis tree is obtained, and then an optimal access path is obtained through query optimization. The access path is mainly determined to require a full table scan of the T1 table. Next, apply the processing procedure of the present invention:
[0055]1. Rewriting the output expression is mainly to rewrite the expression according to the commutative law of operations and the ID of the column. It can be rewritten in ascending or descending order according to the ID. No matter which sort is used, it will not affect the implementation of the present invention. If the column ID is rewritten in descending order, SUM(X+Y) needs to be rewritten ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


