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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM

Abstract
Description
Claims
Application Information

- R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com