Statement execution method, statement execution apparatus, query method and query system
By constructing and removing statement execution paths for index nodes, the problem of excessive index scans in database queries is solved, achieving more efficient resource utilization and query speed.
Patent Information
- Application Number
- PCT/IB2025/053171
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-21
- Filing Date
- 2025-03-26
- Publication Date
- 2025-11-27
Smart Images

Figure IB2025053171_27112025_PF_FP_ABST
Abstract
Description
[0001] The present disclosure claims priority to Chinese Patent Application No. 202410635730.2, filed on May 21, 2024, with the Chinese Patent Office, entitled "Sentence execution method, sentence execution device, query method and system", the entire contents of which are incorporated herein by reference. TECHNICAL FIELD Embodiments of the present disclosure relate to the technical field of computer technology, and in particular to a sentence execution method, a sentence execution device, a query method and a system. BACKGROUND With the advent of the big data era, a large amount of data is usually stored in a database. When performing data query operations in the database through SQL statements, since the database can correspond to multiple indexes, the existence of indexes can improve the query efficiency, and the SQL statements usually contain multiple types of operators such as filtering, aggregation and sorting. Therefore, one SQL statement can plan multiple execution paths containing indexes. In actual execution, an execution path containing an index is preferentially selected. However, due to the blind use of indexes, the use of indexes may lead to the problem of excessive scanning data caused by global secondary indexes, thereby slowing down the query speed and causing resource waste. Therefore, an effective method is needed to solve the above problem. SUMMARY In view of this, embodiments of the present disclosure provide a sentence execution method. One or more embodiments of the present disclosure also relate to a sentence execution device, a query method, a query device, a query system, a computing device, a computer-readable storage medium and a computer program, to solve the technical defects in the prior art. According to a first aspect of an embodiment of the present disclosure, a sentence execution method is provided, including: constructing a sentence syntax tree based on a sentence execution path corresponding to a target sentence, wherein the target sentence is associated with a target database; in a case where a reference syntax tree pre-set in the target database is structurally matched with the sentence syntax tree, and the sentence syntax tree contains a target index node, removing the index node for the sentence execution path, generating a first sentence execution path, and removing the target index node, generating a second sentence execution path; selecting a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to a path selection strategy and executing the target sentence execution path.According to a second aspect of the embodiments of the present disclosure, a sentence execution apparatus is provided, comprising: a construction module configured to construct a sentence syntax tree based on a sentence execution path corresponding to a target sentence, wherein the target sentence is associated with a target database; a generation module configured to, in a case that a reference syntax tree preset by the target database matches a structure of the sentence syntax tree, and the sentence syntax tree contains a target index node, remove the index node for the sentence execution path, generate a first sentence execution path, and remove the target index node to generate a second sentence execution path; and a selection module configured to select a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to a path selection strategy and execute the target sentence execution path. According to a third aspect of the embodiments of the present disclosure, a query method is provided, which is applied to a cloud side, comprising: receiving a query request submitted by an end side, and determining a target sentence based on the query request; constructing a sentence syntax tree based on a sentence execution path corresponding to the target sentence, wherein the target sentence is associated with a target database; in a case that a reference syntax tree preset by the target database matches a structure of the sentence syntax tree, and the sentence syntax tree contains a target index node, removing the index node for the sentence execution path, generating a first sentence execution path, and removing the target index node to generate a second sentence execution path; selecting a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to a path selection strategy; executing the target sentence execution path to obtain query information, and sending the query information as a feedback of the query request to the end side.According to a fourth aspect of the embodiments of the present disclosure, a query device is provided, which is applied to a cloud side and includes: a receiving module configured to receive a query request submitted by an end side and determine a target sentence based on the query request; a constructing module configured to construct a sentence syntax tree based on a sentence execution path corresponding to the target sentence, wherein the target sentence is associated with a target database; a generating module configured to, in a case where a reference syntax tree preset in the target database matches a structure of the sentence syntax tree and the sentence syntax tree contains a target index node, remove the index node for the sentence execution path, generate a first sentence execution path, and remove the target index node to generate a second sentence execution path; a selecting module configured to select a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to a path selection strategy; and a sending module configured to execute the target sentence execution path to obtain query information and send the query information as feedback of the query request to the end side. According to a fifth aspect of the embodiments of the present disclosure, a query system is provided, which includes a cloud side and an end side; the end side is configured to submit a query request to the cloud side; the cloud side is configured to determine a target sentence based on the query request; construct a sentence syntax tree based on a sentence execution path corresponding to the target sentence, wherein the target sentence is associated with a target database; in a case where a reference syntax tree preset in the target database matches a structure of the sentence syntax tree and the sentence syntax tree contains a target index node, remove the index node for the sentence execution path, generate a first sentence execution path, and remove the target index node to generate a second sentence execution path; select a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to a path selection strategy; and execute the target sentence execution path to obtain query information and send the query information as feedback of the query request to the end side. According to a sixth aspect of the embodiments of the present disclosure, a computing device is provided, which includes a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions; the computer executable instructions, when executed by the processor, implement the steps of the above-mentioned sentence execution method. According to a seventh aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores computer executable instructions; the instructions, when executed by a processor, implement the steps of the above-mentioned sentence execution method.According to an eighth aspect of an embodiment of the present disclosure, a computer program product is provided, including computer programs or instructions, which, when executed by a processor, implement the steps of the above-mentioned statement execution method. In an embodiment of the present disclosure, when a target statement is executed, a statement syntax tree is constructed based on a statement execution path corresponding to the target statement, in a case where a reference syntax tree preset by a target database matches a structure of the statement syntax tree, and the statement syntax tree includes a target index node, an index node is pruned for the statement execution path, a first statement execution path is generated, and the target index node is pruned, a second statement execution path is generated, so that the first statement execution path not containing the index node is generated, and the second statement execution path not containing only the target index node is generated, evolution of the execution path of the statement execution path for the index node is implemented, and a statement execution path containing different index nodes is obtained. Furthermore, the target statement execution path with less resource consumption can be selected from the statement execution path, the first statement execution path and the second statement execution path according to the path selection strategy, so that the execution speed is improved, and the resource consumption is reduced. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a processing process schematic diagram of a statement execution method provided by an embodiment of the present disclosure; FIG. 2 is a flowchart of a statement execution method provided by an embodiment of the present disclosure; FIG. 3 is a matching schematic diagram of a statement execution method provided by an embodiment of the present disclosure; FIG. 4 is a processing process flowchart of a statement execution method provided by an embodiment of the present disclosure; FIG. 5 is a statement processing schematic diagram of a statement execution method provided by an embodiment of the present disclosure; FIG. 6 is a structural schematic diagram of a statement execution apparatus provided by an embodiment of the present disclosure; FIG. 7 is a flowchart of a query method provided by an embodiment of the present disclosure; FIG. 8 is a structural schematic diagram of a query apparatus provided by an embodiment of the present disclosure; FIG. 9 is a structural schematic diagram of a query system provided by an embodiment of the present disclosure; and FIG. 10 is a structural block diagram of a computing device provided by an embodiment of the present disclosure. Many specific details are set forth in the following description in order to provide a thorough understanding of the present disclosure. However, the present disclosure can be practiced in many ways other than those specifically described herein, and the present disclosure is not limited to the specific embodiments described herein. One skilled in the art can readily make similar substitutions and modifications without departing from the scope of the present disclosure, and therefore the present disclosure is not limited to the specific implementations disclosed below. The terms used in one or more embodiments of the present disclosure are merely for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present disclosure. The singular forms "a", "said" and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.It should also be understood that the term "and / or" as used herein refers to and encompasses any or all possible combinations of one or more associated terms. It should be understood that although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. These terms are merely used to distinguish one piece of information from another. For example, without departing from the scope of the one or more embodiments of the present disclosure, first can also be referred to as second, and similarly, second can also be referred to as first. Depending on the context, the word "if" as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination." In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the one or more embodiments of the present disclosure are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal. First, the nomenclature involved in the one or more embodiments of the present disclosure is explained.
[0002] SQL (Structured Query Language): A standard programming language used to manage and query relational databases. Global secondary index / GSI: Global secondary index is an important feature in PolarDB-X. Compared with local secondary index, data in global secondary index is distributed on each storage node according to the specified splitting method. Through global secondary index, users can increase the splitting dimension on demand, provide global unique constraint, etc.
[0003] PolarDB-X: A high-performance cloud-native distributed database product, supporting centralized and distributed integrated form, with financial-level data high availability, distributed horizontal expansion, mixed load, low-cost storage and elasticity, etc. Index selection: Refers to global index selection, using global index. When the query condition does not contain the partition key, the query data needs to scan all partitions on the partition table, which will bring obvious read amplification problem, and the more partitions, the more serious the read amplification. By selecting global index, the number of accessed partitions can be reduced.
[0004] Plan Cache: Execution plan cache. For each SQL, the optimizer will generate a corresponding execution plan.
[0005] SPM: execution plan management. Each SQL corresponds to a baseline, and each baseline contains one or more execution plans. The execution plan with the lowest cost is selected according to the current parameters to execute.
[0006] BKA join: a commonly used equi-join algorithm, the process is as follows: 1. Traverse the outer table (left table, usually the smaller data volume side) data, for each batch (for example, 1000 rows) of data in the outer table. 2. Join the keys of this batch of data into an IN(….) condition and add it to the inner table query. 3. Execute the inner table query to get the join matching rows. 4. Use a hash table to find the matching inner table rows for each row of the outer table, combine and output. Figure 1 is a schematic diagram of the processing process of a statement execution method provided by an embodiment of the present disclosure; as shown in Figure 1, the target statement is path planned to obtain a statement execution path. A statement syntax tree is constructed based on the statement execution path corresponding to the target statement. In the case that the structure of the reference syntax tree preset in the target database matches the statement syntax tree, and the statement syntax tree contains the target index node, the index node is removed for the statement execution path, a first statement execution path is generated, and the target index node is removed, a second statement execution path is generated, thereby generating the first statement execution path not containing the index node, and the second statement execution path only not containing the target index node, realizing the evolution of the execution path of the statement execution path for the index node, and obtaining the statement execution path containing different index nodes. Further, the resource consumption of each statement execution path can be selected in the statement execution path, the first statement execution path and the second statement execution path to execute the target statement execution path with less resource consumption, which can avoid the problem of table lookup query caused by executing the statement execution path in the case that the statement execution path contains the global secondary index node. Thus, the target statement execution path with less resource consumption can be selected from multiple statement execution paths, achieving the purpose of reducing resource consumption and improving execution efficiency. In the present disclosure, a statement execution method is provided, and the present disclosure also relates to a statement execution device, a query method, a query device, a query system, a computing device, and a computer readable storage medium, which are described in detail one by one in the following embodiments. Referring to Figure 2, Figure 2 shows a flowchart of a statement execution method provided by an embodiment of the present disclosure, specifically including the following steps. Step 202: Construct a statement syntax tree based on the statement execution path corresponding to the target statement, wherein the target statement is associated with a target database.Specifically, the target statement can be a SQL statement for querying, modifying, deleting, etc. of data in a database; the statement execution path is an execution path obtained after path planning of the target statement based on filtering operators, sorting operators, aggregation operators, projection operators, etc. corresponding to the target statement; the statement execution path can be at least one execution path obtained after constructing an execution plan for the target statement, and the execution order of the scan operators in each execution path is different. The syntax tree represents the execution order of the operators in the statement execution path, and a tree structure of the statement execution path is constructed according to the execution order corresponding to each operator. The target database is the operation object of the target statement, and the target statement is executed on the target database to realize querying, modifying, deleting, etc. of data in the target database. Based on this, as a SQL statement, the target statement can use global indexes, global secondary indexes, or not use indexes during execution, so the path planning can be performed on the target statement first, and then the statement syntax tree is constructed based on the statement execution path corresponding to the target statement, for subsequent structure matching with the reference syntax tree. The target statement is associated with the target database, and is used for querying, modifying, deleting, etc. of the target database. In actual application, the statement execution path corresponding to the target statement can be at least one. In the case that the statement execution path corresponding to the target statement is two or more, the statement syntax trees of the statement execution paths can be constructed respectively, and then each statement syntax tree is matched with the reference syntax tree respectively, to realize more comprehensive analysis of the statement execution path. In addition, during use of the target database, the execution plan cache can be started, and for each SQL statement, the optimizer will generate a corresponding execution plan. The start of the execution plan cache can make the user use the global index without feeling, and improve the query speed. The target database includes an execution plan cache containing a statement execution path set, and the statement execution path set includes one or more statement execution paths. Step 204: In the case that the reference syntax tree pre-set in the target database is matched with the structure of the statement syntax tree, and the statement syntax tree contains a target index node, the index node is removed for the statement execution path, a first statement execution path is generated, and the target index node is removed, a second statement execution path is generated.Specifically, in the above based on the target statement corresponding to the statement execution path to build a statement syntax tree, wherein, the target statement associated with the target database, after the target database pre-set reference syntax tree and the structure of the statement syntax tree matching, and the statement syntax tree contains the target index node, in the case of the statement execution path to remove the index node, the first statement execution path is generated, and the target index node is removed, and the second statement execution path is generated, wherein, the reference syntax tree is a syntax tree containing basic operators, the reference syntax tree can contain global secondary index scan operator, the scan operator of the main table and BKA join operator. The target index node is the index node corresponding to the global secondary index scan operator; the first statement execution path refers to the statement execution path without any index node; the second statement execution path is only the statement execution path without the target index node. Based on this, after the above based on the target statement corresponding to the statement execution path to build a statement syntax tree, it is judged whether the reference syntax tree pre-set by the target database matches the structure of the statement syntax tree, and whether the statement syntax tree contains the target index node. In the case of the reference syntax tree pre-set by the target database and the structure of the statement syntax tree matching, it is indicated that the tree structure of the statement syntax tree contains the tree structure of the reference syntax tree, and the statement syntax tree contains the target index node. The case indicates that the target index node contained in the statement syntax tree corresponds to the global secondary index, and the global secondary index leads to more back table rows in the process of executing the statement execution path corresponding to the target statement. Therefore, in the case of the reference syntax tree pre-set by the target database and the structure of the statement syntax tree matching, and the statement syntax tree contains the target index node, the index node is removed for the statement execution path, the first statement execution path is generated, and the target index node is removed, and the second statement execution path is generated. Further, the target index node can be a global secondary index. The existence of the global secondary index may cause the back table operation, so that the number of back table rows is more. Therefore, the pre-execution back table row number of the target statement can be calculated through the statement execution path, and whether the target index node is contained in the statement execution path is determined through the judgment of the pre-execution back table row number. The specific implementation is as follows: the target statement is pre-executed according to the statement execution path, and the target statement execution information is obtained; in the case that the pre-execution back table row number of the target statement is greater than the pre-set back table row number threshold based on the target statement execution information, the to-be-tested index node in the statement syntax tree is taken as the target index node.Specifically, the target statement execution information is execution information generated in a target statement execution process, and the target statement execution information includes but is not limited to scan row number information when a data table is scanned in a pre-execution of the target statement according to a statement execution path; the pre-execution back table row number refers to that the target statement is not actually executed, but the back table row number in the target statement execution process is estimated according to a scan operator included in the statement execution path; the preset back table row number threshold is a threshold preset for the back table row number, and is used for comparison with the pre-execution back table row number. Based on this, the target statement is pre-executed according to the statement execution path, the target statement execution information is obtained, the target statement is not actually executed, and only the back table row number in the target statement execution process is estimated. In a case where the target statement execution information is used to determine that the pre-execution back table row number of the target statement is greater than the preset back table row number threshold, it is indicated that the back table row number corresponding to the target statement is relatively large, and problems such as slow execution speed and excessive resource consumption may occur. The index node to be measured in the statement syntax tree is taken as a target index node. For example, in the pre-execution of the target statement according to the statement execution path, the back table row number is estimated according to the filter condition of the target statement, 2023T2-01 14: 10: 05, and (c text long = or id = 1). In a case where the back table row number obtained by estimation is greater than the preset back table row number threshold of ten thousand rows, it is determined that the global secondary index included in the statement execution path is the target index, and correspondingly, the global secondary index node included in the statement execution path is the target index node. In summary, by setting the preset back table row number threshold, it can be determined whether the global secondary index node causing the back table row number to be relatively large is included in the statement execution path, and then the problem of the back table row number being relatively large in the target statement execution process can be solved, so that the query efficiency is improved. Further, considering that the pre-execution back table row number is related to an execution condition (a filter condition) and a logical operation identifier included in the statement execution path, the pre-execution back table row number can be determined according to the execution condition and the logical operation identifier, and the specific implementation is as follows: at least one execution condition node included in the statement execution path is determined, and a logical operation identifier associated with the at least one execution condition node is determined; the target statement execution information of the target statement is determined based on a preset logical operation rule, the at least one execution condition node and the logical operation identifier, and the pre-execution back table row number is extracted in the target statement execution information.Specifically, the execution condition node is a filtering condition node, used for filtering the scanned data in the process of target statement execution, and the execution condition can be time, date, text length, character type, etc.; the logic operation identifier includes but is not limited to a selection calculation identifier, a judgment identifier, a numerical calculation identifier and a type derivation identifier. Based on this, at least one execution condition node contained in the statement execution path is determined, and the logic operation identifier associated with the at least one execution condition node. The preset logic operation rule corresponds to the selection calculation identifier, the judgment identifier, the numerical calculation identifier and the type derivation identifier. Based on the preset logic operation rule, the at least one execution condition node and the logic operation identifier determine the target statement execution information of the target statement, and extract the pre-execution back table row number in the target statement execution information. The logic operation rule corresponds to the upper bound estimation algorithm, used for determining the target index node based on the pre-execution back table row number. Wherein, the selection calculation identifier corresponds to selectivity (FREE) =1, selectivity (BOUND) =BOUND, selectivity (UNKNOWN) =0; the judgment identifier includes FREE, BOUND and UNKNOWN, and FREE represents that it can be infinitely large or infinitely small. The question mark represents a calculable constant, including: a<?; a<=?; a>?; a>=?; a<>?; a not in (?) a between? and?; a not between? and?; a is distinct from?; a like?. o BOUND represents upper bound, including: a =?; a in (?) a is not distinct from?a is null; a is not null o UNKNOWN represents unknown. The remaining ones that cannot be estimated are as follows: a=b, (a, b) in ((?,?)), cast (a as int) =?;select^from cest full table big where c_f loat pr <= 1+3 O The numerical calculation identifier corresponds to numerical calculation that can be realized by calling a function, for example, a calls getFrequencyUpperLimit;a in(?) calls getFrequencyUpperLimit * 200;a is not distinct from? getFrequencyUpperLimit; a is null call getNullCount; a is not null call 1-getNullCount o Type inference identifies include NOT, OR and AND where NOT includes NOT (UN NOT (FREE) =FREE; NOT (BOUND) =FREE O OR includes: for n decision identifies, OR(A1, A2,..., An), n=0, result is 1; if there is FREE, then OR(A1, A2,..., An) =FREE. If there are k BOUND (k>0), without loss of generality, let these BOUND be A1, A2,..., Ak, and Ak+1,..., An be UNKNOWN, then OR(A1, A2,..., An) = UNKNOWN. If there is only UNKNOWN, then OR(A1, A2,..., An) =UNKNOWN. AND includes: for n decision identifies, AND(A1, A2,..., An), n=0, result is 1; if there are k BOUND (k>0), without loss of generality, let these BOUND be A1, A2,..., Ak, and Ak+1,..., An be UNKNOWN, then AND(A1, A2,..., An) = UNKNOWN.
[0007] Yl BOUND?' To big sorting as Al, A2,..., Ak, AND(Al, A2,...,An)= 1. Special case: Al, A2.. There is a primary key or uk equivalent in the value, directly return 1 / rowcount; If k = 0, if there is no FREE, then AND (Al, A2,... An) = UNKNOWN, otherwise OR (Al, A2,... An) = FREE. For example, for the filter condition c_timestamp_3 = '2023-12-01 14:10:05' and (c_text_long = '1' or id = 1) on the table cest full table big with a row number of 10 million; UpperSelectivity (c_timestamp_3 = '2023-12-0114:10:05') = 207608.95 / rows=0.02; UpperSelectivity (c_text_long = 'T) = 750389.44 / rows=0.07; UpperSelectivity (id = 1) = 1 / rows = le-8; UpperSelectivity (c_text_long = '1' or id = 1) = max (0.07, le-8) = 0.07; UpperSelectivity (c_timestamp_3 = '2023-12-0114:10:05' and (c_text_long = or id = 1)) = 0.02^0.27 = 0.0054; So the final filter is selectivity (Free) = 0.0054, the pre-execution back table row number is 0.0054^rows=54000 oIn addition, for the filter condition on cest full table big (not (c_bigint_64 in (16) ) ) or c_bigint_64 = 1; UpperSelectivity (c_bigint_64 in (16) ) = 1005 * 2000 / rows = 201000 / rows = 0.02; UpperSelectivity (not (c_bigint_64 in (16) ) ) = FREE; UpperSelectivity (c_bigint_64 = 1) = 1005 / rows = le-4; UpperSelectivity (not (c_bigint_64 in (16) ) ) or c_bigint_64 = 1) = FREE; so the final filter selectivity is selectivity (Free) = 1, and the pre-execution back table row number is 1 * rows = 10000000 oIn summary, based on the preset logical operation rule, the target statement execution information of the target statement is determined by at least one execution condition node and a logical operation identifier, and the pre-execution back table row number is extracted in the target statement execution information, so as to facilitate the determination of the target index node. Further, considering that the arrangement mode of the tree node (execution node) in the statement syntax tree is relatively flexible, therefore, in the case that the statement syntax tree and the reference syntax tree structure are matched, the subsequent steps are continued to be executed, and the specific implementation is as follows: determining the statement tree structure of the statement syntax tree and the reference tree structure of the reference syntax tree preset by the target database; in the case that the statement tree structure contains the reference tree structure, determining that the reference syntax tree preset by the target database is matched with the structure of the statement syntax tree. Specifically, the statement tree structure is a tree structure representation of the statement execution path, which is constructed according to the execution nodes contained in the statement execution path and the relationship between the execution nodes. Based on this, the statement tree structure of the statement syntax tree and the reference tree structure of the reference syntax tree preset by the target database are determined. In the case that the statement tree structure contains the reference tree structure, the reference tree structure can be obtained by eliminating the tree nodes in the statement tree structure, and it is determined that the reference syntax tree preset by the target database is matched with the structure of the statement syntax tree. For example, as shown in FIG. 3, the reference syntax tree contains a BKA join algorithm node, a global secondary index node and a main table A node; in the case that the statement tree structure contains a sorting operator node, an aggregation operator node, a BKA join algorithm node, a global secondary index node and a main table A node, and is a tree structure as shown in “structure matching” in FIG. 3, the reference syntax tree can be obtained by eliminating the sorting operator node and the aggregation operator node, and then the two structures are matched. On the contrary, in the case that the reference syntax tree is a tree structure as shown in “structure mismatching” in FIG. 3, the reference syntax tree cannot be obtained by eliminating the tree nodes, and then the two structures are not matched. In summary, in the case that the statement tree structure contains the reference tree structure, it is determined that the reference syntax tree preset by the target database is matched with the structure of the statement syntax tree, so as to simplify the matching process of the tree structure. Further, considering that the existence of the index node may cause the execution speed of the statement execution path to be slow, therefore, the index node can be eliminated to generate a first statement execution path which does not contain the index node, and the specific implementation is as follows: determining the execution nodes contained in the statement execution path, and eliminating the index nodes in the execution nodes to obtain first target execution nodes; generating a first statement execution path based on the statement semantics of the target statement and the first target execution nodes.Specifically, the first target execution node is an execution node existing after an index node in the statement execution path; and the statement semantics of the target statement correspond to the meaning of the execution node in the statement execution path and the execution order of the execution node. Based on this, the execution nodes contained in the statement execution path are determined, and the index node is removed from the execution nodes to obtain the first target execution node. The first target execution node is supplemented based on the statement semantics of the target statement to obtain the first supplemented execution node. The first statement execution path is generated based on the first supplemented execution node and the first target execution node. For example, in the case where the statement execution path contains an index node corresponding to an index, the index node corresponding to the index is removed, and the path planning is performed again for the target statement to generate a statement execution path that does not contain the index node corresponding to the index. As described above, after the index node contained in the statement execution path is removed, the first statement execution path is generated, so that the first statement execution path that does not contain the index node can be generated, and the diversity of path generation is improved. Further, considering that the slow execution speed of the statement execution path is caused by the target index node, the target index node can be removed to generate a second statement execution path, and the specific implementation is as follows: the execution nodes contained in the statement execution path are determined, and the target index node is removed from the execution nodes to obtain a second target execution node; and the second statement execution path is generated based on the statement semantics of the target statement and the second target execution node. Specifically, the second target execution node is an execution node existing after the target index node in the statement execution path. Based on this, the execution nodes contained in the statement execution path are determined, and the target index node is removed from the execution nodes to obtain the second target execution node. The second target execution node is supplemented based on the statement semantics of the target statement to obtain a second supplemented execution node. The second statement execution path is generated based on the second supplemented execution node and the second target execution node. For example, in the case where the statement execution path contains a target index node corresponding to a global secondary index, the target index node corresponding to the global secondary index is removed, and the path planning is performed again for the target statement to generate a statement execution path that does not contain the target index node corresponding to the global secondary index. As described above, after the target index node contained in the statement execution path is removed, the second statement execution path is generated, so that the second statement execution path that does not contain the target index node can be generated, and the diversity of path generation is improved. Step 206: The target statement execution path is selected from the statement execution path, the first statement execution path, and the second statement execution path according to the path selection strategy, and is executed.Specifically, in the case that the reference syntax tree preset in the target database matches the structure of the statement syntax tree, and the statement syntax tree contains the target index node, after the index node is removed from the statement execution path, the first statement execution path is generated, and the target index node is removed, the second statement execution path is generated, the target statement execution path can be selected from the statement execution path, the first statement execution path and the second statement execution path according to the path selection strategy, and executed, wherein the path selection strategy provides the selection basis for selecting the target statement execution path, and the selection basis can be the amount of resources consumed in the execution process of the statement execution path, including but not limited to time, computing resources, storage resources, etc. Based on this, in the case that the reference syntax tree preset in the target database matches the structure of the statement syntax tree, and the statement syntax tree contains the target index node, after the index node is removed from the statement execution path, the first statement execution path is generated, and the target index node is removed, the second statement execution path is generated, the statement execution path with less resource consumption is selected as the target statement execution path from the statement execution path, the first statement execution path and the second statement execution path according to the path selection strategy, and executed. In actual application, after the target statement execution path is executed, a mark can be added to the target statement execution path according to the number of rows scanned in the execution process. Thus, the reuse of the target statement execution path is facilitated. Further, considering that different statement execution paths contain different execution nodes, the corresponding execution logic is also different. Therefore, the resource consumption of the statement execution path is also different in the execution process. In the selection process of the target statement execution path, the resource consumption information of each statement execution path can be used as the selection basis, and the specific implementation is as follows: the resource consumption information corresponding to the statement execution path, the first statement execution path and the second statement execution path is calculated; the target statement execution path is selected from the statement execution path, the first statement execution path and the second statement execution path according to the resource consumption information of each statement execution path, and executed. Specifically, the resource consumption information refers to the amount of resources needed to be consumed in the execution process of each statement execution path, including but not limited to time resources, computing resources and storage resources, etc. Based on this, the resource consumption information corresponding to the statement execution path, the first statement execution path and the second statement execution path is calculated. According to the resource consumption amount of the resource consumption information of each statement execution path, the statement execution path with less resource consumption is selected as the target statement execution path from the statement execution path, the first statement execution path and the second statement execution path, and executed.For example, the global secondary index node is included in the statement execution path, the index node is not included in the first statement execution path, and the global secondary index node is not included in the second statement execution path, and other index nodes can be included. The resource consumption of each statement execution path in the execution process is calculated respectively. The statement execution path with less resource consumption is selected as the target statement execution path. In summary, according to the resource consumption information, the statement execution path with less resource consumption is selected as the target statement execution path in the first statement execution path and the second statement execution path, so that less resources can be consumed when the target statement execution path is executed, and resource waste is avoided. Further, considering that when the pre-execution back table row number is determined, it is a pre-estimation of the back table row number, and there may be differences between the actual execution process and the back table row number, therefore, after the target statement execution path is executed, the actual scanning row number can be calculated to further judge whether the target statement execution path can be reused subsequently, and the specific implementation is as follows: Obtain the execution information corresponding to the target statement execution path, and determine the scanning row number according to the execution information. If the scanning row number is greater than a preset row number threshold, update the statement selection state of the target statement execution path. Specifically, the execution information includes but is not limited to the data table scanning information and resource consumption information generated in the execution process of the target statement execution path. The scanning row number is the number of rows of the scanned data table; the preset row number threshold can be a pre-set row number. The statement selection state can be an unusable state, that is, an unselectable state, or a usable state, that is, a selectable state. Based on this, the execution information corresponding to the target statement execution path is obtained, and the scanning row number is determined according to the execution information. If the scanning row number is greater than the preset row number threshold, it indicates that the number of rows of the data table scanned in the execution process of the target statement execution path is large, which causes the problems of slow execution speed and large resource consumption. The statement selection state of the target statement execution path can be updated to the unusable state, indicating that the target statement execution path will not be reused subsequently. In summary, the statement selection state of the target statement execution path is updated based on the preset row number threshold, so that the scanning row number is calculated again after the target statement execution path is executed, and it is further determined whether the target statement execution path can be used subsequently, and the target statement execution path with large resource consumption is disabled in time.Further, considering that the statement execution path, the first statement execution path and the second statement execution path and the like are generated for the target statement, the plurality of statement execution paths are stored through the path set, and the statement execution paths are managed, the specific implementation is as follows: the first statement execution path and the statement execution path are stored to the path set; the target index node is eliminated, the second statement execution path is generated, and in the case that the reference syntax tree preset in the target database matches the second statement syntax tree structure of the second statement execution path, the second statement execution path is stored to the path set; and the third statement execution path is selected in the path set according to the path selection strategy and executed. Based on this, after the first statement execution path is generated, the first statement execution path and the statement execution path are stored to the path set. If the number of statement execution paths contained in the path set reaches the path quantity threshold, storage cannot be performed any more. The target index node is eliminated, the second statement execution path is generated, and in the case that the reference syntax tree preset in the target database matches the second statement syntax tree structure of the second statement execution path, the second statement execution path is stored to the path set. Similarly, if the number of statement execution paths contained in the path set reaches the path quantity threshold, storage cannot be performed any more. After the second statement execution path is stored to the path set, it is determined whether the target index node is contained in the second statement execution path. If yes, the target index node is eliminated again, and the second statement execution path is generated. The third statement execution path is selected in the path set according to the path selection strategy and executed. Taking an example, the first statement execution path not containing the index node is generated for the target statement, and the first statement execution path is stored to the SPM. The second statement execution path not containing the index node corresponding to the global secondary index is generated for the target statement. The second statement execution path is stored to the SPM. If the storage is successful, it is determined whether the index node corresponding to the target global secondary index is contained in the second statement execution path. If yes, the second statement execution path not containing the index node corresponding to the global secondary index is generated for the target statement, and is stored to the SPM. As described above, the statement execution path, the first statement execution path and the second statement execution path are stored to the path set. Further, the statement execution paths can be stored and managed based on the path set. This is convenient for the selection of the target statement execution path subsequently.In an embodiment of the present disclosure, when a target statement is executed, a statement syntax tree is constructed based on a statement execution path corresponding to the target statement; in a case where a reference syntax tree preset by a target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, an index node is pruned from the statement execution path to generate a first statement execution path, and the target index node is pruned to generate a second statement execution path, so that the first statement execution path containing no index node and the second statement execution path containing only the target index node are generated, evolution of the statement execution path is implemented for the index node, and a statement execution path containing different index nodes is obtained. Furthermore, a target statement execution path with less resource consumption can be selected from the statement execution path, the first statement execution path and the second statement execution path according to a path selection strategy, so that the execution speed is improved and the resource consumption is reduced. The statement execution method provided in the present disclosure is further described below by taking an application of the statement execution method in data query as an example. In the application, FIG. 4 shows a processing process flowchart of a statement execution method provided in an embodiment of the present disclosure, and specifically includes the following steps. Step 402: An execution plan of a target statement is constructed to obtain a statement execution path of the target statement. In a data query scenario, a global secondary index needs to be queried back, and if the amount of data queried back is large, the query speed will be slow. The database estimates the amount of data queried back using the global secondary index by cardinality estimation, and does not use the index when the amount of data is large. Plan Cache is enabled by default in PolarDB-X, and there is a frequently-occurring problem online: for the same SQL and two groups of parameters A and B, A uses the global index quickly but B uses the global index slowly. If the user first queries using parameter A, a Plan Cache using the global index is generated, and then parameter B is used for query, the Plan using the global index cached is directly reused, resulting in slow speed and requiring manual intervention. The embodiment follows the framework of SPM, optimizes the capture evolution mechanism therein, and increases feedback capability. In actual application, after a target statement to be executed is determined, an execution plan is constructed for the target statement to obtain a statement execution path. Step 404: A statement syntax tree of the statement execution path is constructed. Step 406: The statement syntax tree and a template syntax tree are matched, and in a case where the statement syntax tree matches the structure of the template syntax tree and the statement execution path contains a target index, an index evolution task corresponding to the statement execution path is added to a task queue. Whether the statement execution path contains the target index can be determined by an upper bound estimation algorithm.As shown in FIG. 5, the capturing of the global secondary index for the target statement is performed, where the target index is the global secondary index. It is determined whether the statement syntax tree matches the template (template syntax tree). If yes, it is further determined whether the statement execution path contains the target index. If yes, the evolution task is generated for the target index. If the statement syntax tree does not match the template syntax tree, the capturing operation is ended. Correspondingly, if the statement execution path does not contain the target index, the capturing operation is ended. In step 408, the index evolution task to be executed in the task queue is determined and executed, the index selection is closed, and the first statement execution path corresponding to the target statement is generated. In step 410, the statement execution path and the first statement execution path are stored in the execution plan set. In step 412, the target index is ignored, the second statement execution path corresponding to the target statement is generated, and the second statement execution path is stored in the execution plan set. In step 414, it is determined whether the second statement execution path contains the target index. If yes, step 412 is executed. If no, step 416 is executed. In the evolution task execution process, the index selection is closed, and the first statement execution path corresponding to the target statement is generated. It is determined whether the first statement execution path is successfully added to the plan set. If not, the evolution task is ended. If yes, the second execution plan is generated by ignoring the target index. It is determined whether the second execution plan matches the template (template syntax tree). If yes, it is determined whether the second execution plan is successfully added to the plan set. If not, the evolution task is ended. If yes, it is determined whether the second execution plan contains the target index. If yes, the step of generating the second execution plan by ignoring the target index is executed. If no, the evolution task is ended. If the second execution plan does not match the template (template syntax tree), the evolution task is ended. In step 416, the target statement execution path with smaller execution cost is selected from the execution plan set and executed. In step 418, the scan row number corresponding to the target statement execution path is determined. If the scan function is greater than the scan row number threshold, the target statement execution path is added with a disable identifier. After the evolution task is executed, the target plan with smaller execution cost is selected and executed, and it is determined whether the scan row number of the target plan exceeds the scan row number threshold. If yes, the target plan is disabled. If no, the feedback process is ended. In the evolution process, active evolution is performed, the hotspot global secondary index discovered by the upper bound estimation algorithm is continuously disabled, the new execution plan is generated, and the execution plan no longer uses the hotspot global secondary index. By detecting the scan row number, the index selection is actively closed when the scan row number exceeds the threshold, so as to reduce the error rate.In summary, in one embodiment of the present disclosure, when a target statement is executed, a statement syntax tree is constructed based on a statement execution path corresponding to the target statement. In a case where a reference syntax tree preset by a target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, the index node is removed from the statement execution path to generate a first statement execution path, and the target index node is removed to generate a second statement execution path. Thus, the first statement execution path containing no index node and the second statement execution path containing only the target index node are generated, the evolution of the statement execution path with respect to the index node is implemented, and a statement execution path containing different index nodes is obtained. Then, a target statement execution path with less resource consumption can be selected from the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy, so that the execution speed is improved and the resource consumption is reduced. Corresponding to the above method embodiment, the present disclosure further provides a statement execution device embodiment. FIG. 6 shows a structural schematic diagram of a statement execution device according to one embodiment of the present disclosure. As shown in FIG. 6, the device includes: a construction module 602 configured to construct a statement syntax tree based on a statement execution path corresponding to a target statement, wherein the target statement is associated with a target database; a generation module 604 configured to, in a case where a reference syntax tree preset by the target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, remove an index node from the statement execution path to generate a first statement execution path, and remove the target index node to generate a second statement execution path; and a selection module 606 configured to select a target statement execution path from the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy and execute the target statement execution path. In one optional embodiment, the generation module 604 is further configured to: execute the target statement according to the statement execution path to obtain target statement execution information; and in a case where it is determined based on the target statement execution information that a pre-execution table row number of the target statement is greater than a preset table row number threshold, determine a to-be-tested index node in the statement syntax tree as the target index node. In one optional embodiment, the generation module 604 is further configured to: determine at least one execution condition node contained in the statement execution path and a logical operation identifier associated with the at least one execution condition node; and determine target statement execution information of the target statement based on a preset logical operation rule, the at least one execution condition node, and the logical operation identifier, and extract the pre-execution table row number from the target statement execution information.An optionally implemented embodiment, the generation module 604 is further configured to: determine a sentence tree structure of the sentence syntax tree, and a reference tree structure of the reference syntax tree preset by the target database; in a case where the sentence tree structure contains the reference tree structure, determine that the reference syntax tree preset by the target database matches the structure of the sentence syntax tree. An optionally implemented embodiment, the generation module 604 is further configured to: determine an execution node contained in the sentence execution path, and eliminate an index node in the execution node to obtain a first target execution node; generate a first sentence execution path based on the sentence semantics of the target sentence and the first target execution node. An optionally implemented embodiment, the generation module 604 is further configured to: determine an execution node contained in the sentence execution path, and eliminate a target index node in the execution node to obtain a second target execution node; generate a second sentence execution path based on the sentence semantics of the target sentence and the second target execution node. An optionally implemented embodiment, the selection module 606 is further configured to: calculate resource consumption information corresponding to the sentence execution path, the first sentence execution path and the second sentence execution path respectively; and select a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to the resource consumption information of each sentence execution path and execute the target sentence execution path. An optionally implemented embodiment, the selection module 606 is further configured to: obtain execution information corresponding to the target sentence execution path, and determine a scan row number according to the execution information; and in a case where the scan row number is greater than a preset row number threshold, update a sentence selection state of the target sentence execution path. An optionally implemented embodiment, the selection module 606 is further configured to: store the first sentence execution path and the sentence execution path to a path set; eliminate the target index node, generate a second sentence execution path, and in a case where the reference syntax tree preset by the target database matches a second sentence syntax tree structure of the second sentence execution path, store the second sentence execution path to the path set; and select a third sentence execution path from the path set according to a path selection strategy and execute the third sentence execution path.In summary, in one embodiment of the present disclosure, when a target statement is executed, a statement syntax tree is constructed based on a statement execution path corresponding to the target statement. In the case that a reference syntax tree preset by a target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, the index node is removed from the statement execution path to generate a first statement execution path, and the target index node is removed to generate a second statement execution path. Thus, the first statement execution path containing no index node and the second statement execution path containing only the target index node are generated, the evolution of the statement execution path with respect to the index node is implemented, and the statement execution path containing different index nodes is obtained. Then, the target statement execution path with less resource consumption can be selected from the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy, so that the execution speed is improved and the resource consumption is reduced. The above is a schematic scheme of a statement execution device in the embodiment. It should be noted that the technical scheme of the statement execution device belongs to the same concept as the technical scheme of the statement execution method described above, and the details of the technical scheme of the statement execution device that are not described in detail can be referred to the description of the technical scheme of the statement execution method. Referring to FIG. 7, FIG. 7 shows a flowchart of a query method according to one embodiment of the present disclosure. The query method is applied to a cloud side and specifically includes the following steps. In step 702, a query request submitted by an end side is received, and a target statement is determined based on the query request. In step 704, a statement syntax tree is constructed based on a statement execution path corresponding to the target statement, where the target statement is associated with a target database. In step 706, in the case that a reference syntax tree preset by the target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, an index node is removed from the statement execution path to generate a first statement execution path, and the target index node is removed to generate a second statement execution path. In step 708, a target statement execution path is selected from the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy. In step 710, query information is obtained by executing the target statement execution path, and the query information is sent to the end side as feedback of the query request.In actual application, the cloud side can receive the query request submitted by the terminal side, and determine a target statement according to the query request. When the target statement is executed, a statement syntax tree is constructed based on the statement execution path corresponding to the target statement. In the case that the structure of the reference syntax tree preset in the target database matches the structure of the statement syntax tree, and the statement syntax tree contains a target index node, the index node is removed for the statement execution path, a first statement execution path is generated, and the target index node is removed, a second statement execution path is generated, so that the first statement execution path not containing the index node and the second statement execution path not containing only the target index node are generated, the evolution of the execution path of the statement execution path for the index node is implemented, and the statement execution path containing different index nodes is obtained. Then, the target statement execution path with less resource consumption can be selected from the statement execution path, the first statement execution path and the second statement execution path according to the path selection strategy, the query information obtained by executing the target statement execution path is sent to the terminal side. The execution speed can be improved, and the resource consumption can be reduced. Corresponding to the above method embodiment, the present disclosure also provides a query device embodiment. FIG. 8 shows a structure diagram of a query device provided by one embodiment of the present disclosure. As shown in FIG. 8, the query device is applied to the cloud side, and the device comprises: a receiving module 802 configured to receive a query request submitted by a terminal side, and determine a target statement based on the query request; a constructing module 804 configured to construct a statement syntax tree based on a statement execution path corresponding to the target statement, wherein the target statement is associated with a target database; a generating module 806 configured to remove an index node for the statement execution path in the case that the structure of a reference syntax tree preset in the target database matches the structure of the statement syntax tree, and the statement syntax tree contains a target index node, generate a first statement execution path, and generate a second statement execution path by removing the target index node; a selecting module 808 configured to select a target statement execution path in the statement execution path, the first statement execution path and the second statement execution path according to a path selection strategy; and a sending module 810 configured to obtain query information by executing the target statement execution path, and send the query information as feedback of the query request to the terminal side. In one optional embodiment, the generating module 806 is further configured to: execute the target statement according to the statement execution path to obtain target statement execution information; and in the case that it is determined based on the target statement execution information that the pre-execution table row number of the target statement is greater than a preset table row number threshold, take the index node to be tested in the statement syntax tree as the target index node.An optionally implemented embodiment, the generation module 806 is further configured to: determine at least one execution condition node included in the statement execution path and a logical operation identifier associated with the at least one execution condition node; determine target statement execution information of the target statement based on a preset logical operation rule, the at least one execution condition node and the logical operation identifier, and extract the pre-execution back table row number in the target statement execution information. An optionally implemented embodiment, the generation module 806 is further configured to: determine a statement tree structure of the statement syntax tree and a reference tree structure of a reference syntax tree preset by the target database; in a case where the statement tree structure contains the reference tree structure, determine that the reference syntax tree preset by the target database matches the structure of the statement syntax tree. An optionally implemented embodiment, the generation module 806 is further configured to: determine an execution node included in the statement execution path, and eliminate an index node in the execution node to obtain a first target execution node; generate a first statement execution path based on the statement semantics of the target statement and the first target execution node. An optionally implemented embodiment, the generation module 806 is further configured to: determine an execution node included in the statement execution path, and eliminate a target index node in the execution node to obtain a second target execution node; generate a second statement execution path based on the statement semantics of the target statement and the second target execution node. An optionally implemented embodiment, the selection module 808 is further configured to: calculate resource consumption information corresponding to the statement execution path, the first statement execution path and the second statement execution path respectively; and select a target statement execution path from the statement execution path, the first statement execution path and the second statement execution path according to the resource consumption information of each statement execution path and execute the target statement execution path. An optionally implemented embodiment, the selection module 808 is further configured to: obtain execution information corresponding to the target statement execution path, and determine a scan row number according to the execution information; and update a statement selection state of the target statement execution path in a case where the scan row number is greater than a preset row number threshold.In an optional embodiment, the selection module 808 is further configured to: store the first statement execution path and the statement execution path to a path set; eliminate the target index node, generate a second statement execution path, and store the second statement execution path to the path set in a case where the reference syntax tree preset in the target database matches the second statement syntax tree structure of the second statement execution path; and select a third statement execution path according to a path selection strategy and perform the third statement execution path in the path set. In summary, the cloud side can receive the query request submitted by the terminal side, determine the target statement according to the query request, construct a statement syntax tree based on the statement execution path corresponding to the target statement when the target statement is executed, eliminate the index node for the statement execution path in a case where the reference syntax tree preset in the target database matches the structure of the statement syntax tree, and the statement syntax tree contains the target index node, generate a first statement execution path by eliminating the index node, and generate a second statement execution path by eliminating the target index node, so as to generate the first statement execution path that does not contain the index node and the second statement execution path that does not contain only the target index node, implement the evolution of the execution path of the statement execution path for the index node, and obtain the statement execution path containing different index nodes. Then, the target statement execution path with less resource consumption can be selected according to the path selection strategy in the statement execution path, the first statement execution path, and the second statement execution path, the target statement execution path is executed, and the query information obtained by executing the target statement execution path is sent to the terminal side. The execution speed can be improved, and the resource consumption can be reduced. The above is a schematic scheme of a query device according to an embodiment of the present disclosure. It should be noted that the technical scheme of the query device belongs to the same concept as the technical scheme of the query method, and the details of the technical scheme of the query device that are not described in detail can be referred to the description of the technical scheme of the query method. FIG. 9 shows a structural schematic diagram of a query system according to an embodiment of the present disclosure.As shown in FIG. 9, the query system 900 includes a cloud side 910 and an end side 920; the end side 920 is configured to submit a query request to the cloud side 910; the cloud side 910 is configured to determine a target statement based on the query request; construct a statement syntax tree based on a statement execution path corresponding to the target statement, wherein the target statement is associated with a target database; in a case where a reference syntax tree preset in the target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, remove the index node for the statement execution path to generate a first statement execution path, and remove the target index node to generate a second statement execution path; select a target statement execution path from the statement execution path, the first statement execution path and the second statement execution path according to a path selection strategy; execute the target statement execution path to obtain query information, and send the query information as feedback of the query request to the end side 920. In an actual application, the end side submits a query request to the cloud side, the cloud side determines a target statement based on the query request, constructs a statement syntax tree based on a statement execution path corresponding to the target statement when executing the target statement, removes an index node for the statement execution path to generate a first statement execution path, and removes the target index node to generate a second statement execution path in a case where a reference syntax tree preset in the target database matches a structure of the statement syntax tree, and the statement syntax tree contains the target index node, so as to generate the first statement execution path not containing the index node, and the second statement execution path not containing only the target index node, implement evolution of the statement execution path for the index node, and obtain statement execution paths containing different index nodes. Then, the target statement execution path with less resource consumption can be selected from the statement execution path, the first statement execution path and the second statement execution path according to the path selection strategy, the query information obtained by executing the target statement execution path is sent to the end side, the execution speed is improved, and the resource consumption is reduced. The above is a schematic scheme of a query system according to an embodiment of the present disclosure. It should be noted that the technical scheme of the query system and the technical scheme of the query method described above belong to the same concept, and the details of the technical scheme of the query system not described in detail can be referred to the description of the technical scheme of the query method. FIG. 10 shows a structural block diagram of a computing device 1000 according to an embodiment of the present disclosure. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected with the memory 1010 through a bus 1030. A database 1050 is configured to save data.The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate with one or more networks 1060. Examples of networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of networks such as the Internet. The access device 1040 can include one or more of any type of network adapter (e.g., a network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless adapter, a Worldwide Interoperability for Microwave Access (WiMAX) adapter, an Ethernet adapter, a Universal Serial Bus (USB) adapter, a Bluetooth adapter, a near-field communication (NFC) adapter, a cellular network adapter, or the like. In one embodiment of the disclosure, the aforementioned components of the computing device 1000, and other components not shown in FIG. 10, can also be connected to one another through a bus. As will be appreciated by one skilled in the art, the computing device structure diagram of FIG. 10 is merely an example, and is not intended to limit the scope of the disclosure to any particular hardware configuration. Other components can be added or substituted in place of those shown in FIG. 10, as needed. The computing device 1000 can be any type of static or mobile computing device including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile telephone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a static computing device such as a desktop computer or personal computer (PC). The computing device 1000 can also be a mobile or static server. The processor 1020 is configured to execute computer-executable instructions stored in the memory 1010, which can include one or more types of computer-readable storage media. The processor 1020 can include one or more processors, such as a multi-core processor, a single core processor, or other processor.The foregoing is a schematic scheme of the computing device according to an embodiment of the present disclosure. It should be noted that the technical scheme of the computing device and the technical scheme of the method belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the method. An embodiment of the present disclosure further provides a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the steps of the method. The foregoing is a schematic scheme of the computer-readable storage medium according to an embodiment of the present disclosure. It should be noted that the technical scheme of the storage medium and the technical scheme of the method belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the method. An embodiment of the present disclosure further provides a computer program product including a computer program or instructions, and the computer program or instructions are executed by a processor to implement the steps of the method. The foregoing is a schematic scheme of the computer program product according to an embodiment of the present disclosure. It should be noted that the technical scheme of the computer program product and the technical scheme of the method belong to the same concept, and the details of the technical scheme of the computer program product that are not described in detail can be referred to the description of the technical scheme of the method. The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve desirable results. In certain implementations, multitasking and parallel processing can be advantageous. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the computer readable medium can be appropriately added or reduced according to the requirements of patent practice, for example, in some regions, according to the patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.It should be noted that, for the foregoing method embodiments, for the convenience of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present disclosure are not limited to the action sequence described, because according to the embodiments of the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of the present disclosure. In the above embodiments, the description of each embodiment is focused on, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments. The preferred embodiments of the present disclosure disclosed above are only used to help explain the present disclosure. The optional embodiments do not describe all the details and limit the invention to the specific embodiments described. Obviously, according to the content of the embodiments of the present disclosure, many modifications and changes can be made. The present disclosure selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present disclosure, so that those skilled in the art can well understand and utilize the present disclosure. The present disclosure is limited only by the claims and their full scope and equivalents.
Claims
CLAIM 1. A method of statement execution, comprising: constructing a sentence syntax tree based on a sentence execution path corresponding to a target sentence, wherein the target sentence is associated with a target database; in a case where a preset reference syntax tree of the target database matches a structure of the sentence syntax tree, and the sentence syntax tree contains a target index node, removing the index node for the sentence execution path to generate a first sentence execution path, and removing the target index node to generate a second sentence execution path; selecting a target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to a path selection strategy and executing the target sentence execution path.
2. The statement execution method of claim 1, wherein the determination of the target inode in the statement syntax tree comprises: executing the target sentence according to the sentence execution path to obtain target sentence execution information; in a case where it is determined based on the target sentence execution information that a pre-execution return table row number of the target sentence is greater than a preset return table row number threshold, taking a to-be-tested index node in the sentence syntax tree as the target index node.
3. The statement execution method of claim 2, wherein the determining of the number of back table rows for pre-execution of the target statement comprises: determining at least one execution condition node contained in the sentence execution path, and a logical operation identifier associated with the at least one execution condition node; determining target sentence execution information of the target sentence based on a preset logical operation rule, the at least one execution condition node and the logical operation identifier, and extracting the pre-execution return table row number from the target sentence execution information.
4. The method of claim 1-3, wherein the reference syntax tree preconfigured by the target database matches the structure of the syntax tree of the statement, and the method comprises: determining a sentence tree structure of the sentence syntax tree, and a reference tree structure of a preset reference syntax tree of the target database; in a case where the sentence tree structure contains the reference tree structure, determining that the preset reference syntax tree of the target database matches a structure of the sentence syntax tree.
5. The method of any one of claims 1-4, wherein the eliminating the index node from the statement execution path, and generating the first statement execution path comprises: determining an execution node contained in the sentence execution path, and removing an index node from the execution node to obtain a first target execution node; generating a first sentence execution path based on a sentence semantics of the target sentence and the first target execution node.
6. The statement execution method according to any one of claims 1-5, wherein the eliminating the target inode with respect to the statement execution path, generating a second statement execution path comprises: determining an execution node contained in the sentence execution path, and removing a target index node from the execution node to obtain a second target execution node; generating a second sentence execution path based on a sentence semantics of the target sentence and the second target execution node.
7. The sentence execution method according to any one of claims 1-6, wherein the selecting the target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to the path selection strategy and executing the target sentence execution path comprises: selecting a target statement execution path from among the first statement execution path and the second statement execution path and executing, including: calculating resource consumption information corresponding to the sentence execution path, the first sentence execution path and the second sentence execution path respectively; selecting the target sentence execution path from the sentence execution path, the first sentence execution path and the second sentence execution path according to the resource consumption information of each sentence execution path and executing the target sentence execution path.
8. The method according to any one of claims 1 to 7, wherein, after the target statement execution path is selected from among the statement execution paths, the first statement execution path, and the second statement execution path in accordance with the path selection policy and execution is performed, the method further comprises: obtaining execution information corresponding to the target sentence execution path, and determining a scan row number based on the execution information; in a case where the scan row number is greater than a preset row number threshold, updating a sentence selection state of the target sentence execution path.
9. The method of claim 1-8, wherein the method of generating a first statement execution path further comprises: store the first statement execution path and the statement execution path to a path set; discard the target index node, generate a second statement execution path, and store the second statement execution path to the path set in a case where a second statement syntax tree structure of the second statement execution path matches a reference syntax tree preset by the target database; select a third statement execution path in the path set according to a path selection strategy and execute the third statement execution path.
10. A query method, applied to a cloud side, comprising: receive a query request submitted by a terminal side, and determine a target statement based on the query request; construct a statement syntax tree based on a statement execution path corresponding to the target statement, wherein the target statement is associated with a target database; in a case where a reference syntax tree preset by the target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, discard the index node for the statement execution path, generate a first statement execution path, and discard the target index node to generate a second statement execution path; select a target statement execution path in the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy; execute the target statement execution path to obtain query information, and send the query information as a feedback of the query request to the terminal side.
11. A statement execution apparatus comprising: a construction module configured to construct a statement syntax tree based on a statement execution path corresponding to a target statement, wherein the target statement is associated with a target database; a generation module configured to, in a case where a reference syntax tree preset by the target database matches a structure of the statement syntax tree, and the statement syntax tree contains a target index node, discard the index node for the statement execution path, generate a first statement execution path, and discard the target index node to generate a second statement execution path; and a selection module configured to select a target statement execution path in the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy and execute the target statement execution path.
12. A query system, comprising a cloud side and an end side; the end side is configured to submit a query request to the cloud side. The cloud side is configured to determine a target statement based on the query request, construct a statement syntax tree based on a statement execution path corresponding to the target statement, wherein the target statement is associated with a target database; in a case where a preset reference syntax tree of the target database matches a structure of the statement syntax tree and the statement syntax tree contains a target index node, remove the index node for the statement execution path to generate a first statement execution path, and remove the target index node to generate a second statement execution path; select a target statement execution path from the statement execution path, the first statement execution path, and the second statement execution path according to a path selection strategy; execute the target statement execution path to obtain query information, and send the query information as feedback of the query request to the terminal side.
13. A computing device comprising: A memory and a processor; The memory is configured to store a computer program or instructions, and the processor is configured to execute the computer program or instructions, so as to implement the steps of the method in any one of claims 1 to 10.
14. A computer readable storage medium, which stores a computer program or instructions, and the computer program or instructions, when executed by a processor, implement the steps of the method in any one of claims 1 to 10.
15. A computer program product, which comprises a computer program or instructions, and the computer program or instructions, when executed by a processor, implement the steps of the method in any one of claims 1 to 10.
Citation Information
Patent Citations
Query statement optimization method and device
CN112559554A
Query optimization method and device for relational data
CN115617842A
Processing method for slow query statement and related equipment
CN116010479A