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

SQL (Structured Query Language) rewriting method and device, electronic equipment and storage medium

A technology of equipment and grammatical structure, applied in the database field, can solve problems such as consuming a lot of time, affecting the accuracy of SQL matching, reducing the efficiency of SQL rewriting, etc., and achieve the effect of improving efficiency

Pending Publication Date: 2022-05-06
CHINA TELECOM CLOUD TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, using the above-mentioned SQL rewriting method directly uses SQL as a key to cache the corresponding target AST, which will consume a lot of time because the entire SQL needs to be matched when executing the SQL rewriting operation; and if a large number of similar Extremely high SQL will affect the accuracy of SQL matching
[0006] Therefore, using the above method will reduce the efficiency of SQL rewriting

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 (Structured Query Language) rewriting method and device, electronic equipment and storage medium
  • SQL (Structured Query Language) rewriting method and device, electronic equipment and storage medium
  • SQL (Structured Query Language) rewriting method and device, electronic equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0054] In order to improve the efficiency of SQL rewriting, in the embodiment of this application, based on the target grammatical structure information in the SQL rewriting request, determine the corresponding candidate AST identifier, and then select the corresponding candidate AST identifier according to the candidate AST identifier and the preset AST set. Finally, according to the target parameter information in the SQL rewriting request, the candidate AST is rewritten to obtain the corresponding target AST, and then the target SQL corresponding to the target AST is generated.

[0055] In order to better understand the embodiments of the present application, technical terms involved in the embodiments of the present application are firstly described below.

[0056] (1) Database: It is a software for storing data, which can accept and respond to data storage and search requests from other applications.

[0057] (2) Database proxy: It is a program between the database and th...

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 embodiment of the invention provides an SQL rewriting method and device, electronic equipment and a storage medium, and relates to the technical field of databases. According to the method, the corresponding candidate AST identifier is determined based on the target grammar structure information, then the candidate AST corresponding to the candidate AST identifier is selected according to the candidate AST identifier and the preset AST set, finally, the candidate AST is rewritten according to the target parameter information, the corresponding target AST is obtained, and then the target SQL corresponding to the target AST is generated. By adopting the method and the device, after the SQL rewriting request is received, the candidate AST matched with the candidate AST identifier is selected from the preset AST set based on the candidate AST identifier corresponding to the target grammar structure information, so that the SQL rewriting efficiency is improved.

Description

technical field [0001] The present application relates to the technical field of databases, in particular to an SQL rewriting method, device, electronic equipment and storage medium. Background technique [0002] Structured Query Language (SQL) is widely used in various databases to improve the work quality and efficiency of computer application systems. However, in order to meet specific business needs, it is often necessary to rewrite one SQL into another SQL. [0003] For example, in order to realize the rewriting of SQL, the distributed database Mycat uses the Druid parser to perform lexical analysis and syntax analysis on the initial SQL in sequence, so as to obtain the corresponding initial abstract syntax tree (Abstract Syntax Tree, AST); then, based on a specific According to the business requirements, modify the structure and content of the initial AST to obtain the target AST, and finally complete the rewriting of the initial SQL based on the target AST to generat...

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
IPC IPC(8): G06F16/242
CPCG06F16/2433
Inventor 唐律
Owner CHINA TELECOM CLOUD TECH CO LTD