WO2017049913A1 - 数据库的执行方法及装置 - Google Patents

数据库的执行方法及装置 Download PDF

Info

Publication number
WO2017049913A1
WO2017049913A1 PCT/CN2016/081892 CN2016081892W WO2017049913A1 WO 2017049913 A1 WO2017049913 A1 WO 2017049913A1 CN 2016081892 W CN2016081892 W CN 2016081892W WO 2017049913 A1 WO2017049913 A1 WO 2017049913A1
Authority
WO
WIPO (PCT)
Prior art keywords
execution
node
database
tree
nodes
Prior art date
Application number
PCT/CN2016/081892
Other languages
English (en)
French (fr)
Inventor
左庄太
丁岩
陈小强
贾新华
高洪
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017049913A1 publication Critical patent/WO2017049913A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • This document relates to the field of communications, and in particular to a method and apparatus for executing a database.
  • the mainstream distributed database basically classifies the data according to the data relevance, and combines the appropriate data redundancy, the related data is collected into one database node, and the database execution statement (such as database retrieval query statement) is issued. Execute to the database node where the associated data resides.
  • A, B, C three types of data, where A and B have no relevance, A and C are related, and B and C are related.
  • a and C are concentrated on the database node DB-1; and B and C are concentrated on another database node DB-2; C data is in the two database nodes DB-1. Consistent with DB-2.
  • the database execution statement (such as database retrieval query statement, etc.) is sent to DB-1 for execution; for the associated data of B and C, the database execution statement (such as database retrieval query statement, etc.) ) Issued to DB-2 for execution. Based on this, associated data across database nodes occurs.
  • the data query of the same database node of a single table, the data query of a single table across database nodes, and the associated data query of the same database node of multiple tables have better support, but for multiple table spans There is no corresponding solution for the associated data query of the database node.
  • Disclosed herein is a database execution method and apparatus to at least solve the technical problem in the related art that does not support cross-database node related data query.
  • a method for executing a database comprising: receiving a structured query SQL request for performing a database operation on one or more databases; generating a corresponding syntax tree according to the received SQL request; traversing each node of the generated syntax tree And generating an execution tree; performing a database operation on the one or more databases according to the generated execution tree.
  • traversing each node of the generated syntax tree and generating an execution tree includes: obtaining a distribution attribute of all the data tables on the generated syntax tree; determining, according to the distribution attribute, whether all the data tables are distributed in the same On the database node; in the case where the judgment result is that all the above data tables are distributed on the same database node, a single node execution tree is generated, and the execution tree only involves one database node.
  • the method further includes: if the result of the determination is that all the data tables are distributed on a plurality of different database nodes, starting from the root node of the generated syntax tree, traversing the child nodes of the root node; If the child nodes of the root node have child nodes, continue to traverse the child nodes of the child nodes of the root node until the traversal of each level of child nodes; according to the traversal result, generate an intermediate state involving multiple database nodes The execution tree.
  • the method further includes: merging the child nodes of the execution tree and the parent thereof layer by layer according to the generated execution tree of the intermediate state The node is not merged into the root node of the execution tree; based on the merge result, an execution tree of the final state is generated.
  • performing database operations on the one or more databases according to the generated execution tree includes: traversing an execution tree of the final state, searching for all leaf nodes without dependencies; and querying the corresponding SQL statements of the leaf nodes Is sent to the corresponding database execution in the one or more databases, and returns an execution result; determining, according to the returned execution result, whether the SQL statement corresponding to the newly added leaf node is sent to the corresponding one or more databases.
  • the database is executed; if the judgment result is yes, the corresponding SQL statement is sent to the corresponding database execution in one or more of the above databases.
  • a database execution apparatus comprising: a receiving unit configured to receive a structured query SQL request for performing a database operation on one or more databases; a first generating unit configured to receive the received SQL request Generating a corresponding syntax tree; the second generating unit is configured to traverse each node of the generated syntax tree and generate an execution tree; and the executing unit is configured to perform a database operation on the one or more databases according to the generated execution tree .
  • the foregoing second generating unit includes: an obtaining module, configured to obtain a distribution attribute of all the data tables on the generated syntax tree; and a first determining module, configured to determine, according to the distribution attribute, whether all the data tables are distributed On the same database node, the first generation module is configured to generate a single node execution tree, where the result of the determination is that all the data tables are distributed on the same database node, and the execution tree only involves one database node.
  • the foregoing second generating unit further includes: a traversing module, configured to traverse the root node of the generated syntax tree from the generated root node of the syntax tree when the determination result is that all the data tables are distributed on the plurality of different database nodes a child node of the root node, if there is a child node of the child node of the root node, continuing to traverse the child nodes of the child nodes of the root node until each level of the child nodes is traversed; the second generation module is set to Based on the traversal results, an execution tree is generated that relates to intermediate states of the plurality of database nodes.
  • a traversing module configured to traverse the root node of the generated syntax tree from the generated root node of the syntax tree when the determination result is that all the data tables are distributed on the plurality of different database nodes a child node of the root node, if there is a child node of the child node of the root node, continuing to traverse the child nodes of the child nodes of the
  • the foregoing second generating unit further includes: a merging module, configured to, after generating an execution tree related to an intermediate state of the plurality of database nodes according to the traversal result, merge the layer by layer according to the generated execution tree of the intermediate state The child node of the execution tree and its parent node are merged until the root node of the execution tree; the third generation module is configured to generate an execution tree of the final state according to the merge result.
  • a merging module configured to, after generating an execution tree related to an intermediate state of the plurality of database nodes according to the traversal result, merge the layer by layer according to the generated execution tree of the intermediate state The child node of the execution tree and its parent node are merged until the root node of the execution tree
  • the third generation module is configured to generate an execution tree of the final state according to the merge result.
  • the execution unit includes: a lookup module configured to traverse the execution tree of the final state to find all leaf nodes without dependencies; and the first sending module is set to be found
  • the SQL statement corresponding to the leaf node is sent to the corresponding database execution in the one or more databases, and the execution result is returned; the second determining module is configured to determine, according to the returned execution result, whether it is necessary to correspond to the newly added leaf node.
  • the SQL statement is sent to the corresponding database execution in one or more of the above databases; and the second delivery module is configured to send the corresponding SQL statement to the one or more databases in the case that the determination result is yes. Database execution.
  • the technical solution of the present invention adopts a method of effectively decomposing a query statement and orderly executing the decomposed query statement, receiving a structured query SQL request for performing a database operation on one or more databases; generating a corresponding syntax according to the received SQL request Tree; traverses the various nodes of the generated syntax tree and generates an execution tree; performs database operations on one or more databases in accordance with the generated execution tree.
  • the technical problem that the related data query of the cross-database node is not supported in the related art is solved, and the technical effect of supporting the related data query across the database node is achieved.
  • FIG. 1 is a flow chart of a method of executing a database according to an embodiment of the present invention
  • FIG. 2 is a data flow diagram of a method for executing a distributed database according to an embodiment of the present invention
  • FIG. 3 is a model diagram of a distributed execution tree of a crown number system according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a distributed syntax tree according to an embodiment of the present invention.
  • FIG. 5 is a model diagram of a distributed execution tree according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an execution apparatus of a database according to an embodiment of the present invention.
  • a method of executing a database is provided. It should be noted that the steps shown in the flowchart of the drawing may be executed in a computer system such as a set of computer executable instructions, and although in the flowchart The logical order is shown, but in some cases the steps shown or described may be performed in an order different than that herein.
  • FIG. 1 is a flowchart of a method for executing a database according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
  • Step S102 receiving a structured query SQL request for performing a database operation on one or more databases
  • Step S104 Generate a corresponding syntax tree according to the received SQL request.
  • Step S106 traversing each node of the generated syntax tree, and generating an execution tree
  • Step S108 performing a database operation on one or more databases according to the generated execution tree.
  • the received SQL request may be a SQL request sent by a client or an external system.
  • the SQL statement included in the SQL request needs to be syntax checked, and the syntax tree is generated according to the semantics.
  • the core technology for implementing the associated data query across database nodes is to generate a distributed execution tree and execute the corresponding SQL statements in an orderly manner according to the generated execution tree. Therefore, in the execution process of the database, especially the distributed database, the effective decomposition is performed.
  • SQL statements in SQL requests (such as SQL query statements), as well as ordered execution of decomposed SQL statements (such as SQL query statements), are the key to implementing distributed databases.
  • the execution system of a distributed database disclosed herein mainly includes the following parts: DBPROXY, configured to receive from a client and/or an external system.
  • DBPROXY Distributed SQL request, and perform syntax check on the received SQL request, generate a syntax tree according to semantics, and then generate optimization based on syntax tree and data distribution characteristics
  • the database/database cluster is a database node that is actually stored and retrieved by the data to be queried, and may be various general non-distributed Database system. As shown in FIG.
  • DBPROXY generates a syntax tree after receiving distributed SQL requests from the client and/or the external system, and generates a distributed based on the syntax tree and the data distribution characteristics. Optimize the execution tree; DBPROXY will execute the tree execution node to organize the SQL request according to the execution order, and send it to the relevant database/database cluster for execution; DBPROXY processes the result returned by the database/database cluster, and after the data is summarized and processed, the tree root is executed. The execution result of the node is returned to the client/external system.
  • the embodiment of the present invention achieves the purpose of performing corresponding database operations on one or more databases in an orderly manner according to the generated execution tree, and solves the problem of performing data query on the distributed database, especially when querying related data across the database nodes. It is prone to data query conflicts, which leads to technical problems that do not support cross-database node association data query. It can not only support single-table same database node data query, single-table cross-database node data query, and multi-table association of the same database node.
  • Data retrieval query can also support multi-table cross-database node association data retrieval query, not only supports the complex association data query of the same layer JOIN/UNION of various distribution characteristics, but also supports the complexity of multi-level nested WHERE/FROM subquery. Associate data queries.
  • traversing each node of the generated syntax tree and generating an execution tree includes:
  • the maximum retrieval condition can be suppressed, ensuring that the data returned by the database node is the smallest, the child node set of the execution tree is the smallest, and the DBPROXY internal operation amount is the smallest.
  • the foregoing method further includes:
  • the SQL statement can be directly transmitted to the corresponding database node, and the database operations conflict with each other.
  • the method further includes:
  • the primary node (ie, the parent node) and its child nodes are merged layer by layer. Specifically, according to the distribution attribute and the where condition of the data table, it can be determined whether the primary node and its child nodes can be merged, and if possible, the primary and secondary nodes are merged into one execution node, and the execution tree is updated, and then, the layer is continued.
  • the master node (ie, the parent node) and its child nodes are merged up until they are merged into the top-level node of the execution tree, generating the final execution tree.
  • database operations are performed on one or more databases in accordance with the resulting final execution tree.
  • the maximum degree of merging of the execution node so that the execution node of the execution tree is the least, so that the SQL statement can be merged and delivered to the maximum extent, and the whole sentence can be sent when the whole sentence is delivered, and the whole sentence cannot be delivered. Issue a partial statement.
  • performing database operations on one or more databases in accordance with the generated execution tree includes:
  • the SQL statement corresponding to the found leaf node is sent to the corresponding database execution in one or more databases, and the execution result is returned;
  • the node to be executed is taken out from the list of nodes to be executed as the current execution node;
  • the SQL statement corresponding to the current execution node is sent to the relevant database node for execution, and the SQL statement of the child node is relied upon to directly utilize the result set of the child node;
  • the current execution node summarizes the execution result of the database node (such as the retrieval result);
  • the newly added executable node directly uses the return result set of its child node to complete the calculation, and recursively detects the next level of the newly executed executable node;
  • the new executable node needs to send the SQL statement to the relevant database node for execution, the new executable node is added to the list of nodes to be executed.
  • the execution nodes having no dependencies in the execution tree can be executed with the maximum degree of concurrency, and for the same execution node, the execution statements can be executed in parallel to the relevant database nodes for execution.
  • the department table DPT_TB is used to record the department ID and the department other information DETAIL
  • the device table DEV_TB is used to record the device ID and other device information DETAIL
  • the track table TRAC_TB is used to record the crown number track information TRAC_INFO and associated with the track Department DPT_ID, device DEV_ID, and operator OPT_ID
  • operator account table OPT_TB is used to record operator ID and operator other information DETAIL.
  • the above four tables are all distribution tables and are distributed among multiple database cluster nodes according to the distribution strategy. To query the trajectory details, you need to query the department table, device table, and account table information through the department ID, device ID, and transaction account number in the trajectory information.
  • the syntax tree and the optimized execution tree are generated.
  • the generated optimized execution tree will contain five execution nodes, wherein the four nodes correspond to the retrieval query of four tables, and the root node uses the result set of the four child nodes as the operand of the JOIN operation.
  • the department ID is used as the sorting field corresponding to the query of the department table
  • the device ID is used as the sorting field corresponding to the query of the device table
  • the account ID is used as the sorting field corresponding to the query of the account table
  • the department ID, device ID, The account ID is used as the sort field of the query corresponding to the track table to ensure the order of execution and improve the efficiency of the JOIN operation.
  • the WHERE condition appearing in SQL is split according to the table, and is directly sent to the responding database cluster node with the query statement of the four tables. Because the WHERE conditions are in effect, the root node only needs to do the merge operation.
  • J1 is triggered by the result set of S1, S2, S3, and S4 to perform a JOIN operation. After J1 is executed, the entire execution tree is executed and the execution result is returned.
  • J1 is triggered to perform a JOIN operation using the result sets of S12, S3, and S4.
  • J1 is executed, the entire execution tree is executed and the execution result is returned.
  • a table is a relationship table for recording the corresponding association relationship between the card number and the account number, wherein one card number can correspond to one or more account numbers; the other table is a schedule for recording the account details, Only account fields and details, no card number.
  • Both tables are distribution tables that are distributed across multiple database cluster nodes following a distribution strategy.
  • querying the account details of a certain card number it involves the associated data query of the two tables.
  • the syntax tree and the optimized execution tree are generated.
  • the generated optimized execution tree will contain two execution nodes, one of which retrieves the account that meets the criteria, and the other node retrieves the query details using the identified account.
  • DBPROXY performs the SQL operation, it completes the summary and filtering of the data, and finally returns the execution result.
  • the customer table is used to record the registration number, customer grade and other detailed information
  • the discount table is used to record the customer grade, the discount rate and other detailed information
  • the product table is used to record the product number, the product category number, the product name, Commodity unit price and other detailed information
  • the product category table is used to record the product category number and the product category name
  • the order summary table is used to record the order number, registration number and other detailed information
  • the order schedule is used to record the order number, item number and others.
  • the customer table, the discount table, the product table, the product category table, the order summary table, and the order schedule are all distribution tables, which are distributed among the plurality of database cluster nodes according to the distribution strategy.
  • the customer table and the discount table are related by the customer level; the product table and the product category table are associated by the product category number; the order summary table and the order schedule are associated by the order number, and the order summary table is associated with the customer by the registration number.
  • Customer orders relate to customer, discount, merchandise, merchandise, order, and order details.
  • the generated optimized execution tree will contain seven execution nodes, six of which correspond to the retrieval query of six tables. As a child node, the root node performs JOIN operations using the result set of six child nodes.
  • the associated field is used as a sorting field corresponding to the query of the six sub-tables, ensuring an orderly execution result and improving the efficiency of the JOIN operation.
  • the WHERE conditional customer number and the order number are sent to the corresponding database cluster node along with the query statement of the related table. Because the WHERE conditions are in effect, the root node only needs to do the merge operation. After DBPROXY performs the SQL operation, it completes the summary and filtering of the data, and finally returns the execution result.
  • the user table is used to record the user ID and other information of the user;
  • the Shanghai market transaction account table is used to record the shareholding details such as the account ID, the user ID, the securities ID and the number of available shares;
  • the deep market transaction account table is used for recording Shareholding details such as account ID, user ID, securities ID, and number of shares available.
  • All three tables are distribution tables that are distributed across multiple database cluster nodes following a distribution strategy. To query the user shareholding details, you need to query the Shanghai Stock Exchange Account Form and the Shenzhen Stock Exchange Account Form through the user ID association to form a UNION result and perform a JOIN operation with the user table.
  • the syntax tree and the optimized execution tree are generated.
  • the generated optimization execution tree will contain five execution nodes, three of which correspond to the retrieval query of three tables, the corresponding account of the Shanghai market transaction account table and the deep market transaction account table as the child nodes of the UNION attribute execution node, and the UNION attribute
  • the execution node and the user table corresponding node are the child nodes of the execution tree root node.
  • the UNION attribute node performs the UNION operation by using the execution result of the corresponding account of the Shanghai market transaction account table and the deep market transaction account table; the execution tree root node performs the JOIN operation by using the execution result of the UNION attribute node and the execution result of the user table.
  • the user ID is used as a sorting field corresponding to the query of the user table, the Shanghai market transaction account table, and the deep market transaction account table, and the UNION results are also sorted according to the user ID to ensure that the execution result is in order and the JOIN operation is improved. effectiveness.
  • the WHERE condition that appears in the SQL is split according to the table, and is directly sent to the responding database cluster node with the query statement of the three tables. Because the WHERE conditions are in effect, the root node only needs to do the merge operation. After DBPROXY performs the SQL operation, it completes the summary and filtering of the data, and finally returns the execution result.
  • a top-level node of a syntax tree for retrieving a query statement may be composed of a hierarchical relationship between LEX and a downward SELECT_LEX and a SELECT_LEX_UNIT, from top to bottom. Reflected as a master-slave relationship; from bottom to top, as a master relationship; from left to right, as a brother relationship (next, prev).
  • the SELECT_LEX node is connected by SELECT_LEX_UNIT; (2) the node constituting the master-slave relationship, and accessing the lower slave node through the slave pointer of the master node Accessing the master node by the master pointer from the node; (3) accessing each other through the next, prev, first, and last nodes; (4) the topmost SELECT node in the syntax tree is a unit object of type SELECT_LEX_UNIT; 5) SELECT_LEX_UNIT child node SELECT_LEX constitutes a UNION relationship; (6) SELECT_LEX child node SELECT_LEX_UNIT, or SELECT_LEX WHERE subquery, or SELECT FROM subquery.
  • FIG. 5 is a model diagram of a distributed execution tree, each of which executes a tree node, in accordance with an embodiment of the present invention.
  • Both are executable units with common attributes: cld_number, master_list, next, prev, master, slave, first, and last; dedicated attributes: the node performs operations, execution parameters, and execution results; maintained by next, prev, first, and last The same layer execution tree node relationship; the same layer execution tree head node points to the execution tree upper node through the master; each execution tree node points to the lower layer execution tree node through the slave; the cld_number indicates the number of child nodes that the node does not execute; through the master_list Points to the list of parent nodes for this node.
  • the execution tree has only one root node, and the execution result of the root node is the entire distributed retrieval result. Since the execution of the parent node depends on the execution of the child node, that is, the execution tree node where all the child nodes are zero, the execution operation is performed concurrently; when the execution tree node is executed, the cld_number of all the parent nodes in the master_list of the node is decremented by 1. The root node is executed and the result is returned.
  • the initial states 4-1, 4-2, 4-3, 2-2 are parallel executable nodes in the list of nodes that can be executed in parallel; when 4-1, 4-2, 4 3 After the execution is completed, the new 3-1 node will be added as a parallel executable node; when 3-1 is executed, the new nodes 2-1 and 2-3 will be added as parallel executable nodes; when 2-1, 2-2, After the execution of 2-3 is completed, the new node 1-1 is added as a parallel executable node; when the execution of 1-1 is completed, the entire execution tree is executed, and the execution result is returned.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods of various embodiments of the present invention.
  • a database execution device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
  • the term “module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the apparatus includes: a receiving unit 602 configured to receive a structured query SQL request for performing database operations on one or more databases.
  • a first generating unit 604 configured to generate a corresponding syntax tree according to the received SQL request;
  • a second generating unit 606, set each of the nodes of the generated syntax tree and generate an execution tree;
  • execute unit 608, set to Perform database operations on one or more databases in accordance with the generated execution tree.
  • the received SQL request may be a SQL request sent by the client or an external system.
  • the SQL statement included in the SQL request needs to be syntax checked, and the syntax tree is generated according to the semantics.
  • the core technology for implementing the associated data query across database nodes is to generate a distributed execution tree and execute the corresponding SQL statements in an orderly manner according to the generated execution tree. Therefore, in the execution process of the database, especially the distributed database, the effective decomposition is performed.
  • SQL statements in SQL requests (such as SQL query statements), as well as ordered execution of decomposed SQL statements (such as SQL query statements), are the key to implementing distributed databases.
  • the embodiment of the present invention achieves the purpose of performing corresponding database operations on one or more databases in an orderly manner according to the generated execution tree, and solves the problem of performing data query on the distributed database, especially when querying related data across the database nodes. It is prone to data query conflicts, which leads to technical problems that do not support cross-database node association data query. It can not only support single-table same database node data query, single-table cross-database node data query, and multi-table association of the same database node.
  • Data retrieval query can also support multi-table cross-database node association data retrieval query, not only supports the complex association data query of the same layer JOIN/UNION of various distribution characteristics, but also supports the complexity of multi-level nested WHERE/FROM subquery. Associate data queries.
  • the second generating unit includes: an acquiring module, configured to obtain a distribution attribute of all data tables on the generated syntax tree; and a first determining module, configured to determine, according to the distribution attribute, whether all data tables are distributed in the same database node
  • the first generation module is configured to generate a single node execution tree, where the result of the determination is that all the data tables are distributed on the same database node, the execution tree only involves one database node.
  • the maximum retrieval condition can be suppressed, ensuring that the data returned by the database node is the smallest, the child node set of the execution tree is the smallest, and the DBPROXY internal operation amount is the smallest.
  • the second generating unit further includes: a traversing module, configured to traverse the root node from the root node of the generated syntax tree, if the result of the determination is that all the data tables are distributed on the plurality of different database nodes a node, in the case that a child node of the root node has a child node, continues to traverse the child nodes of the child nodes of the root node until the traversal of each level of the child nodes; the second generation module is set to generate the An execution tree of intermediate states of multiple database nodes.
  • a traversing module configured to traverse the root node from the root node of the generated syntax tree, if the result of the determination is that all the data tables are distributed on the plurality of different database nodes a node, in the case that a child node of the root node has a child node, continues to traverse the child nodes of the child nodes of the root node until the traversal of each level of the child nodes; the second generation module is set to generate the An execution tree
  • the transparent transmission of the SQL statement to the corresponding database node can be avoided, and the database operations conflict with each other.
  • the second generating unit further includes: a merging module, configured to merge the execution layer by layer according to the execution tree of the generated intermediate state after generating an execution tree related to the intermediate state of the plurality of database nodes according to the traversal result The child node of the tree and its parent node are merged until the root node of the execution tree; the third generation module is set to generate an execution tree of the final state according to the merge result.
  • a merging module configured to merge the execution layer by layer according to the execution tree of the generated intermediate state after generating an execution tree related to the intermediate state of the plurality of database nodes according to the traversal result The child node of the tree and its parent node are merged until the root node of the execution tree; the third generation module is set to generate an execution tree of the final state according to the merge result.
  • the execution node when constructing the execution tree, the execution node can be merged to the greatest extent based on the whole sentence merge and the local sentence merge, so that the execution node of the execution tree is minimized, thereby maximizing the SQL statement merge.
  • the implementation of the whole sentence can be issued, the whole sentence is issued, and the whole sentence can not be issued when the whole sentence is issued.
  • the execution unit includes: a lookup module, configured to traverse the execution tree of the final state, and find all the leaf nodes that have no dependencies; the first sending module is configured to send the SQL statement corresponding to the found leaf node to The corresponding database in one or more databases is executed, and the execution result is returned; the second determining module is configured to determine whether the SQL statement corresponding to the newly added leaf node needs to be sent to one or more databases according to the returned execution result.
  • the corresponding database is executed; the second delivery module is configured to send the corresponding SQL statement to the corresponding database in one or more databases when the determination result is yes.
  • the device embodiment corresponds to the method embodiment, and the optional embodiment of the method embodiment part is also applicable to the optional implementation of the device part, and details are not described herein again.
  • each of the foregoing modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the storage medium is further configured to store program code for performing the steps of other embodiments in Embodiment 1, and details are not described herein again.
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the processor executes according to the stored program code in the storage medium:
  • the processor performs the corresponding steps according to the program code of the other embodiments in the storage medium that is stored in the storage medium, and details are not described herein again.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any particular hardware and software. Combine.
  • the technical solution disclosed herein receives a structured query SQL request for performing database operations on one or more databases by effectively decomposing query statements and orderly executing the decomposed query statements; generating corresponding corresponding according to the received SQL request A syntax tree; traverses the various nodes of the generated syntax tree and generates an execution tree; performs database operations on one or more databases in accordance with the generated execution tree.
  • the technical solution of the present invention solves the technical problem that the related data query of the cross-database node is not supported in the related art, and achieves the technical effect of supporting the related data query across the database node.

