Database operation statement processing method and related product

By replacing the aggregation function in the exists or not exists subconnection in the database operation statement, the problems of redundant table scanning and aggregation operations in the prior art are solved, and the efficiency of database operations is improved.

CN119441276APending Publication Date: 2025-02-14CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411597026.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When existing database technology processes aggregation functions in exists subconnections, it will lead to unnecessary table scanning and aggregation operations, increasing database resource consumption.

Method used

By obtaining the database operation statement, determine whether the target keywords are included, such as exists or not exists. If included, obtain the target subconnection and determine whether the target column contains aggregation function. If included, replace it with the corresponding response result according to the target keyword type to reduce unnecessary aggregation operations and table scanning.

Benefits of technology

By replacing sub-connections that meet the conditions, unnecessary aggregation operations and table scanning are reduced, and the processing efficiency of database operation statements is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441276A_ABST
    Figure CN119441276A_ABST
Patent Text Reader

Abstract

The invention provides a database operation statement processing method and a related product. The method comprises the following steps: acquiring a database operation statement; judging whether the database operation statement contains a target keyword or not; under the condition that the database operation statement contains the target keyword, obtaining a target sub-connection corresponding to the target keyword; judging whether a target column of the target sub-connection contains an aggregation function or not; and if yes, replacing the target keyword and the target sub-connection corresponding to the target keyword with a corresponding response result according to the type of the target keyword. Through the method, unnecessary aggregation operation and table scanning can be reduced by replacing the target sub-connection with the corresponding response result, and the query efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a method for processing database operation statements and related products. Background Art

[0002] In the current common database technology, aggregate functions in exists sub-joins are generally not optimized, but for exists sub-joins containing aggregate functions in certain specific cases, the processing results are fixed. If the current common database technology is used, the exists sub-joins containing aggregate functions will cause redundant table scans and aggregate operations, thereby increasing unnecessary database resource consumption. Summary of the invention

[0003] In view of the above problems, the present invention proposes a method for processing database operation statements and related products that overcome the above problems or at least partially solve the above problems.

[0004] An object of the present invention is to optimize database operation statements that meet the conditions.

[0005] A further object of the present invention is to improve the processing efficiency of database operation statements by replacing sub-connections that meet the conditions.

[0006] In particular, the present invention provides a method for processing a database operation statement, comprising:

[0007] Get database operation statements;

[0008] Determine whether the database operation statement contains the target keyword;

[0009] When the database operation statement contains the target keyword, obtain the target sub-connection corresponding to the target keyword;

[0010] Determine whether the target column of the target sub-join contains an aggregate function;

[0011] If so, the target keyword and its corresponding target sub-link are replaced with the corresponding response result according to the type of the target keyword.

[0012] Optionally, the step of determining whether the database operation statement contains the target keyword includes:

[0013] Parse the database operation statement to obtain the query structure of the database operation statement;

[0014] Traverse the query structure to determine whether the target keyword exists in the query structure.

[0015] Optionally, the target keywords include exists and not exists.

[0016] Optionally, the response result includes true and false.

[0017] Optionally, the step of replacing the target keyword and its corresponding target sub-link with a corresponding response result according to the type of the target keyword includes:

[0018] When the target keyword is exists, replace the target keyword and its corresponding target sub-link with true.

[0019] Optionally, the step of replacing the target keyword and its corresponding target sub-link with a corresponding response result according to the type of the target keyword further includes:

[0020] When the target keyword is not exists, the target keyword and its corresponding target sub-link are replaced with false.

[0021] Optionally, after the step of replacing the target keyword and its corresponding target sub-link with a corresponding response result according to the type of the target keyword, the method further includes:

[0022] Determine whether there are other sub-connections in the database operation statement;

[0023] If not, reassign the flag bit corresponding to the sub-connection in the database for the database operation statement.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for processing database operation statements are implemented.

[0025] According to another aspect of the present invention, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned methods for processing database operation statements are implemented.

[0026] According to another aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a machine executable program stored in the memory and running on the processor, and the processor implements the steps of any of the above-mentioned database operation statement processing methods when executing the machine executable program.

