Method and equipment for optimizing join statements of large and small tables by utilizing on equation condition
By analyzing the on conditions in the join statement, establishing the optimization relationship of size tables, taking the lead in picking up small table data and constructing filtering conditions, the problem of low join operation efficiency of big data tables is solved, and more efficient data processing and query is achieved.
Patent Information
- Application Number
- CN202411459629.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-14
AI Technical Summary
In the context of big data, the large table data involved in join operations in distributed databases is large, resulting in an increase in data transmission and calculation amount and low statement execution efficiency.
By analyzing the on conditions in the join statement, establishing the optimization relationship between the size and size tables, taking the lead in picking up small table data, and using small table data to construct filtering conditions to reduce the transmission of large table data and join operations.
By optimizing the process, the amount of data fetching and join operations of large tables is reduced, and the execution efficiency of join statements in large tables in distributed databases is improved.
Smart Images

Figure CN119441271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to SQL optimization in the field of database technology, and in particular to an optimization method for join statements of large and small tables in a distributed database. Background Art
[0002] In the era of big data, data analysis and processing of massive data is an important challenge facing database products. As the amount of data increases, how to optimize the execution of query statements involving large amounts of data to increase query speed is an important issue for database products.
[0003] As a distributed database, GoldenDB contains data nodes and computing nodes. After receiving the query statement, the computing node will first analyze the statement to generate an execution plan, and then send the table data query statement to the target data node to retrieve the data. After receiving the data returned by each data node, the computing node will calculate and process the data to obtain the final result set. For join statements, when the amount of data in the table involved in the join operation is large, the amount of data transmitted from the data node to the computing node is large, and the subsequent join calculation of the computing node is also large, resulting in low statement execution efficiency.
[0004] In the context of big data, in order to improve the execution efficiency of join statements, the present invention provides a distributed database large and small table join optimization execution scheme using on conditions to implement according to the characteristics of join operations, targeting scenarios where large and small tables exist simultaneously in join statements, and facing multi-table complex join statements. An on condition analysis and processing flow is designed, and an optimization relationship between large and small tables is established based on the single or multiple field equations or other expression equation conditions obtained by analysis. The small table data is first retrieved, and then the small table data and the equation conditions used for optimization between the large and small tables are used to add filtering conditions to the large table query statement. At this time, since the filtering conditions are constructed using the small table data, the large table data hit will generally be relatively small, thereby reducing the amount of large table data retrieved and the amount of subsequent join operations, thereby improving the execution efficiency.
[0005] Join statements are a type of statement that consumes a lot of computing resources and time, especially for distributed databases. When a table with a large amount of data is joined for query, there are problems such as slow query speed and heavy server load. In response to this problem, the present invention proposes an optimized execution scheme for large and small table join statements of a distributed database using on equality conditions. By analyzing and processing the on conditions, an optimized relationship between large and small tables is established. In terms of the process, small table data is first retrieved from data nodes, and small table data is used to add filtering conditions to the large table, thereby reducing the amount of large table data retrieved, reducing the amount of data transmitted and the amount of join operations of computing nodes, and improving the execution efficiency of statements. Summary of the invention
[0006] In the context of big data, in order to improve the execution efficiency of join statements, the present invention provides an optimized execution scheme for large and small table joins implemented by a distributed database using on conditions according to the characteristics of join operations, targeting scenarios where large tables and small tables exist simultaneously in join statements and multi-table complex join statements.
[0007] To achieve the above-mentioned purpose of the invention, the embodiment of the present application first provides a method for optimizing the large and small table join statements using the on equality condition, which is characterized by comprising: Determine whether the left and right tables of the join operation are large or small tables; Determine whether there is a large table that can be optimized in the left and right tables of the join operation. If so, treat it as a large table to be optimized and further analyze the on condition. Otherwise, skip the current join operation. Analyze and process each on condition in the join calculation order, extract the equality condition involving the fields of the small and large tables from the on condition, and when the fields on both sides of the equality condition come from the small table and the large table to be optimized respectively, establish an optimization relationship between the two tables and record the equality in the optimization information of the two tables; Construct query statements for the large and small tables respectively, and fetch the large and small table data required for join operations from the data nodes; Perform a join operation and return the query results.
[0008] To achieve the above-mentioned purpose of the invention, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a program that can be run on the processor, and is characterized in that when the program is executed by the processor, the steps of the above-mentioned large and small table join statement optimization method implemented by using the on equality condition are implemented.
[0009] Also, a computer-readable storage medium is provided, storing at least one program, characterized in that the at least one program can be executed by at least one processor to implement the steps of the above-mentioned large and small table join statement optimization method implemented by using the on equality condition.
[0010] The present invention has the following beneficial effects: The large and small table join statement optimization method implemented by using the on equation condition provided by the present invention can be applied to the fields of database, distributed database, middleware, distributed middleware, distributed storage, etc., by optimizing the on condition analysis and processing flow, according to the single or multiple field equations or other expression equation conditions obtained by analysis, the large and small table optimization relationship is established, the small table data is firstly obtained, and then the small table data and the equation conditions used for optimization between the large and small tables are used to add filtering conditions to the large table query statement. At this time, since the filtering conditions are constructed using the small table data, the large table data hit in general will be relatively small, thereby reducing the amount of large table data obtained and the subsequent join operation amount. The present invention realizes the optimized execution of the large and small table join statement, and improves the execution efficiency of the large and small table join statement of the distributed database. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 This is a flow chart of a method for optimizing large and small table join statements using an on equality condition in an embodiment of the present application; Figure 2 This is a flow chart of a method for determining a size table according to an embodiment of the present application; Figure 3 A schematic flow chart of a method for extracting an equality condition from an on condition according to an embodiment of the present application; Figure 4 A flow chart of a method for constructing a query statement to retrieve data from large and small tables according to an embodiment of the present application; Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0012] In order to make the technical solution of the present invention more clearly understood, the technical solution of the present invention is further described in detail below according to specific embodiments and in combination with the accompanying drawings. Obviously, the following embodiments are only part of the embodiments of the present invention and do not constitute a limitation on the technical solution of the present invention. For those of ordinary skill in the art, other embodiments can also be obtained according to the embodiments of the present application without paying creative labor.
[0013] It should be noted that the order of steps described in the method embodiments in the following embodiments does not constitute a limitation on the technical solution of the present invention. For ordinary technicians in this field, without paying creative labor, they can also reasonably adjust the order of certain steps according to the embodiments of the present application. Example 1
[0014] This embodiment provides a method for optimizing the join statement of large and small tables using the on equality condition. Figure 1 As shown, the following steps are included: Step S101, judging the size of the table, that is, judging whether the left and right tables of the join operation are large tables or small tables.
[0015] The present invention discusses a join statement with both a large table and a small table. To achieve this optimization, it is first necessary to determine whether each table involved in the join operation is a large table or a small table.
[0016] Specifically, the size of the table is determined using the statistical information of the number of rows in each table, such as Figure 2 As shown, the following steps are included: Step S101-1, check whether the upper limit of the small table data volume is configured. If the upper limit of the small table data volume is configured as a non-zero value, then perform the subsequent analysis and optimization process; otherwise, stop the subsequent analysis and optimization process and follow the conventional join statement execution process; To implement the above steps, this embodiment adds a configuration item for presetting the upper limit of the data volume of the small table.
[0017] Step S101-2, obtain the library table information of each table and the statement for sending data nodes to each table, and obtain the where filter condition of each table; Step S101 - 3 : send the library table information of each table to be joined and the where filter condition of each table to the corresponding interface of the histogram function in sequence, and estimate the amount of data of each table retrieved from the data node by using the histogram information.
[0018] Step S101 - 4 : Compare the data volume of each table with the set upper limit of the data volume of a small table. If the estimated value of the number of table rows exceeds the upper limit, it is judged as a large table; otherwise, it is judged as a small table.
[0019] Step S102: Determine whether there is a large table that can be optimized between the left and right tables of the join operation. If so, treat it as a large table to be optimized and further analyze the on condition. Otherwise, skip the current join operation.
[0020] Specifically, the result set of inner join consists of the matching data of the two tables that meet the on condition; in the result set of left / right join, the data of the right / left table, except for all NULL data, comes from the matching data that meets the on condition. Therefore, both the left and right tables of inner join can be optimized (that is, the data is filtered in advance using the on condition and the data of another associated table). The left table of left join cannot be optimized, but the right table can be optimized; the left table of right join can be optimized, but the right table cannot be optimized; neither the left or right table of full join can be optimized. Based on this feature, the information such as join type and join order is used to determine whether the left and right tables of each join operation can be optimized. When there is a large table that can be optimized, it is regarded as the large table to be optimized and the on condition is further analyzed, otherwise the current join operation is skipped and no analysis is performed.
[0021] Specifically, when the current join is inner join, check whether the left table is a large table. If not, check whether the right table is a large table. When the current join is left join, check whether the right table is a large table. When the current join is right join, check whether the left table is a large table. The above large table is regarded as a large table to be optimized. If it does not belong to any of the above scenarios, there is no large table to be optimized, skip the join, and do not use its on condition for subsequent processing.
[0022] Step S103, analyzing and processing each on condition according to the join calculation order; extracting the equality condition involving the fields of the small and large tables from the on condition, when the fields on both sides of the equality condition come from the small table and the large table to be optimized respectively, establishing an optimization relationship for the two tables, and recording the equality in the optimization information of the two tables.
[0023] The establishment of optimization relationships and the construction of large table filtering conditions are all based on the analysis and extraction of on conditions. To achieve optimization, the equality conditions involving the fields of the two tables are extracted from the on conditions. The expressions on both sides of the equal sign in the equality conditions can be a single field or other complex expressions containing fields, such as functions.
[0024] Extract the equality conditions involving the size table fields from the on condition, such as Figure 3 As shown, the following steps are included: Step S103-1, taking the equality condition, specifically including: Step S103-1-1, if the on condition is multiple conditions connected by and, select all equality conditions from the multiple conditions in order; Step S103-1-2: If the on condition is a single equation condition, directly extract the equation condition; Step S103-1-3: If the on condition is in other forms, no subsequent analysis or processing is performed on the on condition.
[0025] Step S103-2, filter the equation conditions, filter the equation conditions obtained from an on condition in order, including: Step S103-2-1, check whether the expression on the left side and the expression on the right side of the equation are both expressions supported by the data node for query; Step S103-2-2, check whether there are fields on the left side of the equation, and whether the fields on the left side are all from the same table; Step S103-2-3, check whether there are fields on the right side of the equation, and whether the fields on the right side are all from the same table; Step S103-2-4, check whether the left field and the right field are from different tables; The equation that passes the above checks is the equation that meets the requirements.
[0026] Step S103-3, establishing an optimization relationship between the two tables, and recording the equality conditions in the optimization information of the two tables, includes the following steps: Step S103-3-1, check the equations that meet the requirements in order. If the fields on both sides of the equation come from the large table to be optimized and a small table respectively, an optimization relationship is established for the two tables, and the large and small tables are respectively regarded as the large table to be optimized and the small table for optimization. The equation condition is recorded in the optimization information of the two tables and regarded as the equation condition or optimization equation for optimization. Here, the equal sign of the equation condition is the large table expression and the small table expression respectively, and then proceed to the next step. If the fields on both sides of the equation do not come from the large table to be optimized and a small table respectively, this step is checked for the next equation that meets the requirements until an equation condition that meets the requirements is found and then the next step is entered. If all the equation conditions that meet the requirements are not met, the on condition is not processed subsequently.
[0027] Step S103-3-2, check the remaining equations that meet the requirements in the same on condition in order. If the fields on both sides of the equation are respectively from the above-mentioned large table to be optimized and the above-mentioned small table for optimization, then the equation condition is also added to the optimization information of the two tables and is regarded as the equation condition for optimization.
[0028] Step S104: construct query statements for the large and small tables respectively, and retrieve the large and small table data required for the join operation from the data nodes.
[0029] like Figure 4 As shown, specifically including: Step S104 - 1 , adding a data column to the query statement of the small table for optimization, and retrieving the small table data.
[0030] Extract the small table expression from the equation condition in the optimization information. When the small table expression is not in the small table query statement, in order to obtain the value of the small table expression in the equation condition in the optimization information, add the small table expression to the output column of the small table query statement, control the statement delivery process, first deliver the small table query statement to the data node, and obtain the small table data.
[0031] Step S104-2: Add filtering conditions to the query statement of the optimized large table to retrieve the required large table data. Specifically, according to the optimization information, add where in filtering conditions to the large table to reduce the amount of large table data retrieved. This includes: Step 104-2-1, for each large table to be optimized, take the large table expression in the equation condition used to optimize the table as the left value of in in the where in filter condition of the table; when there are multiple optimization equations, print the expressions in the order in which the equations are recorded, separated by commas, enclosed in brackets, and the whole is used as the left value of in; Step 104-2-2, sequentially obtain the query results of the small table expression on the other side of the optimization equation as the right value of in, and add a where filter condition to the large table query statement; when there are multiple optimization equations, for each row of data retrieved from the small table, print the query results of each small table expression in the order in which the optimization equations of the two tables are recorded, separated by commas and enclosed in parentheses, as a set of results of the left value of in; Step 104-2-3: Consider the scenario of complex join, select the small table expressions on one side of the optimization equation in order, calculate the result values of each small table expression when all fields are NULL, form a result of the left value of in, and add it to the right value of in; Step 104-2-4: Send query statements for each large table to the data node to retrieve the large table data.
[0032] The left side of in is the large table expression on one side of the expression equation, and the right side of in is the result value of the small table expression on the other side obtained from the data node. Since the small table may have participated in the outer join operation before, the result value of the expression when all fields in the small table expression are NULL is calculated and added to the right side of in as a target value of the large table expression (it is also possible not to calculate the small table expression when all fields are NULL, and calculate it on the data node after sending it down). After constructing the large table query statement, send the statement to the data node to obtain the large table data required for the join operation.
[0033] Step S105: perform a join operation and return the query result.
[0034] Using the data from each table, the computing node completes the join operation and other subsequent operations and processing, obtains the final result of the query statement, and returns it to the client. Example 2
[0035] This embodiment uses the following statements as examples to illustrate the optimization method of the present invention: select t1.id, t2.id, t3.id from t1 left join t2 on t1.col1=t2.col1join t3 on t3.col2=isnull(t2.col2) and t3.col3=t1.col3 and t2.col4+t2.col5=2*t3.col4 where t1.id<100 and t2.id<100; 1. Determine the size table Step 1-1: Assume that the upper limit of the number of rows in the small table is configured as 1000 rows, and the value is non-zero; Step 1-2: Assume that each of tables t1, t2, and t3 has 1 million rows of data. According to the original execution plan, issue the following statements to retrieve data from tables t1, t2, and t3: "select t1.id, t1.col1, t1.col3 from t1 where t1.id<100;", "selectt2.id, t2.col1, t2.col2, t2.col4, t2.col5 from t2 where t2.id<100;", "selectt3.id, t3.col2, t3.col3, t3.col4 from t3;” Among them, t2 and t3 carry the where conditions t1.id<100 and t2.id<100 respectively; send the table names of the three tables and the where conditions they carry to the histogram interface to obtain the estimated number of rows. Assume that according to the histogram estimation, t1 and t2 tables both extract 100 rows of data, and t3 table extracts 1 million rows of data; compare the number of rows with the configured value, and determine that t1 and t2 are small tables, and t3 is a large table; 2. According to the join order, take the on condition of each join for analysis and processing Analyze the on condition of the first join Step 2-1: For t1 left join t2 on t1.col1=t2.col1, the right table of the left join is a small table, not the large table to be optimized, so skip the left join.
[0036] Analyze the on condition of the second join in order Step 2-1: For the second join in (t1 left join t2 on t1.col1=t2.col1) join t3 on t3.col2=isnull(t2.col2) and t3.col3=t1.col3 and t2.col4+t2.col5=2*t3.col4, the join type is inner join, the left table is the result set of the previous left join and is not a large table, and the right table t3 is a large table, so t3 is the large table to be optimized.
[0037] Step 2-2: The on condition of the join is multiple conditions connected by AND. Take out all the equality conditions in order, which are: t3.col2=isnull(t2.col2), t3.col2=t1.col3, t2.col4+t2.col5=2*t3.col4. Step 2-3: Filter out the equation conditions that meet the requirements. The above equations are all equation conditions that meet the requirements; Step 2-4-1: Check the field equations that meet the requirements in order. t3.col2 = isnull (t2.col2) The fields on the left are from the large table t3 to be optimized, and the fields on the right are from the small table t2. The large table t3 has not yet established an optimization relationship. Establish an optimization relationship between the large table t3 and the small table t2 and record the equation.
[0038] Step 2-4-2: Continue to process subsequent equation conditions in order. The left field of the equation t3.col3=t1.col3 comes from the large table t3 to be optimized, and the right field comes from the small table t1. Among them, t1 is not the small table t2 used to optimize t3, so skip this condition; the left field of the equation t2.col4+t2.col5=2*t3.col4 comes from the small table t2 used to optimize t3, and the right field comes from the large table t3 to be optimized. Add this equation condition to the optimization information of these two tables; at this point, the analysis of the equation of all fields that meet the requirements of the join is completed, and the optimization relationship between t3 and t2 is established. The corresponding optimization equations are: t3.col2=isnull(t2.col2), t2.col4+t2.col5=2*t3.col4.
[0039] 3. Add data columns to the query statements of the small table used for optimization to retrieve the data of the small table Step 3-1: In the optimization relationship established in step 2, there is only one small table, table t2, for optimization. Take all expressions belonging to this small table in the optimization equation and add them to the output column of the query statement for this table. The query statement becomes "select t2.id,t3.col1, t2.col2, t2.col4, t2.col5, isnull(t2.col2), t2.col4+t2.col5 from t2where t2.id<100;" Step 3-2: Send query statements for small tables t1 and t2 to the data node to retrieve data from the small tables. The two statements sent are: "select t1.id, t1.col1, t1.col3 from t1 where t1.id<100;", "select t2.id, t3.col1, t2.col2, t2.col4, t2.col5, isnull(t2.col2), t2.col4+t2.col5 from t2where t2.id<100;" 4. Add filtering conditions to the query statements of the optimized large table to retrieve the required large table data Step 4-1: In the optimization relationship established in step 2, only table t3 is optimized; the large table expression in the optimization equation of the table is sequentially taken to form the left value of the where condition "(t3.col2, 2*t3.col4) in ()" Step 4-2: Assume that n rows of data are retrieved from small table t2, where the value of each row of data (isnull(t2.col2), t2.col4+t2.col5) is (val11, val21), (val12, val22), ...,(val1n, val2n), and based on this, the filtering condition of large table t3 is constructed as (t3.col2, 2*t3.col4) in ((val11, val21), (val12, val22), ...,(val1n, val2n)).
[0040] Step 4-3: When all fields are NULL, the value of (isnull(t2.col2), t2.col4+t2.col5) is (1,null), which is added to the right value of the in condition to obtain the large table query statement "select t3.id, t3.col2,t3.col3, t3.col4 from t3 where (t3.col2, 2*t3.col4) in ((val11, val21),(val12, val22), ...,(val1n, val2n), (1, null));" Step 4-4: Send the query statement of the big table t3 to the data node to retrieve the big table data. The statement sent is: "select t3.id, t3.col2, t3.col3, t3.col4 from t3 where (t3.col2, 2*t3.col4)in ((val11, val21), (val12, val22), ...,(val1n, val2n), (1, null));" 5. Complete subsequent calculations The data from the three tables are used to complete the join operation, and other subsequent operations and processing are performed to obtain the final result of the query statement. Example 3
[0041] This embodiment provides an electronic device, such as Figure 5 As shown, it includes a processor 31 and a memory 32 that is communicatively connected to the processor 31. The memory 32 stores a program that can be run on the processor 31, and when the program is executed by the processor 31, the steps of the large and small table join statement optimization method implemented by using the on equality condition provided in the above embodiment are implemented.
[0042] The above program can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. Example 4
[0043] This embodiment provides a computer-readable storage medium storing at least one program. The at least one program can be executed by at least one processor to implement the steps of the large and small table join statement optimization method implemented by the on equality condition provided in the above embodiment.
[0044] The above storage media include: U disk, mobile hard disk, read-only memory, random access memory, disk or CD and other media that can store program code and their combination. With the development of science and technology, the meaning of storage media may become more and more extensive and not limited to tangible media.
[0045] Those skilled in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present invention. In addition to the above-mentioned embodiments, the present invention may also have other implementation modes; any technical solutions formed by equivalent replacement or equivalent transformation shall fall within the protection scope required by the present invention.
Claims
1. A method for optimizing large and small table join statements using on equality conditions, characterized in that: include: Determine whether the left and right tables of the join operation are large or small tables; Determine whether there is a large table that can be optimized in the left and right tables of the join operation. If so, treat it as a large table to be optimized and further analyze the on condition. Otherwise, skip the current join operation. Analyze and process each on condition in the join calculation order, extract the equality condition involving the fields of the small and large tables from the on condition, and when the fields on both sides of the equality condition come from the small table and the large table to be optimized respectively, establish an optimization relationship for the two tables and record the equality in the optimization information of the two tables; Construct query statements for the large and small tables respectively, and fetch the large and small table data required for join operations from the data nodes; Perform a join operation and return the query results.
2. The method for optimizing large and small table join statements using the on equality condition as claimed in claim 1, characterized in that: Construct query statements for the small and large tables respectively, and fetch the small and large table data required for the join operation from the data node, including: extracting the small table expression from the equality condition in the optimization information, adding it to the output column of the small table query statement when the small table expression is not in the small table query statement, and sending the small table query statement to the data node to fetch the small table data.
3. The method for optimizing large and small table join statements using the on equality condition as claimed in claim 1, characterized in that: Construct query statements for the large and small tables respectively, and fetch the large and small table data required for the join operation from the data node, including: adding where in filtering conditions for the large table to reduce the amount of large table data fetched, where the left side of in is the large table expression on one side of the on equation, and the right side of in is the result value of the small table expression on the other side of the on equation fetched from the data node. After constructing the large table query statement, send the large table query statement to the data node to fetch the large table data.
4. The method for optimizing large and small table join statements using on equality conditions as claimed in claim 3, characterized in that: Calculate the expression result value when all fields in the small table expression are NULL, and add it to the right side of in as the target value of the large table expression; or directly concatenate the small table expression when all fields on the right side of in are NULL, and then issue the large table query statement for calculation on the data node.
5. The method for optimizing large and small table join statements using the on equality condition as claimed in claim 1, characterized in that: Determine whether the left and right tables of the join operation are large or small, including: Check whether the upper limit of the small table data volume is configured. If the upper limit of the small table data volume is configured to a non-zero value, proceed to the next step. Otherwise, stop the subsequent analysis and optimization process and follow the normal join statement execution process. Get the library table information of each table and the statements for sending data nodes to each table, and get the where filter conditions for each table; The database table information of each table and the where filter conditions of each table are sent to the histogram function interface in turn, and the amount of data of each table retrieved from the data node is estimated using the histogram information; Compare the data volume of each table with the configured upper limit of the small table data volume. If the data volume is larger than the upper limit, it is judged as a large table; otherwise, it is judged as a small table.
6. The method for optimizing large and small table join statements using on equality conditions as claimed in claim 1, characterized in that: Determine whether there is a large table that can be optimized in the left and right tables of the join operation. If so, treat it as a large table to be optimized and further analyze the on condition. Otherwise, skip the current join operation, including: When the join operation is inner join, check whether the left table is a large table. If not, check whether the right table is a large table. When the join operation is left join, check whether the right table is a large table; When the join operation is a right join, check whether the left table is a large table; The large table detected in the above scenario is regarded as the large table to be optimized and the on condition is further analyzed. If no large table is detected in the above scenario, there is no large table to be optimized and the current join operation is skipped.
7. The method for optimizing large and small table join statements using on equality conditions as claimed in claim 1, characterized in that: Extract equality conditions involving size table fields from the on condition, including: Take the equality conditions, including: If the on condition is multiple conditions connected by and, all equality conditions are taken out from these multiple conditions in order; If the on condition is a single equality condition, the equality condition is directly taken out; If the on condition is in other forms, no subsequent analysis and processing will be performed on the on condition; Filter the equation conditions, filter the equation conditions obtained from an on condition in order, and the equations that pass the following checks are the equations that meet the requirements, including: Check whether the expressions on the left and right sides of the equation are expressions that the data node supports querying; Check if there are fields on the left side of the equation and that the fields on the left side are from the same table; Check if there are fields on the right side of the equation and that the fields on the right side are from the same table; Check whether the left and right fields are from different tables.
8. An electronic device comprising a processor and a memory, wherein the memory stores a program that can be run on the processor, characterized in that: When the program is executed by the processor, the steps of the method for optimizing large and small table join statements using the on equality condition described in any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium storing at least one program, characterized in that: The at least one program can be executed by at least one processor to implement the steps of the large and small table join statement optimization method implemented by using the on equality condition as described in any one of claims 1 to 7.