Abstract

一种数据库的执行方法及装置,该方法包括:接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求(S102);依据接收的SQL请求生成对应的语法树(S104);遍历生成的语法树的每一个节点,并生成执行树(S106);按照生成的执行树对一个或者多个数据库执行数据库操作(S108)。解决了相关技术中不支持跨数据库节点的关联数据查询的技术问题,进而达到了支持跨数据库节点的关联数据查询的技术效果。

Description

数据库的执行方法及装置 技术领域
本文涉及通信领域,具体而言,涉及一种数据库的执行方法及装置。
背景技术
随着数据量不断膨胀,单机数据库越来越不能满足用户对大存储和高性能数据库的需求,由此,分布式数据库的应用逐渐广泛起来。
目前,主流分布式数据库基本上都是按照数据关联性对数据分类,并结合适当的数据冗余,将关联数据集中到一个数据库节点上,将数据库执行语句(如数据库检索查询语句等)下发到关联数据所在的数据库节点上执行。
例如,A,B,C三类数据,其中A和B没有关联性,A和C有关联性,B和C有关联性。在相关技术中对数据库设计部署时,会将A和C集中到数据库节点DB-1上;而将B和C集中到另一个数据库节点DB-2上;C数据在两个数据库节点DB-1和DB-2上保持一致。针对A和C的关联数据,会将数据库执行语句(如数据库检索查询语句等)下发到DB-1上执行;针对B和C的关联数据,会将数据库执行语句(如数据库检索查询语句等)下发到DB-2上执行。基于此,会出现跨数据库节点的关联数据。
具体的,出现跨数据库节点的关联数据的原因主要有两类:
(1)、刚开始设计部署数据库时,会将关联数据分布在同一数据库节点上,但是随着应用的扩展,逐渐打破关联数据分布在同一数据库节点上的限制。
延续上例,比如新增与A、B发生关联的D类数据,在不允许重新设计部署数据库的前提下,就会导致原本不在同一数据库节点上的A和B在与D成为关联数据后,必然引申出跨数据库节点的关联数据。
(2)、基于分布式设计,按照各种分发策略将数据分布到不同的DB节点上,比如A数据通过分发键HASH分布到DB-1、DB-2和DB-3,B数据通过分发键RANGE分布到DB-2、DB-3和DB-4,在查询关联数据A和B时,也必 然导致跨数据库节点的关联数据查询。
现有的分布式数据库执行方案中,对于单表同一数据库节点的数据查询、单表跨数据库节点的数据查询、多表同一数据库节点的关联数据查询都有比较好的支持,但是对于多表跨数据库节点的关联数据查询,还没有相应的解决方案。
发明内容
以下是对本文详细描述的主题的概述,本概述并非是为了限制权利要求的保护范围。
本文公开了一种数据库的执行方法及装置,以至少解决相关技术中不支持跨数据库节点的关联数据查询的技术问题。
一种数据库的执行方法,包括:接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;依据接收的上述SQL请求生成对应的语法树;遍历生成的上述语法树的每一个节点,并生成执行树;按照生成的上述执行树对上述一个或者多个数据库执行数据库操作。
可选地,遍历生成的上述语法树的每一个节点,并生成执行树包括:获取生成的上述语法树上的所有数据表的分布属性;依据上述分布属性判断上述所有数据表是否分布在同一个数据库节点上;在判断结果为上述所有数据表分布在同一个数据库节点上的情况下,生成单节点执行树,该执行树仅涉及一个数据库节点。
可选地地,上述的方法还包括,在判断结果为上述所有数据表分布在多个不同数据库节点上的情况下,从生成的上述语法树的根节点开始,遍历上述根节点的子节点;在上述根节点的子节点存在子节点的情况下,继续遍历上述根节点的子节点的子节点,直到将每一级子节点遍历完为止;依据遍历结果,生成涉及多个数据库节点的中间状态的执行树。
可选地,在依据遍历结果,生成涉及多个数据库节点的中间状态的执行树之后,上述方法还包括:按照生成的上述中间状态的执行树,逐层向上合并该执行树的子节点与其父节点,直到合并到该执行树的根节点为止;依据合并结果,生成最终状态的执行树。
可选地,按照生成的上述执行树对上述一个或者多个数据库执行数据库操作包括:遍历上述最终状态的执行树,查找所有没有依赖关系的叶节点;将查找到的上述叶节点对应的SQL语句下发到上述一个或者多个数据库中对应的数据库执行,并返回执行结果;依据返回的执行结果判断是否需要将与新增叶节点对应的SQL语句下发到上述一个或者多个数据库中对应的数据库执行;在判断结果为是的情况下,将对应的SQL语句下发到上述一个或者多个数据库中对应的数据库执行。
本文还公开了一种数据库的执行装置,包括:接收单元,设置为接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;第一生成单元,设置为依据接收的上述SQL请求生成对应的语法树;第二生成单元,设置为遍历生成的上述语法树的每一个节点,并生成执行树;执行单元,设置为按照生成的上述执行树对上述一个或者多个数据库执行数据库操作。
可选地,上述第二生成单元包括:获取模块,设置为获取生成的上述语法树上的所有数据表的分布属性;第一判断模块,设置为依据上述分布属性判断上述所有数据表是否分布在同一个数据库节点上;第一生成模块,设置为在判断结果为上述所有数据表分布在同一个数据库节点上的情况下,生成单节点执行树,该执行树仅涉及一个数据库节点。
可选地,上述第二生成单元还包括:遍历模块,设置为在判断结果为上述所有数据表分布在多个不同数据库节点上的情况下,从生成的上述语法树的根节点开始,遍历上述根节点的子节点,在上述根节点的子节点存在子节点的情况下,继续遍历上述根节点的子节点的子节点,直到将每一级子节点遍历完为止;第二生成模块,设置为依据遍历结果,生成涉及多个数据库节点的中间状态的执行树。
可选地,上述第二生成单元还包括:合并模块,设置为在依据遍历结果,生成涉及多个数据库节点的中间状态的执行树之后,按照生成的上述中间状态的执行树,逐层向上合并该执行树的子节点与其父节点,直到合并到该执行树的根节点为止;第三生成模块,设置为依据合并结果,生成最终状态的执行树。
可选地,上述执行单元包括:查找模块,设置为遍历上述最终状态的执行树,查找所有没有依赖关系的叶节点;第一下发模块,设置为将查找到的 上述叶节点对应的SQL语句下发到上述一个或者多个数据库中对应的数据库执行,并返回执行结果;第二判断模块,设置为依据返回的执行结果判断是否需要将与新增叶节点对应的SQL语句下发到上述一个或者多个数据库中对应的数据库执行;第二下发模块,设置为在判断结果为是的情况下,将对应的SQL语句下发到上述一个或者多个数据库中对应的数据库执行。
本发明的技术方案采用有效分解查询语句以及有序执行分解后的查询语句的方式,接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;依据接收的SQL请求生成对应的语法树;遍历生成的语法树的各个节点,并生成执行树;按照生成的执行树对一个或者多个数据库执行数据库操作。解决了相关技术中不支持跨数据库节点的关联数据查询的技术问题,达到了支持跨数据库节点的关联数据查询的技术效果。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的数据库的执行方法的流程图;
图2是根据本发明实施例的分布式数据库的执行方法的数据流图;
图3是根据本发明实施例的冠字号系统的分布式执行树的模型图;
图4是根据本发明实施例的分布式语法树的结构示意图;
图5是根据本发明实施例的分布式执行树的模型图;
图6是根据本发明实施例的数据库的执行装置的示意图。
本发明的较佳实施方式
下文中将参考附图并结合实施例来详细说明本发明实施例的技术方案。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可 以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
实施例1
在本实施例中提供了一种数据库的执行方法,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
在本实施例中提供了一种数据库的执行方法,图1是根据本发明实施例的数据库的执行方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;
步骤S104,依据接收的SQL请求生成对应的语法树;
步骤S106,遍历生成的语法树的每一个个节点,并生成执行树;
步骤S108,按照生成的执行树对一个或者多个数据库执行数据库操作。
其中,所接收的SQL请求,可以是客户端或者外部系统发送的SQL请求。在生成语法树的过程中,需要对SQL请求所包含的SQL语句进行语法检查,并按照语义生成语法树。
由于实现跨数据库节点的关联数据查询的核心技术是生成分布式执行树,以及按照生成的执行树有序执行对应的SQL语句,因此,在数据库尤其是分布式数据库的执行过程中,通过有效分解SQL请求中的SQL语句(如SQL查询语句),以及有序执行分解后的SQL语句(如SQL查询语句),是实现执行分布式数据库的关键。
图2是根据本发明实施例的分布式数据库的执行方法的数据流图,本文公开的一种分布式数据库的执行系统主要包括以下几部分:DBPROXY,设置为接收来自客户端和/或外部系统的分布式SQL请求,并对接收的SQL请求进行语法检查,按照语义生成语法树,进而基于语法树和数据分布特性生成优化 执行树,进而调度并执行该执行树的各个执行节点,最后返回执行树的根节点的执行结果;数据库/数据库集群,是待查询数据实际存放、检索的数据库节点,可以是各种通用非分布式数据库系统。如图2所示,分布式数据库的执行方法的处理流程如下:DBPROXY接收来自客户端和/或外部系统的分布式SQL请求后,生成语法树,并基于该语法树和数据分布特性生成分布式优化执行树;DBPROXY将执行树可执行节点依执行顺序组织SQL请求,并下发到相关数据库/数据库集群执行;DBPROXY处理数据库/数据库集群返回的结果,完成数据汇总和处理后,将执行树根节点的执行结果返回给客户端/外部系统。
通过本发明实施例,实现了按照生成的执行树有序地对一个或者多个数据库执行对应的数据库操作的目的,解决了对分布式数据库进行数据查询,尤其是跨数据库节点进行关联数据查询时,容易出现数据查询冲突,进而导致不支持跨数据库节点的关联数据查询的技术问题,不仅可以支持单表同一数据库节点数据查询、单表跨数据库节点的数据查询、以及多表同一数据库节点的关联数据检索查询,而且还可以支持多表跨数据库节点的关联数据检索查询,不仅支持各种分布特性的同层JOIN/UNION的复杂关联数据查询,也支持多层嵌套WHERE/FROM子查询的复杂关联数据查询。
可选地,遍历生成的语法树的每一个节点,并生成执行树包括:
S2,获取生成的语法树上的所有数据表的分布属性;
S4,依据分布属性判断所有数据表是否分布在同一个数据库节点上;
S6,在判断结果为所有数据表分布在同一个数据库节点上的情况下,生成单节点执行树,该执行树仅涉及一个数据库节点。
也即,从生成的语法树上取出其上的所有数据表,分析这些数据表中的数据分布属性,如果所有数据表中的数据都在分布在同一个数据库节点上,则生成只涉及一个数据库节点的执行树,此时,可以直接将SQL请求对应的SQL语句透传到数据库节点处。该数据库节点得到的SQL语句执行对应的数据库操作。
通过本发明实施例,可以实现最大检索条件下压,确保数据库节点返回的数据最小、执行树的子节点集最小、以及DBPROXY内部操作量最小。
可选地,上述方法还包括:
S8,在判断结果为所有数据表分布在多个不同数据库节点上的情况下,从生成的语法树的根节点开始,遍历根节点的子节点;
S10,在根节点的子节点存在子节点的情况下,继续遍历根节点的子节点的子节点,直到将每一级子节点遍历完为止;
S12,依据遍历结果,生成涉及多个数据库节点的中间状态的执行树。
由于在所有数据表分布在多个不同数据库节点上的情况下,对数据库操作时,需要跨数据库操作,此时,需要从语法树的顶层节点开始,遍历其子节点,为其子节点生成相应的执行树,如果其子节点也有自己的子节点,则需要进一步遍历这些子节点的子节点,并生成相应的执行树,这样一直递归下去,最后生成中间状态的执行树。之后,按照生成的中间状态的执行树对一个或者多个数据库执行数据库操作。
通过本发明实施例,可以避免直接将SQL语句透传到相应的数据库节点,而导致数据库操作相互冲突。
可选地,在依据遍历结果,生成涉及多个数据库节点的中间状态的执行树之后,上述方法还包括:
S14,按照生成的中间状态的执行树,逐层向上合并该执行树的子节点与其父节点,直到合并到该执行树的根节点为止;
S16,依据合并结果,生成最终状态的执行树。
由于执行树的某些父节点的执行并不依赖于其子节点的执行结果,此时,可以将这些父节点与其对应的子节点进行合并处理。
实施时,在生成中间状态的执行树之后,开始将主节点(即父节点)与其子节点逐层向上合并。具体地,可以根据数据表的分布属性和where条件,判断主节点和其子节点是否可以合并,若可以,则将主、子节点合并为一个执行节点,并更新执行树,之后,继续逐层向上合并主节点(即父节点)与其子节点,直到合并到执行树的顶层节点为止,生成最终的执行树。在生成最终的执行树后,按照生成的最终的执行树对一个或者多个数据库执行数据库操作。
通过本发明实施例,在构造执行树时,可以基于整句合并性和局部语句 合并性,最大程度的合并执行节点,使得执行树的执行节点最少,从而最大程度的将SQL语句合并下发,实现能整句下发则整句下发,不能整句下发则最大程度的下发局部语句。
可选地,按照生成的执行树对一个或者多个数据库执行数据库操作包括:
S18,遍历最终状态的执行树,查找所有没有依赖关系的叶节点;
S20,将查找到的叶节点对应的SQL语句下发到一个或者多个数据库中对应的数据库执行,并返回执行结果;
S22,依据返回的执行结果判断是否需要将与新增叶节点对应的SQL语句下发到一个或者多个数据库中对应的数据库执行;
S24,在判断结果为是的情况下,将对应的SQL语句下发到一个或者多个数据库中对应的数据库执行。
实施时,可以按照以下流程执行:
a)按照深度优先原则,遍历执行树,查找没有依赖关系的执行树叶节点,添并将其添加到初始待执行节点列表中;
b)对待执行节点列表以节点为单位,并发执行如下操作:
i.按照先进先出原则,从待执行节点列表中取出待执行节点作为当前执行节点;
ii.将当前执行节点对应的SQL语句下发到相关数据库节点执行,依赖子节点的SQL语句,直接利用子节点的结果集;
iii.将数据库节点返回结果存入当前执行节点;
iv.数据库节点的返回结果全部返回后,由当前执行节点汇总数据库节点的执行结果(如检索结果);
v.检测当前新增可执行节点;
vi.如果新增可执行节点不需要下发SQL语句到相关数据库节点执行,则新增可执行节点直接利用其子节点的返回结果集完成计算,并递归检测下一级新增可执行节点;
vii.如果新增可执行节点需要下发SQL语句到相关数据库节点执行,则将新增可执行节点加入到待执行节点列表。
在执行树上的执行节点全部执行完毕后,返回执行结果。
通过本发明实施例,可以将执行树中没有依赖关系的执行节点以最大并发度执行,并且对于同一执行节点,可以并行下发执行语句到相关的数据库节点中执行。
以下以几个具体实施例为例,详细阐述本发明:
(一)分布式集群数据库的冠字号系统
在该系统中,部门表DPT_TB用于记录部门ID和部门其它信息DETAIL;设备表DEV_TB用于记录设备ID和设备其它信息DETAIL;轨迹表TRAC_TB用于记录冠字号轨迹信息TRAC_INFO以及和该轨迹关联的部门DPT_ID、设备DEV_ID和操作员OPT_ID;操作员账号表OPT_TB用于记录操作员ID和操作员其它信息DETAIL。上述四张表都是分布表,遵循分发策略而分布在多个数据库集群节点中。查询轨迹详细信息需要通过轨迹信息中部门ID、设备ID及交易账号关联查询部门表、设备表和账号表的其它信息。
其中,在本方案的实现细节中,SQL请求传递给DBPROXY后,生成语法树和优化执行树。所生成的优化执行树将包含五个执行节点,其中,四个节点对应四个表的检索查询,作为子节点,根节点利用四个子节点的结果集作为JOIN操作的操作数。本方案的实施细节中,将部门ID作为部门表对应查询的排序字段,将设备ID作为设备表对应查询的排序字段,将账号ID作为账号表对应查询的排序字段,将部门ID、设备ID、账号ID作为轨迹表对应查询的排序字段,确保执行结果有序,提高JOIN操作的效率。在本方案实施细节中,SQL中出现的WHERE条件根据表进行拆分,直接随四张表的查询语句下发到响应的数据库集群节点。因为WHERE条件都已生效,根节点只需要做归并操作。DBPROXY执行完SQL操作后,完成数据的汇总和筛选,最后返回执行结果。本方案生成的语法树和执行树如图3所示,其中,(1)语法树为lex->unit->select_lex,只有一个select_lex节点,该节点存放SQL语句二进制信息;(2)执行树所涉及的关联查询表都是分布表,但分布策略不一样,语句不能合并下发到数据库节点上执行,生成图示执行树,其中,J1: Join属性执行节点,作为执行树根节点,其子节点为S1、S2、S3和S4;S1:需要下发SQL语句到数据库节点的执行节点,其父节点为J1;S2:需要下发SQL语句到数据库节点的执行节点,其父节点为J1;S4:需要下发SQL语句到数据库节点的执行节点,其父节点为J1;S4:需要下发SQL语句到数据库节点的执行节点,其父节点为J1;(3)执行树执行:初始时,S1、S2、S3和S4没有子节点,可以并行执行,其中:
S1:下发语句
Figure PCTCN2016081892-appb-000001
需要说明的是,条件尽量下压在此处体现为where条件和为了join而增加的order by。
S2:下发语句
Figure PCTCN2016081892-appb-000002
需要说明的是,条件尽量下压在本处体现为因join而增加的order by。
S3:下发语句
Figure PCTCN2016081892-appb-000003
需要说明的是,条件尽量下压在本处体现为因join而增加的order by。
S4:下发语句
Figure PCTCN2016081892-appb-000004
需要说明的是,条件尽量下压在本处体现为因join而增加的order by。
S1、S2、S3和S4执行完后,触发J1利用S1、S2、S3、S4的结果集进行汇总JOIN操作,J1执行完后,整个执行树执行完毕,返回执行结果。
可选地,本实施例中,如果S1和S2节点可以合并为S12,而其它节点不可以合并。所生成的执行树,S12、S3和S4没有子节点,可以并行执行,其中:
S12:下发语句
Figure PCTCN2016081892-appb-000005
Figure PCTCN2016081892-appb-000006
需要说明的是,条件尽量下压在此处体现为where条件和为了join而增加的order by。
S3:下发语句
Figure PCTCN2016081892-appb-000007
需要说明的是,条件尽量下压在本处体现为因join而增加的order by。
S4:下发语句
Figure PCTCN2016081892-appb-000008
需要说明的是,条件尽量下压在本处体现为因join而增加的order by。
S12、S3和S4执行完后,触发J1利用S12、S3和S4的结果集进行汇总JOIN操作,J1执行完后,整个执行树执行完毕,返回执行结果。
(二)分布式集群数据库的信用卡中心系统
在该系统中,一个表是关系表,用于记录卡号与帐号的对应关联关系,其中,一个卡号可以对应多一个或者多个帐号;另一个表是明细表,用于记录帐号的明细,里面只有帐号字段和明细,没有卡号。两表都是分布表,遵循分发策略而分布在多个数据库集群节点。查询某一卡号的账户明细时,涉及到两表的关联数据查询。在本方案的实现细节中,SQL请求传递给DBPROXY后,生成语法树和优化执行树。所生成的优化执行树将包含两个执行节点,其中一个节点检索查询符合条件的账号,另一个节点利用所查出的账号检索查询明细。DBPROXY执行完SQL操作后,完成数据的汇总和筛选,最后返回执行结果。
(三)分布式集群数据库的电子商城系统
在该系统中,客户表用于记录注册号、客户等级及其它明细信息;优惠表用于记录客户等级、优惠率及其它明细信息;商品表用于记录商品编号、商品类别编号、商品名称、商品单价及其它明细信息;商品类别表用于记录商品类别编号及商品类别名称;订单总表用于记录订单编号、注册号及其它明细信息;订单明细表用于记录订单编号、商品编号及其它明细信息。客户表、优惠表、商品表、商品类别表、订单总表及订单明细表都是分布表,遵循分布策略而分布在多个数据库集群节点中。客户表和优惠表通过客户等级发生关联;商品表和商品类别表通过商品类别编号发生关联;订单总表和订单明细表通过订单编号发生关联,订单总表通过注册号和客户发生关联。客户订单涉及客户表、优惠表、商品表、商品类别表、订单总表及订单明细表的关联查询。在本方案的实现细节中,订单输出的SQL请求传递给DBPROXY后,生成语法树和优化执行树。所生成的优化执行树将包含七个执行节点,其中六个节点对应六张表的检索查询,作为子节点,根节点利用六个子节点的结果集进行JOIN操作。本方案的实施细节中,关联字段作为六张子表对应查询的排序字段,确保执行结果有序,提高JOIN操作的效率。在本方案实施细节中,SQL语句中,WHERE条件客户编号和订单编号随相关表的查询语句下发到相应的数据库集群节点。因为WHERE条件都已生效,根节点只需要做归并操作。DBPROXY执行完SQL操作后,完成数据的汇总和筛选,最后返回执行结果。
(四)分布式集群数据库的在线股票交易系统
在该系统中,用户表用于记录用户ID和用户其它信息;沪市交易账号表用于记录账户ID、用户ID、证券ID和可用股数等持股明细;深市交易账号表用于记录账户ID、用户ID、证券ID和可用股数等持股明细。三张表都是分布表,遵循分发策略而分布在多个数据库集群节点中。查询用户持股明细需要通过用户ID关联查询沪市交易账号表、深市交易账号表,形成UNION结果后和用户表进行JOIN操作。在本方案的实现细节中,SQL请求传递给DBPROXY后,生成语法树和优化执行树。所生成的优化执行树将包含五个执行节点,其中三个节点对应三个表的检索查询,沪市交易账号表、深市交易账号表对应节点作为UNION属性执行节点的子节点,UNION属性的执行节点又和用户表对应节点作为执行树根节点的子节点。UNION属性节点利用沪市交易账号表和深市交易账号表对应节点的执行结果进行UNION操作;执行树根节点利用UNION属性节点的执行结果和用户表的执行结果进行JOIN操作。本方案的实施细节中,将用户ID作为用户表、沪市交易账号表和深市交易账号表对应查询的排序字段,UNION结果也按照用户ID进行排序,确保执行结果有序,提高JOIN操作的效率。在本方案实施细节中,SQL中出现的WHERE条件根据表进行拆分,直接随三张表的查询语句下发到响应的数据库集群节点。因为WHERE条件都已生效,根节点只需要做归并操作。DBPROXY执行完SQL操作后,完成数据的汇总和筛选,最后返回执行结果。
图4是根据本发明实施例的分布式语法树的结构示意图,如图4所示,检索查询语句的语法树顶级节点可以为LEX及向下的SELECT_LEX和SELECT_LEX_UNIT按层次关系组成,从上到下体现为主从关系(slave);从下到上体现为从主关系(master);从左到右,体现为兄弟关系(next,prev)。特别地,(1)上下两个SELECT_LEX之间如果是主从关系,主从关系SELECT_LEX节点之间通过SELECT_LEX_UNIT进行连接;(2)构成主从关系的节点,通过主节点的slave指针访问下层从节点,通过从节点的master指针访问主节点;(3)同一层次的节点之间通过next、prev、first和last实现相互访问;(4)语法树中最顶层SELECT节点是SELECT_LEX_UNIT类型的unit对象;(5)SELECT_LEX_UNIT的子节点SELECT_LEX之间构成UNION关系;(6)SELECT_LEX的子节点SELECT_LEX_UNIT,或者是SELECT_LEX的WHERE子查询,或者是SELECT的FROM子查询。
图5是根据本发明实施例的分布式执行树的模型图,每一个执行树节点 都是一个可执行单位,具有公共属性:cld_number、master_list、next、prev、master、slave、first和last;专用属性:该节点执行操作、执行参数及执行结果;通过next、prev、first和last维护同层执行树节的关系;同层执行树首节点通过master指向执行树上层节点;每一个执行树节点通过slave指向下层执行树首节点;通过cld_number表示该节点未执行的子节点数;通过master_list指向该节点的父节点列表。执行树只有一个根节点,根节点的执行结果,就是整个分布式检索结果。由于父节点的执行依赖于子节点的执行,也就是说,此处所有子节点数为零的执行树节点,并发执行操作;执行树节点执行完毕,该节点master_list中所有父节点的cld_number减1;根节点执行完毕,结果返回。执行树节点有两类:需要下发SQL语句到数据库节点执行的执行树节点;dbproxy基于子节点执行结果进行汇总处理的节点。
如图5所示,此处,初始状态4-1、4-2、4-3、2-2作为可并行执行节点列表中的可并行执行节点;当4-1、4-2、4-3执行完毕,将新增3-1节点作为可并行执行节点;当3-1执行完毕,将新增节点2-1、2-3作为可并行执行节点;当2-1、2-2、2-3执行完毕,将新增节点1-1作为可并行执行节点;当1-1执行完毕,整个执行树执行完毕,返回执行结果。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。
实施例2
在本实施例中还提供了一种数据库的执行装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图6是根据本发明实施例的数据库的执行装置的示意图,如图6所示,该装置包括:接收单元602,设置为接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;第一生成单元604,设置为依据接收的SQL请求生成对应的语法树;第二生成单元606,设置我遍历生成的语法树的每一个个节点,并生成执行树;执行单元608,设置为按照生成的执行树对一个或者多个数据库执行数据库操作。
其中,所接收SQL请求,可以客户端或者外部系统发送的SQL请求。在生成语法树的过程中,需要对SQL请求所包含的SQL语句进行语法检查,并按照语义生成语法树。
由于实现跨数据库节点的关联数据查询的核心技术是生成分布式执行树,以及按照生成的执行树有序执行对应的SQL语句,因此,在数据库尤其是分布式数据库的执行过程中,通过有效分解SQL请求中的SQL语句(如SQL查询语句),以及有序执行分解后的SQL语句(如SQL查询语句),是实现执行分布式数据库的关键。
通过本发明实施例,实现了按照生成的执行树有序地对一个或者多个数据库执行对应的数据库操作的目的,解决了对分布式数据库进行数据查询,尤其是跨数据库节点进行关联数据查询时,容易出现数据查询冲突,进而导致不支持跨数据库节点的关联数据查询的技术问题,不仅可以支持单表同一数据库节点数据查询、单表跨数据库节点的数据查询、以及多表同一数据库节点的关联数据检索查询,而且还可以支持多表跨数据库节点的关联数据检索查询,不仅支持各种分布特性的同层JOIN/UNION的复杂关联数据查询,也支持多层嵌套WHERE/FROM子查询的复杂关联数据查询。
可选地,第二生成单元包括:获取模块,设置为获取生成的语法树上的所有数据表的分布属性;第一判断模块,设置为依据分布属性判断所有数据表是否分布在同一个数据库节点上;第一生成模块,设置为在判断结果为所有数据表分布在同一个数据库节点上的情况下,生成单节点执行树,该执行树仅涉及一个数据库节点。
通过本发明实施例,可以实现最大检索条件下压,确保数据库节点返回的数据最小、执行树的子节点集最小、以及DBPROXY内部操作量最小。
可选地,第二生成单元还包括:遍历模块,设置为在判断结果为所有数据表分布在多个不同数据库节点上的情况下,从生成的语法树的根节点开始,遍历根节点的子节点,在根节点的子节点存在子节点的情况下,继续遍历根节点的子节点的子节点,直到将每一级子节点遍历完为止;第二生成模块,设置为依据遍历结果,生成涉及多个数据库节点的中间状态的执行树。
通过本发明实施例的技术方案,可以避免直接将SQL语句透传到相应的数据库节点,而导致数据库操作相互冲突。
可选地,第二生成单元还包括:合并模块,设置为在依据遍历结果,生成涉及多个数据库节点的中间状态的执行树之后,按照生成的中间状态的执行树,逐层向上合并该执行树的子节点与其父节点,直到合并到该执行树的根节点为止;第三生成模块,设置为依据合并结果,生成最终状态的执行树。
通过本发明实施例的技术方案,在构造执行树时,可以基于整句合并性和局部语句合并性,最大程度的合并执行节点,使得执行树的执行节点最少,从而最大程度的将SQL语句合并下发,实现能整句下发则整句下发,不能整句下发则最大程度的下发局部语句。
可选地,执行单元包括:查找模块,设置为遍历最终状态的执行树,查找所有没有依赖关系的叶节点;第一下发模块,设置为将查找到的叶节点对应的SQL语句下发到一个或者多个数据库中对应的数据库执行,并返回执行结果;第二判断模块,设置为依据返回的执行结果判断是否需要将与新增叶节点对应的SQL语句下发到一个或者多个数据库中对应的数据库执行;第二下发模块,设置为在判断结果为是的情况下,将对应的SQL语句下发到一个或者多个数据库中对应的数据库执行。
需要说明的是,装置实施例与方法实施例相对应,方法实施例部分的可选实施方式也适应于装置部分的可选实施方式,在此不再赘述。
需要说明的是,上述每一个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:
S26,接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;
S28,依据接收的SQL请求生成对应的语法树;
S30,遍历生成的语法树的每一个个节点,并生成执行树;
S32,按照生成的执行树对一个或者多个数据库执行数据库操作。
可选地,存储介质还被设置为存储用于执行实施例1中其他实施方式的步骤的程序代码,在此不再一一赘述。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行:
S26,接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;
S28,依据接收的SQL请求生成对应的语法树;
S30,遍历生成的语法树的每一个节点,并生成执行树;
S32,按照生成的执行树对一个或者多个数据库执行数据库操作。
可选地,在本实施例中,处理器根据存储介质中已存储的实施例1中其他实施方式的程序代码执相应的步骤,在此不再一一赘述。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件 结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。
工业实用性
本文公开的技术方案,采用有效分解查询语句以及有序执行分解后的查询语句的方式,接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;依据接收的SQL请求生成对应的语法树;遍历生成的语法树的各个节点,并生成执行树;按照生成的执行树对一个或者多个数据库执行数据库操作。本发明的技术方案,解决了相关技术中不支持跨数据库节点的关联数据查询的技术问题,达到了支持跨数据库节点的关联数据查询的技术效果。