[0027] The method for processing database operation statements of the present invention first obtains a database operation statement; determines whether the database operation statement contains a target keyword; when the database operation statement contains the target keyword, obtains a target sub-connection corresponding to the target keyword; determines whether the target column of the target sub-connection contains an aggregation function; if so, replaces the target keyword and its corresponding target sub-connection with a corresponding response result according to the type of the target keyword. Through this method, unnecessary aggregation operations and table scans can be reduced by replacing the target sub-connection with the corresponding response result, thereby improving the efficiency of the query.

[0028] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0030] Figure 1 is a flowchart of a method for processing database operation statements according to an embodiment of the present invention;

[0031] Figure 2 is a flowchart of a method for processing database operation statements according to another embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of a computer program product according to an embodiment of the present invention;

[0033] Figure 4 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; and

[0034] Figure 5 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] It should be understood by those skilled in the art that the embodiments described below are only some embodiments of the present invention, rather than all embodiments of the present invention, and these embodiments are intended to explain the technical principles of the present invention, rather than to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should still fall within the protection scope of the present invention.

[0036] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.

[0037] The present invention provides a method for processing database operation statements. Figure 1 FIG. 1 is a flow chart of a method for processing a database operation statement according to an embodiment of the present invention. Figure 1 As shown, the method for processing the database operation statement at least includes the following steps S101 to S105.

[0038] Step S101, obtaining database operation statements. An optional example is SQL (Structured Query Language). SQL statements have multiple functions such as data manipulation and data definition. This language has interactive characteristics and can provide great convenience for users. In this step, the way to receive database operation statements can generally be active input by the user, or automatically generated by the database program during operation due to business needs. Those skilled in the art can decide the way to receive database operation statements according to actual conditions.

[0039] Step S102, determining whether the database operation statement contains the target keyword.

[0040] In some optional embodiments, the step of determining whether the database operation statement contains the target keyword may generally include: parsing the database operation statement to obtain the query structure of the database operation statement; traversing the query structure to determine whether the target keyword exists in the query structure. The parsing step is usually to convert a SQL (database operation statement) statement into a data format that is easier for a computer to understand and operate. Usually, this involves identifying keywords (such as SELECT, FROM, WHERE, etc.), table names, field names, conditional expressions, etc. in SQL, and organizing them according to a certain logical structure. This parsed form is called a "query structure" or "abstract syntax tree", which represents all components of the original SQL statement and their interrelationships in a more intuitive way. Once the query structure mentioned above is obtained, the next task is to check whether this structure contains certain specific words or phrases (i.e., "target keywords"). This search process is usually performed by traversing each node in the query structure.

[0041] Optionally, the target keywords generally include exists and not exists. The exists operator is used to determine whether there are records in the query clause. If one or more records exist, it returns true, otherwise it returns false. If not exists means that the subquery does not return any rows, not exists returns true, otherwise it returns false.

[0042] Step S103, if the judgment in step S102 is yes, obtain the target sub-connection corresponding to the target keyword. Since exists and not exists are used to determine whether the corresponding clause has a record, that is, the target sub-connection, in the method of the present invention, it is necessary to obtain the target sub-connection corresponding to the target keyword to determine the return result of exists or not exists.

[0043] Step S104, determine whether the target column of the target sub-connection contains an aggregate function. Aggregate functions in SQL are a type of function used to calculate a set of values ​​and return a single result. Common aggregate functions generally include: COUNT(): calculate the number of rows, SUM(): calculate the sum of a numeric column, AVG(): calculate the average value of a numeric column, MAX(): return the maximum value in a column, MIN(): return the minimum value in a column, etc. If such aggregate functions have recorded content, they are processed according to the function of the aggregate function itself. If the input is empty, a null value or 0 will be returned to generate a record.

[0044] Therefore, when an aggregate function appears in the target column of the child connection of exists, the original child connection will have no result set. However, since the aggregate function will produce a null value or 0 when there is no result set, and a null or 0 value is also a record, exists will return true due to the appearance of the aggregate function.

[0045] Similarly, when an aggregate function appears in the target column of the sub-join of not exists, the original sub-join will result in no result set. However, since the aggregate function will produce a null value or 0 when there is no result set, and a null value or 0 is also a record, not exists will return false due to the appearance of the aggregate function.

