Method, system and equipment for realizing Delete statement subquery function in openGauss database
By constructing subquery syntax rules and adjusting semantic parsing processes in the openGauss database, the subquery function of the Delete statement is realized, the problem of lack of subquery mechanism in the database is solved, and the compatibility of the database and the smoothness of the migration process are improved.
Patent Information
- Application Number
- CN202411980719.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-03-25
AI Technical Summary
The lack of subquery mechanism and functions of Delete statements in the openGauss database, which makes it impossible to implement the subquery function of Delete statements in the database, affecting the compatibility of the database and the smoothness of the migration process.
By constructing subquery syntax rules, add subquery saving nodes to the Delete syntax tree, adjust the semantic parsing process, determine the key-value saving table, and identify and delete data in the executor stage to realize the subquery function of the Delete statement.
The subquery function of the Delete statement in the openGauss database is realized, which improves compatibility with relational databases, expands the scope of database function support, and improves the smoothness of system migration.
Smart Images

Figure CN119691002A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of database subquery, and in particular to a method, system and device for implementing a subquery function of a Delete statement in an openGauss database. Background Art
[0002] The Delete statement is a command statement in SQL (Structured Query Language) used to delete data in a specified data object in a database. When using the Delete statement, you can delete all data or delete part of the data according to the specified conditions.
[0003] In different database products, in addition to the standard Delete syntax, each database product will also expand its own Delete function according to its own characteristics to provide users with more convenient and rich functions. For example, the Delete statement in the openGauss database can specify the data objects such as tables and views to be deleted, and delete the specified data in the data objects according to the specified restrictions. The Delete statement in the Oracle database can support more objects. In addition to data objects such as tables in standard SQL statements, it can also support subqueries.
[0004] In actual applications, the Delete statement in the openGauss database lacks a subquery mechanism and function. How to implement the subquery function of the Delete statement in the openGauss database so that openGauss has a wider support range and systems based on other databases can also obtain better support when migrating to the openGauss database, making the migration process smoother, has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, in order to overcome the deficiencies of the prior art, the present application aims to provide a method, system and device for implementing the subquery function of a Delete statement in an openGauss database.
[0006] According to a first aspect of the present application, a method for implementing a Delete statement subquery function in an openGauss database is provided, the method comprising: Construct subquery syntax rules and add subquery save nodes in the Delete syntax tree; Adjust the semantic parsing process according to the structure and content changes of the Delete syntax tree; In the query optimization phase, determine the key value storage table for the from clause of the Delete statement corresponding to the current operation; In the executor phase, the key-value storage table is identified, and the data is located and deleted according to the identified key-value storage table.
[0007] Optionally, in the method of implementing the subquery function of the Delete statement in the openGauss database of the present application, a subquery grammar rule is constructed, and a subquery saving node is added to the Delete grammar tree, including: adding a grammar rule corresponding to the subquery structure to the Delete grammar rule of the openGauss database, and adding a node for saving the subquery node to the Delete grammar tree node.
[0008] Optionally, the method of the present application for implementing the subquery function of the Delete statement in the openGauss database is characterized in that the semantic parsing process is adjusted according to the structure and content changes of the Delete syntax tree, including: in the semantic parsing stage, checking whether the with clause is empty, and reporting an error when the with clause is not empty; when the with clause is empty, checking whether the from clause is empty, and reporting an error when the from clause is empty; when the from clause is not empty, performing a transform subquery and marking the target table of the data to be Deleted.
[0009] Optionally, the method of implementing the Delete statement subquery function in the openGauss database of the present application is characterized in that when the from clause is not empty, a transform subquery is performed, including: Check the scenes in the semantic check process and report errors for scenes that do not support semantic check. Fill the from clause of the subquery into the from clause of the Delete statement, and merge the where clause of the subquery with the where clause of the Delete statement.
[0010] Optionally, the method of implementing the Delete statement subquery function in the openGauss database of the present application is characterized in that, in the query optimization stage, a key value storage table is determined for the from clause of the Delete statement corresponding to the current operation, including: In the query optimization phase, the query plan is rewritten to determine whether the current operation is a Delete operation. If the current operation is a Delete operation, determine whether the length of the from clause of the Delete statement corresponding to the current operation is 1. If the length of the from clause of the Delete statement corresponding to the current operation is 1, the current table of the from clause is saved as the key value table; If the length of the from clause of the Delete statement corresponding to the current operation is not 1, the key value storage table is determined for the from clause according to the association relationship and connection conditions of the from clause list.
[0011] Optionally, the method of implementing the subquery function of the Delete statement in the openGauss database of the present application is characterized in that, according to the association relationship and the connection condition of the from clause list, a key value storage table is determined for the from clause, including: When the table in the from clause list is a cross-join table or a full outer join table, and none of the tables in the from clause list is a key value storage table, an error is reported; When the join condition of the table in the from clause list is an inner join, if there is only one primary key in the join key, the table where the non-primary key is located is used as the key value storage table of the from clause. If there are two primary keys in the join key, the table where the primary key with the first order is located is used as the key value storage table of the from clause. If the join key has no primary key, the tables in the from clause list are not key value storage tables, and an error is reported; When the connection condition of the tables in the from clause list is an outer join, if the primary table is connected to the unique key of the secondary table, the primary table is used as the key value storage table of the from clause. If the primary table is not connected to the unique key of the secondary table, the tables in the from clause list are not key value storage tables, and an error is reported.
[0012] Optionally, the method of the present application for implementing the subquery function of the Delete statement in the openGauss database is characterized in that a key value storage table is determined for the from clause based on the association relationship and connection conditions of the from clause list, and also includes: before determining the key value storage table for the from clause, the connection conditions of the from clause list are formatted in a unified manner.
[0013] Optionally, the method of the present application for implementing the subquery function of the Delete statement in the openGauss database is characterized in that a key value storage table is identified in the executor stage, and data is located and deleted according to the identified key value storage table, including: identifying the key value storage table from a list of multi-table connections in the executor stage, using the identified key value storage table as the target table of the Delete operation, and locating and deleting the corresponding data in the target table of the Delete operation.
[0014] According to a second aspect of the present application, a system for implementing a subquery function of a Delete statement in an openGauss database is provided, the system comprising a subquery implementation server, the subquery implementation server comprising: Syntax and structure support module, used to build subquery syntax rules and add subquery save nodes in the Delete syntax tree; The semantic parsing adjustment module is used to adjust the semantic parsing process according to the structure and content changes of the Delete syntax tree; A key value storage table determination module is used to determine the key value storage table for the from clause of the Delete statement corresponding to the current operation during the query optimization phase; The executor adjustment module is used to identify the key value storage table in the executor stage, and locate and delete data according to the identified key value storage table.
[0015] According to a third aspect of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present application when executing the program.
[0016] The present application provides a method, system and device for implementing the Delete statement subquery function in an openGauss database, which can implement the Delete subquery function in an openGauss database, improve compatibility with relational databases such as Oracle databases, expand the functional support scope of the openGauss database, and improve the smoothness of system migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is an example diagram of the architecture of a system for implementing a Delete statement subquery function in an openGauss database according to an embodiment of the present application; Figure 2 This is an example diagram of the architecture of a subquery implementation server of a system for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application; Figure 3 A flowchart of a method for implementing a Delete statement subquery function in an openGauss database according to an embodiment of the present application; Figure 4 Another step flow chart of a method for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application; Figure 5It is another step flow chart of a method for implementing a Delete statement subquery function in an openGauss database according to an embodiment of the present application; Figure 6 An execution example diagram of query optimization for a method for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application; Figure 7 An electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0020] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.
[0021] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0022] Figure 1 FIG. 1 is an example diagram of the architecture of a system for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application. Figure 1 As shown, the system may include a sub-query implementation server 101, a communication network 102 and / or one or more sub-query implementation clients 103. Figure 1 The example in FIG. 104 implements client 103 for multiple subqueries.
[0023] The subquery implementation server 101 can be any appropriate server for storing information, data, programs and / or any other suitable type of content. In some embodiments, the subquery implementation server 101 can perform appropriate functions. For example, in some embodiments, the subquery implementation server 101 can be used to implement the Delete statement subquery function in the openGauss database. As an optional example, in some embodiments, the subquery implementation server 101 can be used to: construct subquery grammar rules, add subquery storage nodes in the Delete syntax tree; adjust the semantic parsing process according to the structure and content changes of the Delete syntax tree; in the query optimization stage, determine the key value storage table for the from clause of the Delete statement corresponding to the current operation; identify the key value storage table in the executor stage, and locate and delete data according to the identified key value storage table.
[0024] Figure 2 The following is an example diagram of the architecture of a subquery implementation server of a system for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application. Figure 2 As shown, the subquery implementation server of this embodiment includes: Syntax and structure support module, used to build subquery syntax rules and add subquery save nodes in the Delete syntax tree; The semantic parsing adjustment module is used to adjust the semantic parsing process according to the structure and content changes of the Delete syntax tree; A key value storage table determination module is used to determine the key value storage table for the from clause of the Delete statement corresponding to the current operation during the query optimization phase; The executor adjustment module is used to identify the key value storage table in the executor stage, and locate and delete data according to the identified key value storage table.
[0025] As another example, in some embodiments, the subquery implementation server 101 may send a method for implementing the subquery function of a Delete statement in an openGauss database to the subquery implementation client 103 for user use based on a request of the subquery implementation client 103 .
[0026] As an optional example, in some embodiments, the subquery implementation client 103 is used to provide a visual subquery implementation interface, which is used to receive a user's selection input operation to implement a Delete statement subquery function in an openGauss database, and to, in response to the selection input operation, obtain a subquery implementation interface corresponding to the option selected by the selection input operation from the subquery implementation server 101 and display the subquery implementation interface, wherein the subquery implementation interface at least displays information on implementing the Delete statement subquery function in the openGauss database and operation options for the information on implementing the Delete statement subquery function in the openGauss database.
[0027] In some embodiments, the communication network 102 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 102 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN), and / or any other suitable communication network. The subquery implementation client 103 can be connected to the communication network 102 via one or more communication links (e.g., communication link 104), and the communication network 102 can be linked to the subquery implementation server 101 via one or more communication links (e.g., communication link 105). The communication link can be any communication link suitable for transmitting data between the subquery implementation client 103 and the subquery implementation server 101, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link, or any suitable combination of such links.
[0028] The subquery implementation client 103 may include any one or more clients that present an interface related to implementing the Delete statement subquery function in the openGauss database in an appropriate form for use and operation by a user. In some embodiments, the subquery implementation client 103 may include any suitable type of device. For example, in some embodiments, the subquery implementation client 103 may include a mobile device, a tablet computer, a laptop computer, a desktop computer, and / or any other suitable type of client device.
[0029] Although the subquery implementation server 101 is illustrated as one device, in some embodiments, any suitable number of devices may be used to perform the functions performed by the subquery implementation server 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the subquery implementation server 101. Alternatively, the functions of the subquery implementation server 101 may be implemented using a cloud service.
[0030] Based on the above system, an embodiment of the present application provides a cloud platform interface design walkthrough method based on a rule engine, which is described below through the following embodiments.
[0031] Figure 3 The method for implementing the subquery function of a Delete statement in an openGauss database according to an embodiment of the present application is a flowchart of the steps. The method for implementing the subquery function of a Delete statement in an openGauss database in this embodiment can be executed on a subquery implementation server, and the method for implementing the subquery function of a Delete statement in an openGauss database includes the following steps: Step S201: construct a subquery grammar rule, and add a subquery save node in the Delete grammar tree.
[0032] In this embodiment, a grammar rule corresponding to the subquery structure is added to the Delete grammar rule of the openGauss database, and a node for storing the subquery node is added to the Delete grammar tree node.
[0033] As an optional example, this embodiment adds a syntax rule that needs to be supported to the original Delete syntax rule, and adds rule support for subquery structure to the syntax rule. For example, the following syntax rule is added to the original Delete syntax rule: opt_with_clause DELETE_P hint_string [from]select_with_parens opt_alias_clause using_clause where_or_current_clause returning_clause.
[0034] Among them, opt_with_clause represents an optional with clause; DELETE_P represents the delete keyword; hint_string represents an optional hint clause; [from] is an optional from keyword; select_with_parans represents the subquery rules that need to be supported; opt_alias_clause represents the alias of the subquery; using_clause represents the using clause; where_or_current_clause represents the where or current clause; returning_clause represents the optional returning clause.
[0035] As an optional example, this embodiment adjusts the syntax tree node of the original Delete statement and adds a structure for storing sub-query nodes. For example, a member Node *fromClause is added to the original syntax tree node to store the newly added sub-query node.
[0036] Step S202: adjusting the semantic parsing process according to the structure and content changes of the Delete syntax tree.
[0037] Figure 4 FIG. 1 is another step flow chart of a method for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application. Figure 4 As shown, in the semantic parsing stage, check whether the with clause is empty. If the with clause is not empty, an error is reported. If the with clause is empty, check whether the from clause is empty. If the from clause is empty, an error is reported. If the from clause is not empty, a transform subquery is performed and the target table of the data to be deleted is marked.
[0038] Figure 5 FIG. 1 is another step flow chart of a method for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application, as shown in FIG. Figure 5 As shown, in this embodiment, when the from clause is not empty, a transform subquery is performed, including: checking the scenarios in the semantic check process, and performing scenario error processing on scenarios that do not support semantic checking. In the from clause processing stage, the from clause of the subquery and the from clause of the Delete statement are semantically consistent. The from clause of the subquery is used to fill the from clause of the Delete statement, thereby realizing subsequent semantic checks. The specific table data to be deleted can be analyzed and specified in the optimization stage. The where clause of the subquery and the Delete clause have an intersection property. In the semantic processing, this embodiment performs a logical AND operation to merge the two. For example, this embodiment fills the from clause of the subquery into the from clause of the Delete statement, and merges the where clause of the subquery with the where clause of the Delete statement.
[0039] Step S203: In the query optimization stage, a key value storage table is determined for the from clause of the Delete statement corresponding to the current operation.
[0040] In the query optimization stage, this embodiment rewrites the query plan according to the characteristics of the subquery. The core task is to determine the key value storage table in the from clause. The key value storage table is used to determine the table for actually deleting data when multiple tables are connected for deletion operations.
[0041] Figure 6 An execution example diagram of query optimization according to a method for implementing a subquery function of a Delete statement in an openGauss database according to an embodiment of the present application.
[0042] like Figure 6 As shown, as an optional example, in this embodiment, in the query optimization stage, the query plan is rewritten to determine whether the current operation is a Delete operation.
[0043] If the current operation is a Delete operation, determine whether the length of the from clause of the Delete statement corresponding to the current operation is 1; if the length of the from clause of the Delete statement corresponding to the current operation is 1, use the current table of the from clause as the key value storage table.
[0044] If the length of the from clause of the Delete statement corresponding to the current operation is not 1, the key value storage table is determined for the from clause according to the association relationship and connection conditions of the from clause list. Specifically, when the table in the from clause list is a cross connection table and a full outer connection table, the table in the from clause list is not a key value storage table, and an error is reported; when the connection condition of the table in the from clause list is an inner connection, if there is only one primary key in the connection key, the table where the non-primary key is located is used as the key value storage table of the from clause. If there are two primary keys in the connection key, the table where the primary key with the first order is located is used as the key value storage table of the from clause. If the connection key has no primary key, the table in the from clause list is not a key value storage table, and an error is reported; when the connection condition of the table in the from clause list is an outer connection, if the primary table is connected to the unique key of the secondary table, the primary table is used as the key value storage table of the from clause. If the primary table is not connected to the unique key of the secondary table, the table in the from clause list is not a key value storage table, and an error is reported.
[0045] It should be noted that, in this embodiment, before determining the key value storage table for the from clause, the format of the connection conditions in the from clause list is unified.
[0046] In actual applications, when multiple tables use multiple connection conditions, each connection key is judged separately, and the primary key of the key value storage table is used as the primary key of the view after the two tables are connected. When multiple tables are connected, if a table column does not appear in the connection key, it is determined that there is no key value storage table and an error is reported.
[0047] Step S204: Identify the key value storage table in the executor stage, and locate and delete data according to the identified key value storage table.
[0048] In the semantic analysis phase, the target table of this embodiment has been adjusted to a list of multi-table connections. In the executor phase, this embodiment needs to perform data operations on the table. As an optional example, in this embodiment, in the executor phase, a key value storage table is identified from the list of multi-table connections, and the identified key value storage table is used as the target table of the Delete operation. The corresponding data is located and deleted in the target table of the Delete operation, thereby completing the entire subquery adaptation adjustment process.
[0049] The method, system and device for implementing the Delete statement subquery function in the openGauss database of this embodiment can implement the Delete subquery function in the openGauss database, improve compatibility with relational databases such as Oracle databases, expand the functional support scope of the openGauss database, and improve the smoothness of system migration.
[0050] like Figure 7 As shown, the present application also provides a device, including a processor 310, a communication interface 320, a memory 330 for storing a processor executable computer program, and a communication bus 340. The processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 implements the above-mentioned method of implementing the Delete statement subquery function in the openGauss database by running the executable computer program.
[0051] Among them, the computer program in the memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0052] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected based on actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0053] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0054] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for implementing the subquery function of a Delete statement in an openGauss database, characterized in that: The method comprises: Construct subquery syntax rules and add subquery save nodes in the Delete syntax tree; Adjust the semantic parsing process according to the structure and content changes of the Delete syntax tree; In the query optimization phase, determine the key value storage table for the from clause of the Delete statement corresponding to the current operation; In the executor phase, the key-value storage table is identified, and the data is located and deleted according to the identified key-value storage table.
2. The method for implementing the Delete statement subquery function in the openGauss database according to claim 1, characterized in that: Construct subquery grammar rules and add subquery saving nodes in the Delete grammar tree, including: adding grammar rules corresponding to the subquery structure in the Delete grammar rules of the openGauss database, and adding nodes for saving subquery nodes in the Delete grammar tree nodes.
3. The method for implementing the Delete statement subquery function in the openGauss database according to claim 1, characterized in that: According to the changes in the structure and content of the Delete syntax tree, the semantic parsing process is adjusted, including: in the semantic parsing stage, check whether the with clause is empty. If the with clause is not empty, an error is reported; if the with clause is empty, check whether the from clause is empty. If the from clause is empty, an error is reported; if the from clause is not empty, a transform subquery is performed and the target table of the data to be deleted is marked.
4. The method for implementing the subquery function of a Delete statement in an openGauss database according to claim 3, characterized in that: When the from clause is not empty, a transform subquery is performed, including: Check the scenes in the semantic check process and report errors for scenes that do not support semantic check. Fill the from clause of the subquery into the from clause of the Delete statement, and merge the where clause of the subquery with the where clause of the Delete statement.
5. The method for implementing the Delete statement subquery function in the openGauss database according to claim 1, characterized in that: In the query optimization phase, the key value storage table is determined for the from clause of the Delete statement corresponding to the current operation, including: In the query optimization phase, the query plan is rewritten to determine whether the current operation is a Delete operation. If the current operation is a Delete operation, determine whether the length of the from clause of the Delete statement corresponding to the current operation is 1. If the length of the from clause of the Delete statement corresponding to the current operation is 1, the current table of the from clause is saved as the key value table; If the length of the from clause of the Delete statement corresponding to the current operation is not 1, the key value storage table is determined for the from clause according to the association relationship and connection conditions of the from clause list.
6. The method for implementing the Delete statement subquery function in the openGauss database according to claim 5, characterized in that: According to the association relationship and connection conditions of the from clause list, determine the key value storage table for the from clause, including: When the table in the from clause list is a cross-join table or a full outer join table, and none of the tables in the from clause list is a key value storage table, an error is reported; When the join condition of the table in the from clause list is an inner join, if there is only one primary key in the join key, the table where the non-primary key is located is used as the key value storage table of the from clause. If there are two primary keys in the join key, the table where the primary key with the first order is located is used as the key value storage table of the from clause. If the join key has no primary key, the tables in the from clause list are not key value storage tables, and an error is reported; When the connection condition of the tables in the from clause list is an outer join, if the primary table is connected to the unique key of the secondary table, the primary table is used as the key value storage table of the from clause. If the primary table is not connected to the unique key of the secondary table, the tables in the from clause list are not key value storage tables, and an error is reported.
7. The method for implementing the Delete statement subquery function in the openGauss database according to claim 5, characterized in that: According to the association relationship and connection conditions of the from clause list, a key value storage table is determined for the from clause, and the method further includes: before determining the key value storage table for the from clause, the connection conditions of the from clause list are formatted in a unified manner.
8. The method for implementing the Delete statement subquery function in the openGauss database according to claim 1, characterized in that: Identify the key value storage table in the executor stage, locate and delete data according to the identified key value storage table, including: identify the key value storage table from the list of multi-table connections in the executor stage, use the identified key value storage table as the target table of the Delete operation, and locate and delete corresponding data in the target table of the Delete operation.
9. A system for implementing a Delete statement subquery function in an openGauss database, characterized in that: The system includes a subquery implementation server, and the subquery implementation server includes: Syntax and structure support module, used to build subquery syntax rules and add subquery save nodes in the Delete syntax tree; The semantic parsing adjustment module is used to adjust the semantic parsing process according to the structure and content changes of the Delete syntax tree; A key value storage table determination module is used to determine the key value storage table for the from clause of the Delete statement corresponding to the current operation during the query optimization phase; The executor adjustment module is used to identify the key value storage table in the executor stage, and locate and delete data according to the identified key value storage table.
10. A computer device, characterized in that: The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 8 when executing the program.