Unlock instant, AI-driven research and patent intelligence for your innovation.

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

Active Publication Date: 2017-12-22
HANGZHOU WOQU NETWORK TECH
View PDF7 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0010] The present invention provides a method for merging calculation of output columns aiming at the disadvantage of large calculation resource occupancy in the prior art

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for merging and calculating output columns
  • Method for merging and calculating output columns
  • Method for merging and calculating output columns

Examples

Experimental program
Comparison scheme
Effect test

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 ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the field of database query optimization and discloses a method for merging and calculating output columns. The method comprises the following steps of (S100) rewriting each output column expression, meaning rewriting an operation expression according to an operation commutative law and a column ID, thereby generating a only one expression for a column set and the expressions, (S200) initializing each output column expression, meaning converting each output column expression into a binary tree for follow-up transversal, and calculating the column set shown up in the current expression and the depth of the expression, (S300) ordering according to final depth of each output column, (S400) marking an expression sharing relationship of the output columns and storing a relationship result into the expression, (S500) directly arranged intermediate state share among the output columns according to the expression sharing relationship generated in the step (S400). CPU utilization rate can be finally reduced, so executing efficiency of the whole query plan can be improved.

Description

technical field [0001] The invention relates to the field of database query optimization, in particular to a method for combined calculation of output columns. Background technique [0002] At present, the process of processing SQL in the database is mainly divided into three stages: [0003] 1. Analysis stage: In this stage, the database converts the standard structured query statement (SQL) from the client into a data structure recognizable by the database with the help of lexical and grammar analysis tools—the syntax analysis tree. [0004] 2. Query optimization stage: The database applies various optimization methods on the parsing tree (that is, common query rewriting in the database), and then calculates an optimal access path for the tables participating in the connection, and finally generates a structure to represent Optimal query plan. [0005] 3. Execute the query plan stage, execute the optimal query plan, and finally obtain the result. [0006] In the query o...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/2453
Inventor 余鹏李建辉熊中哲魏兴华臧冰凌李春陈栋张文件罗春
Owner HANGZHOU WOQU NETWORK TECH