[0046] Step S105, when the judgment in step S104 is yes, the target keyword and its corresponding target sub-connection are replaced with the corresponding response result according to the type of the target keyword. The response result is generally a Boolean value, generally including true and false. And based on the above analysis, it can be concluded that when there is an aggregation function in the target column of the sub-connection of exists, its return value must be true. Similarly, when there is an aggregation function in the target column of the sub-connection of not exists, its return value must be false. Therefore, the method of the present invention chooses to process this type of database operation statement, thereby reducing unnecessary aggregation operations and table scans, and improving the efficiency of queries.

[0047] Therefore, in some optional embodiments, the step of replacing the target keyword and its corresponding target sub-link with the corresponding response result according to the type of the target keyword may generally include: when the target keyword is exists, replacing the target keyword and its corresponding target sub-link with true. When the target keyword is not exists, replacing the target keyword and its corresponding target sub-link with false.

[0048] Through this method, unnecessary aggregation operations and table scans can be reduced by replacing the target sub-connection with the corresponding response result, thereby improving the efficiency of the query.

[0049] Optionally, after the step of replacing the target keyword and its corresponding target sub-connection with the corresponding response result according to the type of the target keyword, the following steps may be generally included: determining whether there are other sub-connections in the database operation statement; if not, reassigning the flag bit corresponding to the sub-connection in the database operation statement. Since there is not necessarily only one target sub-connection in the SQL statement, it is necessary to loop through and replace them one by one.

[0050] If the check finds that no other sub-joins exist, the next operation is to update a specific flag. This flag is usually a variable or field used to identify whether a query has a sub-join. By setting this flag to a new value (usually indicating a "no sub-join" state), it can ensure that the subsequent processing logic can correctly identify the state of the query.

[0051] Figure 2 FIG. 1 is a flow chart of a method for processing a database operation statement according to another embodiment of the present invention. Figure 2 As shown, the method for processing the database operation statement at least includes the following steps S201 to S208.

[0052] Step S201, obtaining a database operation statement.

[0053] Step S202, parsing the database operation statement to obtain a query structure of the database operation statement.

[0054] Step S203, traverse the query structure to determine whether the target keyword exists in the query structure.

[0055] Step S204, when the judgment in step S203 is yes, obtain the target sub-link corresponding to the target keyword.

[0056] Step S205, determining whether the target column of the target sub-connection contains an aggregate function.

[0057] Step S206: If the answer in step S205 is yes, it is determined whether the target keyword is not exists.

[0058] Step S207, when the judgment in step S206 is no, it indicates that the target keyword is exists, and the target keyword and its corresponding target sub-link are replaced with true.

[0059] Step S208, when the result of step S206 is yes, it indicates that the target keyword is not exists, and the target keyword and its corresponding target sub-link are replaced with false.

[0060] Through this method, unnecessary aggregation operations and table scans can be reduced by replacing the target sub-connection with the corresponding response result, thereby improving the efficiency of the query.

[0061] In order to clearly illustrate the processing flow of this method, some optional embodiments are proposed as follows:

[0062] Embodiment 1:

[0063] Select exists(select count(t2.id)from t2)as a,t1.id from t1 Formula 1

[0064] In the SQL statement shown in Formula 1:

[0065] The target keyword is exists, and the target sub-join corresponding to exists is select count(t2.id)fromt2, which is used to calculate the number of records in the t2 table.

[0066] Due to the existence of count(t2.id), when the target child connection has a value in the id column of the t2 table, it will be processed according to the function of the aggregate function itself; if the id column of the t2 table is empty, the aggregate function count(t2.id) will return 0. And 0 is also considered a row of records. Therefore, there is always a result set in exists(select count(t2.id)from t2), so it will always return true.

[0067] Main query: For each row in the t1 table, select the id column and add a column named a whose value is always true.