Claims (10)

  1. 一种数据库的执行方法,包括:
    接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;
    依据接收的所述SQL请求生成对应的语法树;
    遍历生成的所述语法树的每一个节点,并生成执行树;
    按照生成的所述执行树对所述一个或者多个数据库执行数据库操作。
  2. 根据权利要求1所述的方法,其中,遍历生成的所述语法树的每一个节点,并生成执行树包括:
    获取生成的所述语法树上的所有数据表的分布属性;
    依据所述分布属性判断所述所有数据表是否分布在同一个数据库节点上;
    在判断结果为所述所有数据表分布在同一个数据库节点上的情况下,生成单节点执行树,该执行树仅涉及一个数据库节点。
  3. 根据权利要求2所述的方法,还包括,
    在判断结果为所述所有数据表分布在多个不同数据库节点上的情况下,从生成的所述语法树的根节点开始,遍历所述根节点的子节点;
    在所述根节点的子节点存在子节点的情况下,继续遍历所述根节点的子节点的子节点,直到将每一级子节点遍历完为止;
    依据遍历结果,生成涉及多个数据库节点的中间状态的执行树。
  4. 根据权利要求3所述的方法,其中,在依据遍历结果,生成涉及多个数据库节点的中间状态的执行树之后,所述方法还包括:
    按照生成的所述中间状态的执行树,逐层向上合并该执行树的子节点与其父节点,直到合并到该执行树的根节点为止;
    依据合并结果,生成最终状态的执行树。
  5. 根据权利要求4所述的方法,其中,按照生成的所述执行树对所述一个或者多个数据库执行数据库操作包括:
    遍历所述最终状态的执行树,查找所有没有依赖关系的叶节点;
    将查找到的所述叶节点对应的SQL语句下发到所述一个或者多个数据库中对应的数据库执行,并返回执行结果;
    依据返回的执行结果判断是否需要将与新增叶节点对应的SQL语句下发到所述一个或者多个数据库中对应的数据库执行;
    在判断结果为是的情况下,将对应的SQL语句下发到所述一个或者多个数据库中对应的数据库执行。
  6. 一种数据库的执行装置,包括:
    接收单元,设置为接收用于对一个或者多个数据库执行数据库操作的结构化查询SQL请求;
    第一生成单元,设置为依据接收的所述SQL请求生成对应的语法树;
    第二生成单元,设置为遍历生成的所述语法树的每一个节点,并生成执行树;
    执行单元,设置为按照生成的所述执行树对所述一个或者多个数据库执行数据库操作。
  7. 根据权利要求6所述的装置,其中,所述第二生成单元包括:
    获取模块,设置为获取生成的所述语法树上的所有数据表的分布属性;
    第一判断模块,设置为依据所述分布属性判断所述所有数据表是否分布在同一个数据库节点上;
    第一生成模块,设置为在判断结果为所述所有数据表分布在同一个数据库节点上的情况下,生成单节点执行树,该执行树仅涉及一个数据库节点。
  8. 根据权利要求7所述的装置,其中,所述第二生成单元还包括:
    遍历模块,设置为在判断结果为所述所有数据表分布在多个不同数据库节点上的情况下,从生成的所述语法树的根节点开始,遍历所述根节点的子节点,在所述根节点的子节点存在子节点的情况下,继续遍历所述根节点的子节点的子节点,直到将每一级子节点遍历完为止;
    第二生成模块,设置为依据遍历结果,生成涉及多个数据库节点的中间状态的执行树。
  9. 根据权利要求8所述的装置,其中,所述第二生成单元还包括:
    合并模块,设置为在依据遍历结果,生成涉及多个数据库节点的中间状态的执行树之后,按照生成的所述中间状态的执行树,逐层向上合并该执行树的子节点与其父节点,直到合并到该执行树的根节点为止;
    第三生成模块,设置为依据合并结果,生成最终状态的执行树。
  10. 根据权利要求9所述的装置,其中,所述执行单元包括:
    查找模块,设置为遍历所述最终状态的执行树,查找所有没有依赖关系的叶节点;
    第一下发模块,设置为将查找到的所述叶节点对应的SQL语句下发到所述一个或者多个数据库中对应的数据库执行,并返回执行结果;
    第二判断模块,设置为依据返回的执行结果判断是否需要将与新增叶节点对应的SQL语句下发到所述一个或者多个数据库中对应的数据库执行;
    第二下发模块,设置为在所述第二判断模块的判断结果为是的情况下,将对应的SQL语句下发到所述一个或者多个数据库中对应的数据库执行。
