Supercharge Your Innovation With Domain-Expert AI Agents!

Distributed database query optimization method and system and electronic equipment

A distributed query and optimization method technology, applied in the field of system and electronic equipment, and the optimization method of distributed database query, can solve the problem that the join connection query cannot be delegated, cannot be used, and aggravates the computing pressure and memory pressure of distributed database middleware, etc. question

Pending Publication Date: 2022-08-05
AIKESHENG INFORMATION TECH SHANGHAI
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, because the SQL query statement optimization method based on the equivalence relationship of fragmented tables in the prior art can only be applied to the number of data tables to be queried involved in the SQL query statement is two, and there are only two data tables between them. In the case of a unified shard table equivalence relationship, when the SQL query statement involves multiple data tables (the number of data tables is greater than or equal to 3), if there is no unified Fragmented table equivalence relationship, the optimization method of SQL query statement in the prior art cannot be used, and the join connection query cannot be distributed to the database node for execution, which finally increases the computing pressure and memory pressure of the distributed database middleware

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
  • Distributed database query optimization method and system and electronic equipment
  • Distributed database query optimization method and system and electronic equipment
  • Distributed database query optimization method and system and electronic equipment

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0067] Example 1: If the SQL query sent by the client is:

[0068] SELECT a.Name,a.DeptName,b.Manager,c.salary FROM Employee a LEFT JOINLevel c on a.level=c.levelname LEFT JOIN Dept b on a.DeptName=b.DeptNameorder by a.name, then use this The directed acyclic graph formed by the invention is as follows image 3 .

example 2

[0069] Example 2: If the SQL query statement sent by the client is:

[0070]SELECT a.Name,a.DeptName,b.Manager,c.salary FROM Employee a LEFT JOINLevel c on a.Level=c.levelname LEFT JOIN Dept b on a.DeptName=b.DeptNameand b.deptid=2order by a. Name, then the directed acyclic graph formed by the present invention is as follows Figure 4 .

[0071] It should be noted that, in this embodiment of the present invention, after parsing the SQL query statement in step S200 to obtain metadata corresponding to the SQL query statement, and in step S300 using the metadata to generate a directed Before the ring graph, the SQL query statement sent by the client can be simplified according to the following four relational algebra rules. The four relational algebra rules are as follows:

[0072] Rule A: When multiple data tables have join query, but the latter two data tables have no direct sharding table equivalence relationship, they exchange the join connection order without affecting th...

example 3

[0084] Example 3, assuming that the SQL query sent by the client is:

[0085] SELECT a.Name,a.DeptName,b.Manager,c.salary FROM Employee a LEFT JOINLevel c on a.level=c.levelname LEFT JOIN Dept b on a.DeptName=b.DeptNameAND c.levelId=2order by a. name.

[0086] Then according to rule B, the order of the three data tables involved in the SQL statement cannot be exchanged. Therefore, the directed acyclic graph constructed for this SQL query will look like Figure 5 In that way, there is only one final topological sort (the order cannot be exchanged according to rule B), so the SQL query statement in the embodiment cannot be optimized.

[0087] Step S400: Generate a distributed query execution plan according to the directed acyclic graph, and obtain corresponding query results from multiple database nodes based on the distributed query execution plan.

[0088] Wherein, the distributed query execution plan includes a plurality of execution sub-plans, each of the execution sub-pl...

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 provides a distributed database query optimization method and system and electronic equipment, and is applied to the technical field of database query. Due to the fact that the node where the distributed data tables have the same splitting rule and the splitting columns of the two tables have the equivalent relation is preferentially selected to serve as the root node or the secondary node, in the obtained topological sequence, the data tables with the splitting columns having the equivalent relation are adjacent and preferentially. Therefore, during distributed query plan and actual execution, join connection query with the equivalence relation between the split columns in the SQL query statement can be issued to the database node to be executed, and the problem that in the prior art, due to the fact that connection query is conducted on multiple data tables, the connection query efficiency is high is solved. And if the uniform equivalence relationship does not exist among the plurality of tables, the join connection query cannot be issued to the database node to be executed, and finally the operation pressure and the memory pressure of the distributed database middleware are increased.

Description

technical field [0001] The invention relates to the technical field of database query, in particular to an optimization method, system and electronic device for query of a distributed database. Background technique [0002] The database system hides the details of the data structure from the user and provides a data-independent interface. The user only needs to briefly describe the query behavior, and does not need to pay attention to the internal process of obtaining these data. Query optimization is to minimize the total resource occupation and total time consumption of the query as much as possible in the process of generating an execution strategy by the query execution engine. The database management system can have a built-in query optimizer to control and speed up the process of query execution and data transmission. After the user query expression is parsed and processed by the query processor, the query optimizer selects an appropriate data access for the query. Po...

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/2453G06F16/242G06F16/2455G06F16/2458G06F16/27
CPCG06F16/2453G06F16/27G06F16/242G06F16/2456G06F16/2471
Inventor 阎虎青鲍凤其董诚怡袁琳铸郭奥门文韵涵
Owner AIKESHENG INFORMATION TECH SHANGHAI
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More