[0068] By the method of the present invention, when the SQL statement shown in Formula 1 is obtained, the method of the present invention first determines whether it contains the target keyword. Since the target keyword exists exists in its target column "exists(select count(t2.id)from t2)as a", the target sub-connection "select count(t2.id)fromt2" corresponding to exists is obtained; then it is determined whether the target column of the target sub-connection contains an aggregation function. Since the aggregation function count(t2.id) exists in Formula 1, the target keyword and its corresponding target sub-connection can be replaced with the corresponding Boolean value according to the type of the target keyword. The SQL statement finally processed is shown in Formula 2:

[0069] select true as a,t1.id from t1 Formula 2

[0070] As shown in Formula 2, there is no aggregation function in the SQL statement, which reduces unnecessary aggregation operations and table scans and greatly improves query efficiency.

[0071] Embodiment 2:

[0072] select t1.id from t1 where exists(select count(t2.id)from t2)Equation 3

[0073] In the SQL statement shown in Formula 3:

[0074] The target keyword is exists, and the target sub-join corresponding to exists is select count(t2.id)fromt2, which is used to calculate the number of records in the t2 table.

[0075] Due to the existence of count(t2.id), when the target child connection has a value in the id column of the t2 table, it will be processed according to the function of the aggregate function itself; if the id column of the t2 table is empty, the aggregate function count(t2.id) will return 0. And 0 is also considered a row of records. Therefore, there is always a result set in exists(select count(t2.id)from t2), so it will always return true.

[0076] Main query: Select the id column from the t1 table, and select all ids from the t1 table as long as there is at least one record in the t2 table.

[0077] By the method of the present invention, when the SQL statement shown in Formula 1 is obtained, the method of the present invention first determines whether it contains the target keyword. Since the target keyword exists exists in its target column "exists(select count(t2.id)from t2)", the target sub-connection "select count(t2.id)from t2" corresponding to exists is obtained; then it is determined whether the target column of the target sub-connection contains an aggregation function. Since the aggregation function count(t2.id) exists in Formula 3, the target keyword and its corresponding target sub-connection can be replaced with the corresponding Boolean value according to the type of the target keyword. The SQL statement finally processed is shown in Formula 4:

[0078] select t1.id from t1 where true Formula 4

[0079] As shown in Formula 4, there is no aggregation function in the SQL statement, which reduces unnecessary aggregation operations and table scans and greatly improves query efficiency.

[0080] Embodiment three:

[0081] select t1.id from t1 where not exists(select count(t2.id)from t2)Equation 5

[0082] In the SQL statement shown in the formula:

[0083] The target keyword is not exists, and the target sub-join corresponding to not exists is select count(t2.id)from t2, which is used to calculate the number of records in the t2 table.

[0084] Due to the existence of count(t2.id), when the target child connection has a value in the id column of the t2 table, it will be processed according to the function of the aggregate function itself; if the id column of the t2 table is empty, the aggregate function count(t2.id) will return 0. And 0 is also considered a row of records. Therefore, there is always a result set in not exists(select count(t2.id)from t2), so it will always return false.

[0085] Main query: For each row in the t1 table, select the id column, and select all ids in the t1 table only if the t2 table is empty.

[0086] By the method of the present invention, when the SQL statement shown in Formula 5 is obtained, the method of the present invention first determines whether it contains the target keyword. Since the target keyword not exists exists in its conditional clause "not exists(select count(t2.id)from t2)", the target sub-connection "select count(t2.id)from t2" corresponding to not exists is obtained; then it is determined whether the target column of the target sub-connection contains an aggregation function. Since the aggregation function count(t2.id) exists in Formula 5, the target keyword and its corresponding target sub-connection can be replaced with the corresponding Boolean value according to the type of the target keyword. The SQL statement finally processed is shown in Formula 6:

[0087] select t1.id from t1 where false Formula 6

[0088] As shown in Formula 6, there is no aggregation function in the SQL statement, which reduces unnecessary aggregation operations and table scans and greatly improves query efficiency.

[0089] Embodiment 4:

[0090] select t1.id from t1 where not exists(select count(t2.id)from t2where t2.id>t1.id)Equation 7

[0091] In the SQL statement shown in the formula:

[0092] The target keyword is not exists, and the target sub-join corresponding to not exists is select count(t2.id)from t2 where t2.id>t1.id, which negates the result of the exists sub-query. If there is no record in the t2 table such that t2.id>t1.id, it returns TRUE; otherwise, it returns FALSE