PCT/CN2016/081892 2015-09-23 2016-05-12 数据库的执行方法及装置 WO2017049913A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510612206.4A CN106547796B (zh) 2015-09-23 2015-09-23 数据库的执行方法及装置
CN201510612206.4 2015-09-23

Publications (1)

Publication Number Publication Date
WO2017049913A1 true WO2017049913A1 (zh) 2017-03-30

Family

ID=58365506

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/081892 WO2017049913A1 (zh) 2015-09-23 2016-05-12 数据库的执行方法及装置

Country Status (2)

Country Link
CN (1) CN106547796B (zh)
WO (1) WO2017049913A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860692A (zh) * 2021-01-29 2021-05-28 城云科技(中国)有限公司 一种数据库表结构转换方法、装置及其电子设备
CN116126865A (zh) * 2023-02-17 2023-05-16 安芯网盾(北京)科技有限公司 一种多种数据库混合使用的代理方法及装置

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391537B (zh) * 2017-04-25 2020-09-15 阿里巴巴集团控股有限公司 数据关系模型的生成方法、装置及设备
CN110147396B (zh) * 2017-11-08 2021-08-31 中移(苏州)软件技术有限公司 一种映射关系生成方法及装置
CN110309171B (zh) * 2018-02-26 2021-08-20 华为技术有限公司 数据库查询方法、服务器和系统
CN108806797A (zh) * 2018-06-27 2018-11-13 思派(北京)网络科技有限公司 一种医疗数据的处理方法及系统
CN111339132B (zh) * 2018-12-18 2023-05-26 金篆信科有限责任公司 一种数据查询的方法及数据库代理
CN109753520B (zh) * 2019-01-28 2021-01-26 上海达梦数据库有限公司 半连接查询方法、装置、服务器及存储介质
CN111666321B (zh) * 2019-03-05 2024-01-05 百度在线网络技术(北京)有限公司 多数据源的操作方法及其装置
CN110096513A (zh) * 2019-04-10 2019-08-06 阿里巴巴集团控股有限公司 一种数据查询、资金核对方法及装置
CN110096709A (zh) * 2019-05-07 2019-08-06 百度在线网络技术(北京)有限公司 指令处理方法及装置、服务器及计算机可读介质
CN110196854A (zh) * 2019-06-11 2019-09-03 中国科学院寒区旱区环境与工程研究所 数据处理方法及装置
CN112650561B (zh) * 2019-10-11 2023-04-11 金篆信科有限责任公司 事务管理方法、系统、网络设备和可读存储介质
CN111046065B (zh) * 2019-10-28 2022-06-17 北京大学 可扩展的高性能分布式查询处理方法及装置
CN112749189A (zh) * 2019-10-29 2021-05-04 北京国双科技有限公司 数据查询方法及装置
CN110990420A (zh) * 2019-11-27 2020-04-10 腾讯科技(深圳)有限公司 数据查询方法、装置
CN111209295B (zh) * 2019-12-25 2021-02-26 中科驭数(北京)科技有限公司 计算流图优化方法、数据库访问方法及装置
CN111190918B (zh) * 2019-12-25 2020-12-08 中科驭数(北京)科技有限公司 基于计算流图的数据库访问方法及装置
CN111190886B (zh) * 2019-12-25 2020-12-15 中科驭数(北京)科技有限公司 面向数据库访问的计算流图构建方法、访问方法及装置
CN112052255B (zh) * 2020-09-02 2022-05-03 福建天晴在线互动科技有限公司 一种自上而下拆分多表慢查询的sql解释方法及其装置
TWI781071B (zh) * 2021-07-27 2022-10-11 玉山綜合證券股份有限公司 證券下單驗證方法
TWI769028B (zh) * 2021-07-27 2022-06-21 玉山綜合證券股份有限公司 證券下單驗證方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101093501A (zh) * 2007-07-31 2007-12-26 武汉大学 一种高效、透明的分布式空间数据库查询方法
US20100250589A1 (en) * 2009-03-26 2010-09-30 Grasstell Networks Llc Tree structured P2P overlay database system
CN104040532A (zh) * 2011-09-01 2014-09-10 汉特能源智商公司 管理建模语言
CN104123374A (zh) * 2014-07-28 2014-10-29 北京京东尚科信息技术有限公司 分布式数据库中聚合查询的方法及装置
US9135300B1 (en) * 2012-12-20 2015-09-15 Emc Corporation Efficient sampling with replacement

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7844608B2 (en) * 2006-12-15 2010-11-30 Yahoo! Inc. Clustered query support for a database query engine
CN103310011A (zh) * 2013-07-02 2013-09-18 曙光信息产业(北京)有限公司 集群数据库系统环境下的数据查询解析方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101093501A (zh) * 2007-07-31 2007-12-26 武汉大学 一种高效、透明的分布式空间数据库查询方法
US20100250589A1 (en) * 2009-03-26 2010-09-30 Grasstell Networks Llc Tree structured P2P overlay database system
CN104040532A (zh) * 2011-09-01 2014-09-10 汉特能源智商公司 管理建模语言
US9135300B1 (en) * 2012-12-20 2015-09-15 Emc Corporation Efficient sampling with replacement
CN104123374A (zh) * 2014-07-28 2014-10-29 北京京东尚科信息技术有限公司 分布式数据库中聚合查询的方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860692A (zh) * 2021-01-29 2021-05-28 城云科技(中国)有限公司 一种数据库表结构转换方法、装置及其电子设备
CN112860692B (zh) * 2021-01-29 2023-07-25 城云科技(中国)有限公司 一种数据库表结构转换方法、装置及其电子设备
CN116126865A (zh) * 2023-02-17 2023-05-16 安芯网盾(北京)科技有限公司 一种多种数据库混合使用的代理方法及装置
CN116126865B (zh) * 2023-02-17 2023-09-08 安芯网盾(北京)科技有限公司 一种多种数据库混合使用的代理方法及装置

