SQL statement optimization method based on constant substitution

An optimization method and constant technology, applied in special data processing applications, instruments, electrical digital data processing, etc., can solve problems such as reducing multi-table connections and eliminating correlation, and achieve the effect of eliminating correlation

Active Publication Date: 2014-03-26
SHANGHAI DAMENG DATABASE
View PDF3 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

None of the currently disclosed database query optimization technologies can reduce multi-table joins and eliminate dependencies through constant replacement to the greatest extent.

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
  • SQL statement optimization method based on constant substitution
  • SQL statement optimization method based on constant substitution
  • SQL statement optimization method based on constant substitution

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0043] The present invention will be further described below in conjunction with specific examples.

[0044] see figure 1 , a kind of SQL statement optimization method based on constant replacement of the present invention, comprises steps:

[0045] S1: Create a replacement linked list according to the Boolean expression in the WHERE clause in the target SQL statement;

[0046] S2: Traverse the replacement linked list, search for a driving expression, the driving expression is an equivalent expression, one side of the equivalent condition is a column, and the other side is a constant; if the driving expression is found, continue to the next step, otherwise end the step ;

[0047] S3: Perform constant replacement on the target SQL statement according to the current driving expression, adjust the replacement linked list and mark the current driving expression;

[0048] S4: Continue to search for the next driving expression, if the driving expression is found, return to step S...

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 discloses an SQL statement optimization method based on constant substitution. The SQL statement optimization method based on constant substitution comprises the following steps: step 1, a substitution chain table is created according to a Boolean expression of WHERE clauses in a target SQL statement; step 2, the substitution chain table is traversed and a driving expression is searched for, wherein the driving expression is an equivalent expression, one side of the equivalent condition is a column, the other side of the equivalent condition is a constant, the next step continues to be executed if the driving expression is found through searching, and the step 2 is ended otherwise; step 3, according to the current driving expression, constant substitution is conducted on the target SQL statement, the substitution chain table is adjusted, and the current driving expression is marked; step 4, a next driving expression continues to be searched for, the step 3 is executed again if the next driving expression is found through searching, and the step 4 is ended otherwise. The SQL statement optimization method based on constant substitution has the advantages of being high in optimization level, and capable of improving system performance substantially.

Description

technical field [0001] The invention relates to an SQL statement optimization method, in particular to a constant replacement-based SQL statement optimization method. Background technique [0002] In today's society, everything is digitized. With the advent of the big data era, databases often need to select data that meets specific needs from massive amounts of data to complete query operations. SQL statements usually use the WHERE clause to select the data to be manipulated. [0003] Generally speaking, when selecting data from one table, the performance of using a single-table selection operation is much better than that of multi-table joins. If the optimizer can semantically convert the multi-table join in the WHERE clause into a single-table selection operation, the executor will significantly reduce the running time and greatly improve the overall performance of the system; in addition, the performance of non-correlated queries is much better Regarding the performan...

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 SHANGHAI DAMENG DATABASE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products