[0093] Due to the existence of count(t2.id), when the target child connection has a value greater than t1.id in the id column of the t2 table, it will be processed according to the function of the aggregation function itself; if it does not exist, the aggregation function count(t2.id) will return 0. And 0 is also considered a row of records. Therefore, there is always a result set in not exists(select count(t2.id)from t2 where t2.id>t1.id), so it will always return false.

[0094] Main query: Select the id column in the t1 table and require that there is no record in the t2 table such that t2.id>t1.id.

[0095] By the method of the present invention, when the SQL statement shown in Formula 7 is obtained, the method of the present invention first determines whether it contains the target keyword. Since the target keyword not exists exists in its conditional clause "not exists(select count(t2.id)from t2 where t2.id>t1.id)", the target sub-connection "select count(t2.id)from t2 where t2.id>t1.id" corresponding to not exists is obtained; then it is determined whether the target column of the target sub-connection contains an aggregation function. Since the aggregation function count(t2.id) exists in Formula 7, the target keyword and its corresponding target sub-connection can be replaced with the corresponding Boolean value according to the type of the target keyword. The SQL statement finally processed is shown in Formula 8:

[0096] select t1.id from t1 where false Formula 8

[0097] As shown in Formula 8, there is no aggregation function in the SQL statement, which reduces unnecessary aggregation operations and table scans and greatly improves query efficiency.

[0098] Embodiment five:

[0099] select t1.id from t1 join t2 on t1.id=t2.id and not exists(selectcount(t3.id)

[0100] from t3 where t3.id > t1.id) Equation 9

[0101] In the SQL statement shown in the formula:

[0102] The target keyword is not exists, and the target sub-join corresponding to not exists is select count(t3.id)from t3 where t3.id>t1.id, which negates the result of the exists sub-query. If there is no record in the t2 table such that t3.id>t1.id, it returns TRUE; otherwise, it returns FALSE

[0103] Due to the existence of count(t3.id), when the target child connection has a value greater than t1.id in the id column of the t3 table, it will be processed according to the function of the aggregation function itself; if it does not exist, the aggregation function count(t3.id) will return 0. And 0 is also considered a row of records. Therefore, there is always a result set in not exists(select count(t3.id)from t3 where t3.id>t1.id), so it will always return false.

[0104] Main query: Select the id column in the t1 table and require that there is no record in the t3 table such that t3.id>t1.id.

[0105] By the method of the present invention, when the SQL statement shown in Formula 9 is obtained, the method of the present invention first determines whether it contains the target keyword. Since the target keyword not exists exists in its conditional clause "not exists(select count(t3.id)from t3 where t3.id>t1.id)", the target sub-connection "select count(t3.id)from t3 where t3.id>t1.id" corresponding to not exists is obtained; then it is determined whether the target column of the target sub-connection contains an aggregation function. Since the aggregation function count(t3.id) exists in Formula 9, the target keyword and its corresponding target sub-connection can be replaced with the corresponding Boolean value according to the type of the target keyword. The SQL statement finally processed is shown in Formula 10:

[0106] select t1.id from t1 join t2 on t1.id = t2.id and false Equation 10

[0107] As shown in Formula 10, there is no aggregation function in the SQL statement, which reduces unnecessary aggregation operations and table scans and greatly improves query efficiency.

[0108] The flow chart provided by the present embodiment is not intended to indicate that the operation of the method will be performed in any particular order, or that all operations of the method are included in all every case. In addition, the method may include additional operations. Within the scope of the technical thinking provided by the present embodiment method, additional changes may be made to the above method.

[0109] It should be understood that in some embodiments, each part can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0110] This embodiment also provides a computer program product 10 , a computer readable storage medium 20 , and a computer device 30 . Figure 3 is a schematic diagram of a computer program product 10 according to an embodiment of the present invention, Figure 4 is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention, Figure 5 is a schematic diagram of a computer device 30 according to an embodiment of the present invention. The computer program product 10 includes a computer program 11, which implements the steps of any of the above-mentioned methods for processing database operation statements when executed by a processor 32. The computer-readable storage medium 20 stores the above-mentioned computer program 11, which implements the steps of any of the above-mentioned methods for processing database operation statements when executed by a processor 32. The computer device 30 may include a memory 31, a processor 32, and the computer program 11 stored in the memory 31 and running on the processor 32.