Also Published As

Publication number Publication date
CN106547796A (zh) 2017-03-29
CN106547796B (zh) 2022-01-25

Similar Documents

Publication Publication Date Title
WO2017049913A1 (zh) 数据库的执行方法及装置
US20230376487A1 (en) Processing database queries using format conversion
Nguyen et al. Join processing for graph patterns: An old dog with new tricks
US10133778B2 (en) Query optimization using join cardinality
US8650181B2 (en) OLAP execution model using relational operations
EP2605158B1 (en) Mixed join of row and column database tables in native orientation
US9244974B2 (en) Optimization of database queries including grouped aggregation functions
US9767150B2 (en) System and method for processing database queries
US8935232B2 (en) Query execution systems and methods
CN111971666A (zh) 优化sql查询计划的维度上下文传播技术
US11550790B2 (en) Object relational mapper for non-relational databases
CN1987861A (zh) 处理数据库查询的系统和方法
US20090077054A1 (en) Cardinality Statistic for Optimizing Database Queries with Aggregation Functions
US9734177B2 (en) Index merge ordering
CN106339432A (zh) 一种按查询内容进行负载均衡的系统及其方法
Bellatreche et al. Horizontal partitioning of very-large data warehouses under dynamically-changing query workloads via incremental algorithms
CN112818010B (zh) 数据库查询方法及装置
US20100205197A1 (en) Two-valued logic database management system with support for missing information
US11921710B2 (en) Systems and methods for accessing data entities managed by a data processing system
Zhu et al. Hydb: Access optimization for data-intensive service
US8224808B2 (en) Tracking modifications to values of various fields in a database server
Kondylakis et al. Efficient Implementation of Joins over Cassandra DBs.
WO2017131753A1 (en) Text search of database with one-pass indexing including filtering
Chen et al. On implementing a text-database-as-a-service
Beckman An assistant expert system: assisting assistors in assisting taxpayers

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16847795

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16847795

Country of ref document: EP

Kind code of ref document: A1