[0111] The computer program 11 for performing the operation of the present invention may be an assembly instruction, an instruction set architecture (ISA) instruction, a machine instruction, a machine-related instruction, a microcode, a firmware instruction, a state setting data, a configuration data of an integrated circuit, or a source code or an object code written in any combination of one or more programming languages ​​and process programming languages. The computer program 11 may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider via the Internet). In some embodiments, in order to perform various aspects of the present invention, an electronic circuit including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA) may execute computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit.

[0112] For the purposes of the description of the present embodiment, the computer program product 10 is a related product that includes the computer program 11. For the purposes of the description of the present embodiment, the computer readable storage medium 20 is a tangible device capable of retaining and storing the computer program 11, which may be any device that can contain, store, communicate, propagate or transmit the program 11 for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples (a non-exhaustive list) of the computer readable storage medium 20 include the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, and any suitable combination of the foregoing.

[0113] The computer device 30 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smart phone. In some examples, the computer device 30 may be a cloud computing node. The computer device 30 may be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, a program module may include routines, programs, target programs, components, logic, data structures, etc. that perform specific tasks or implement specific abstract data types. The computer device 30 may be implemented in a distributed cloud computing environment where remote processing devices linked through a communication network perform tasks. In a distributed cloud computing environment, program modules may be located on a local or remote computing system storage medium including a storage device.

[0114] The computer device 30 may include a processor 32 adapted to execute stored instructions, and a memory 31 providing temporary storage space for the operation of the instructions during operation. The processor 32 may be a single-core processor, a multi-core processor, a computing cluster, or any number of other configurations. The memory 31 may include a random access memory (RAM), a read-only memory, a flash memory, or any other suitable storage system.

[0115] The computer device 30 may also include a network adapter / interface and an input / output (I / O) interface. The I / O interface allows data to be input and output with external devices that may be connected to the computer device. The network adapter / interface may provide communication between the computer device and a network, which is typically shown as a communication network.

[0116] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all these other variations or modifications.

Claims

1. A method for processing a database operation statement, comprising: Obtaining the database operation statement; Determining whether the database operation statement contains a target keyword; When the database operation statement contains the target keyword, obtaining a target sub-connection corresponding to the target keyword; Determine whether the target column of the target sub-connection contains an aggregate function; If so, the target keyword and its corresponding target sub-link are replaced with a corresponding response result according to the type of the target keyword.

2. The method for processing database operation statements according to claim 1, wherein: The step of determining whether the database operation statement contains the target keyword comprises: Parsing the database operation statement to obtain a query structure of the database operation statement; The query structure is traversed to determine whether the target keyword exists in the query structure.

3. The method for processing database operation statements according to claim 1, wherein: The target keywords include exists and not exists.

4. The method for processing database operation statements according to claim 3, wherein: The response results include true and false.

5. The method for processing database operation statements according to claim 4, wherein: The step of replacing the target keyword and its corresponding target sub-link with a corresponding response result according to the type of the target keyword comprises: When the target keyword is exists, the target keyword and the corresponding target sub-link are replaced with true.

6. The method for processing database operation statements according to claim 4, wherein: The step of replacing the target keyword and its corresponding target sub-link with a corresponding response result according to the type of the target keyword also includes: In the case where the target keyword is not exists, the target keyword and the corresponding target sub-link are replaced with false.

7. The method for processing database operation statements according to claim 1, wherein: After the step of replacing the target keyword and the corresponding target sub-link with the corresponding response result according to the type of the target keyword, the following step further includes: Determine whether there are other sub-connections in the database operation statement; If not, reassign a value to the flag bit of the database operation statement corresponding to the sub-connection in the database.

8. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for processing a database operation statement according to any one of claims 1 to 7 are implemented.

9. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method for processing a database operation statement according to any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a machine executable program stored in the memory and running on the processor, wherein the processor implements the steps of the method for processing database operation statements according to any one of claims 1 to 7 when executing the machine executable program.