A database management system and a method for executing query processing against a database.

The database management system optimizes query processing by employing directed graphs with order-dependent and order-invariant neural networks for AND and OR nodes, improving efficiency and reducing costs in query execution.

JP2026054126APending Publication Date: 2026-03-26KIOXIA CORP
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2026-03-26

AI Technical Summary

Technical Problem

Existing database management systems face inefficiencies in query processing, particularly in optimizing the execution of queries using directed acyclic graphs, which do not adequately account for the dependencies and physical properties of processing and storage in distributed systems.

Method used

A database management system utilizing a directed graph with nodes representing processes and edges indicating inputs and outputs, employing neural networks to calculate feature quantities for nodes, where AND nodes use an order-dependent network and OR nodes use an order-invariant network, optimizing query processing by determining efficient execution paths based on these calculations.

Benefits of technology

Enhances query processing efficiency by selecting optimal paths based on calculated feature quantities, reducing processing time and resource utilization, and providing cost predictions for query execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026054126000001_ABST
    Figure 2026054126000001_ABST
Patent Text Reader

Abstract

To provide a method for optimizing query processing in a database management system. [Solution] The database management system performs query processing on the database using a directed graph, the directed graph includes a first node corresponding to the processing included in the query processing, a second node corresponding to the processing result of the first node, and edges indicating their inputs and outputs, the processor calculates the feature quantities of the first and second nodes, the first node's feature quantity is input to a first neural network which is dependent on the order of inputs when calculating the first node's feature quantity, and the second node's feature quantity is input to a second neural network which is not dependent on the order of inputs when calculating the second node's feature quantity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One embodiment of the present disclosure relates to a database management system and a method for executing query processing on a database.

Background Art

[0002] In recent years, memory systems equipped with non-volatile memory have become widespread. For example, a memory system using a solid state drive (SSD) is used as an information processing device and storage in a database management system.

[0003] A database management system executes processing in response to a query (processing request). For example, in a relational database, SQL query processing is executed. In SQL query processing, a directed acyclic graph is used instead of a tree structure in order to optimize query processing.

Prior Art Documents

Patent Documents

[0004]

Patent Document 1

Patent Document 2

Patent Document 3

Summary of the Invention

Problems to be Solved by the Invention

[0005] An object of the present disclosure is to provide an optimization method for query processing in a database management system.

Means for Solving the Problems

[0006] A database management system according to one embodiment comprises a processor and memory, and is a database management system for managing a database, wherein the processor is configured to perform query processing on the database using a directed graph created based on a query in response to a query received from a host, the directed graph includes one or more first nodes corresponding to the processing included in the query processing, one or more second nodes corresponding to the processing results of the first nodes, and edges indicating inputs and outputs to the first and second nodes, the processor is configured to calculate feature quantities for each of the first and second nodes, the calculation of the feature quantity of the first node is configured to be performed by inputting the feature quantity of the second node, which is input to the first node where the feature quantity is calculated, into a first neural network that is dependent on the order of inputs, and the calculation of the feature quantity of the second node is configured to be performed by inputting the feature quantity of the first node, which is input to the second node where the feature quantity is calculated, into a second neural network that is not dependent on the order of inputs.

[0007] A method for executing query processing according to one embodiment is a method for executing query processing on a database in response to a query received from a host using a directed graph, wherein the directed graph includes one or more first nodes corresponding to the processing included in the query processing, one or more second nodes corresponding to the processing results of the first nodes, and edges indicating inputs and outputs to the first and second nodes, wherein the method creates the directed graph based on the query, calculates the feature quantities of the first and second nodes, in the calculation of the feature quantities of the first node, the feature quantities of the second node input to the first node where the feature quantities are calculated is input to a first neural network that is dependent on the order of inputs and the calculation is performed, and in the calculation of the feature quantities of the second node, the feature quantities of the first node input to the second node where the feature quantities are calculated is input to a second neural network that is not dependent on the order of inputs and the calculation is performed.

[0008] A database management system according to one embodiment comprises a directed graph generation unit, a feature calculation unit, and a query processing execution unit configured to perform query processing on a database in response to a query received from a host, wherein the directed graph generation unit is configured to create a directed graph based on the query, the directed graph includes one or more first nodes corresponding to processing included in the query processing, one or more second nodes corresponding to the processing results of the first nodes, and edges indicating inputs and outputs to the first and second nodes, the feature calculation unit is configured to calculate the feature quantities of the first and second nodes, the first node feature quantity is configured to be input to a first neural network that is dependent on the order of inputs for the calculation, and the second node feature quantity is configured to be input to a second neural network that is not dependent on the order of inputs for the calculation. [Brief explanation of the drawing]

[0009] [Figure 1] This block diagram shows the configuration of a system according to one embodiment. [Figure 2] This block diagram shows the configuration of the feature calculation unit according to one embodiment. [Figure 3] This figure shows a directed graph according to one embodiment. [Figure 4] This figure shows a directed graph according to one embodiment. [Figure 5] This figure shows a directed graph according to one embodiment. [Figure 6] This is a flowchart illustrating the execution of query processing in a system according to one embodiment. [Figure 7] This figure shows the results of calculating the feature quantities of each node in a directed graph according to one embodiment. [Figure 8] This figure shows a directed graph according to one embodiment. [Modes for carrying out the invention]

[0010] The database management system according to the embodiment will be described in detail below with reference to the drawings. In the following description, components having substantially the same function and configuration are denoted by the same reference numerals, and redundant descriptions may be omitted. The embodiments shown below illustrate devices and methods for realizing the technical concept of this embodiment. The technical concept of the embodiment is not limited to the materials, shapes, structures, arrangements, etc., of the components described below. The technical concept of the embodiment may have various modifications to the claims.

[0011] In the following explanation, "directed graph" refers to a technique for representing a situation where multiple processes have dependencies on each other, by storing information about the cost required for each process and connecting the sequential relationships (preceding and succeeding relationships) between them with arrows. A dependency between multiple processes means, for example, that if processes A, B, and C exist in a directed graph, process C cannot be executed until processes A and B are completed.

[0012] In a directed graph, the blocks corresponding to each process are called "nodes." Each node defines the content of each process and the results obtained from that process. In other words, the multiple processes and their results included in a query process each correspond to multiple nodes in the directed graph. To put it another way, processes and their results have a one-to-one relationship with nodes. Directed graphs include AND nodes and OR nodes. AND nodes are nodes that correspond to the processes included in a query process. OR nodes are nodes that correspond to the processing results of AND nodes. The costs, such as the time required for processing at each node, the amount of memory used, the power consumption, and the server usage fees, are collectively referred to as "processing costs." Arrows that indicate the relationship between nodes are called "edges." In other words, edges indicate the inputs and outputs to each node.

[0013] A "database" refers to a collection of structured data, including relational databases (RDBs) and other types of databases (NoSQL). A "relational database" is a database configured to allow the use of multiple tabular data sets in relation to each other. Operation commands for relational databases are written in a database language. For example, Structured Query Language (SQL) is used as such a database language. SQL is used to operate the database, and operations such as adding, deleting, and searching (retrieving) data stored in the database are performed.

[0014] Furthermore, "NoSQL" refers to various databases other than relational databases, such as key-value databases that hold sets of values ​​for keys. These NoSQL databases can be manipulated using their own languages, such as CQL in Apache Cassandra. In the following explanation, a set of operations that a user wants to perform on a database, defined using SQL or similar, is simply called a "query," and the process executed according to the query is called "query processing." In other words, query processing includes multiple processes.

[0015] A "physical property" or "property" in a directed graph indicates, for any AND node, where the processing related to that node is physically executed, and what state (e.g., compressed or uncompressed) of input and output data is handled in that processing. Similarly, for any OR node in a directed graph, it indicates where the data related to that node is physically stored and what state (e.g., compressed or uncompressed) it is in during that processing. In other words, physical properties are assigned to the processing content included in a directed graph and the processing results obtained from that processing. Physical properties are used to identify processes that perform mathematically identical processing but are executed at physically different locations, or to identify data that is mathematically identical but stored at physically different locations in different states.

[0016] For example, when a relational database is composed of a plurality of information processing terminals (e.g., a plurality of servers), and each of the plurality of servers includes a plurality of storage devices (e.g., SSD (Solid State Drive), DRAM (Dynamic Random Access Memory), CPU (Central Processing Unit)), the physical properties include information identifying the server and the storage device in which the corresponding processing result is stored. As described above, the "physical properties" are expressed in a form including the concept of data format.

[0017] [1. First Embodiment] The database management system 10 according to the first embodiment will be described. The database management system 10 according to the first embodiment is, for example, a relational database. The database management system 10 communicates with the host 20, receives a command including a query from the host 20, and realizes the functions of the relational database according to the query.

[0018] [1-1. Overall Configuration of Database Management System] FIG. 1 is a block diagram showing the configuration of a database management system according to an embodiment. As shown in FIG. 1, the database management system 10 includes a management server 11 and a query processing execution unit 12.

[0019] The management server 11 includes a host interface 310 (Host I / F), a directed graph generation unit 320 (Graph Unit), a control unit 330 (Control Unit), and a feature amount calculation unit 340 (Calculation Unit). The management server 11 controls the query processing execution unit 12 using a directed graph described below by causing these functional units to cooperate with each other.

[0020] Each of the functional units, the host interface 310, the directed graph generation unit 320, the control unit 330, and the feature calculation unit 340, can be implemented using hardware, software, or a combination of both. Furthermore, it is not essential that the processing content of each functional unit be clearly distinguished as the host interface 310, the directed graph generation unit 320, the control unit 330, and the feature calculation unit 340. Part of a certain process may be executed by another functional unit, or each functional unit may be further divided into smaller elements. Some or all of the functions of these functional units may be implemented by at least one of, for example, registers, memory, adders, multipliers, selectors, and other arithmetic units. Registers may be implemented by sequential circuits such as flip-flops. Adders, multipliers, selectors, and other arithmetic units may be implemented by combinational logic circuits. Also, some or all of the functions of these functional units may be executed by one or more processors. In other words, the database management system 10 (especially the management server 11) may include a processor and memory, and the processor may use programs and data stored in memory to implement some or all of the functions of the above-mentioned functional unit.

[0021] The host interface 310 performs processing in accordance with the interface standard between the host 20 and the host interface 310. The host interface 310 transmits commands and other information received from the host 20 to the directed graph generation unit 320 and the control unit 330 via the internal bus. The host interface 310 also transmits, for example, the results of operations performed according to queries to the host 20.

[0022] The directed graph generation unit 320 generates a directed graph based on a query received from the host 20. For example, the directed graph generation unit 320 analyzes the query, identifies multiple processes included in the query, and generates and transforms a directed graph based on the dependencies between these processes. The methods for generating and transforming the directed graph will be described in detail later.

[0023] The control unit 330 determines an execution path on the directed graph in which query processing is efficiently executed, based on the directed graph generated by the directed graph generation unit 320 and the feature quantities in each process (details of which will be described later). Alternatively, the control unit 330 calculates the processing cost in each process based on the directed graph and feature quantities, and determines an execution path on the directed graph in which query processing is efficiently executed, based on the processing cost.

[0024] In other words, the control unit 330 determines one execution path from multiple execution paths, generates an execution plan for query processing, and drives the query processing execution unit 12 based on that execution plan. The above process can be described as optimizing the method of executing query processing against the database using a directed graph. The method for calculating feature quantities, the method for calculating processing costs, and the method for optimizing the query processing execution method will be explained in detail later. Note that optimization using a directed graph may mean selecting the most suitable one from all candidates (for example, the one with the highest processing efficiency), but it is not necessarily required to select the most suitable one; it may also mean selecting the one with relatively high processing efficiency from among multiple conditions.

[0025] The optimization described above means selecting a processing path from among multiple processing paths on a directed graph that is relatively efficient or has a relatively low processing cost (for example, a relatively short processing time derived from the calculation of the processing cost) based on the features at each node. Specifically, optimization may mean selecting the most efficient processing path or the path with the lowest processing cost (shortest processing time) from among multiple processing paths on a directed graph. However, the meaning of optimization is not limited to these examples. Specifically, processing paths other than those described above may be selected in accordance with conditions pre-set by the database management system 10, the host 20, or the user requesting query processing.

[0026] The feature calculation unit 340 calculates the feature quantities of each node in the directed graph using a neural network and stores the calculated feature quantities. As will be described in detail later, the feature calculation unit 340 calculates the feature quantities using different neural networks depending on the type of node. Specifically, when the feature calculation unit 340 calculates the feature quantities of an AND node, it inputs the feature quantities of the OR nodes input to the AND node into the first neural network processing unit NN1, which is dependent on the order of inputs, and performs the calculation. Also, when the feature calculation unit 340 calculates the feature quantities of an OR node, it inputs the feature quantities of the AND nodes input to the OR node into the second neural network processing unit NN2, which is not dependent on the order of inputs, and performs the calculation.

[0027] The first neural network processing unit NN1 and the second neural network processing unit NN2 may be provided in the feature calculation unit 340, or they may be provided in an information processing device separate from the feature calculation unit 340, that is, an information processing device separate from the management server 11. The first neural network processing unit NN1 and the second neural network processing unit NN2 may be provided in the same information processing device, or they may be provided in different information processing devices.

[0028] The query processing execution unit 12 includes a first server 100 (Server 1) and a second server 200 (Server 2). By coordinating the first server 100 and the second server 200, the query processing execution unit 12 performs operations on the database (query processing) in response to queries received from the host 20.

[0029] The first server 100 is a storage server for data retention. The first server 100 has a CPU 110, DRAM 120, and SSD 130. The CPU 110 has cache memory such as SRAM (Static Random Access Memory). In the following description, the storage of data in the SRAM of the CPU 110 will be expressed as data being stored in the CPU 110. In other words, the first server 100 can store data in the CPU 110, DRAM 120, and SSD 130.

[0030] The second server 200 is a server for computational processing. The second server 200 has a CPU 210 and DRAM 220. Because the second server 200 is a server with high computational processing power, it does not have storage such as an SSD. Like the CPU 110, the CPU 210 also has cache memory such as SRAM. In the following explanation, the storage of data in the registers or SRAM of the CPU 210 will be expressed as "data being stored in the CPU 210". In other words, the second server 200 can store data in the CPU 210 and DRAM 220. The CPU 210 can perform computational processing at a higher speed than the CPU 110. The capacity of the DRAM 220 is larger than the capacity of the DRAM 120. Note that the second server 200 may also have an SSD.

[0031] Similar to the management server 11, some or all of the functions of the query processing execution unit 12 may be executed by one or more processors. In other words, the query processing execution unit 12 may include a processor and memory, and the processor may use programs and data stored in memory to implement some or all of the above functions.

[0032] [1-2. Configuration of the Feature Calculation Unit] Figure 2 is a block diagram showing the configuration of a feature calculation unit according to one embodiment. As shown in Figure 2, the feature calculation unit 340 includes an AND node feature calculation unit 341, an OR node feature calculation unit 342, a feature memory 343, a first neural network processing unit NN1, and a second neural network processing unit NN2. The AND node feature calculation unit 341 calculates the features of the AND node by inputting the features of the OR node to the first neural network processing unit NN1. The OR node feature calculation unit 342 calculates the features of the OR node by inputting the features of the AND node to the second neural network processing unit NN2.

[0033] The features calculated by the AND node feature calculation unit 341 and the OR node feature calculation unit 342 are transmitted to and stored in the feature memory 343. The AND node features output from the feature memory 343 are input to the OR node feature calculation unit 342. The OR node features output from the feature memory 343 are input to the AND node feature calculation unit 342.

[0034] First, let's explain the second neural network processing unit NN2. The second neural network processing unit NN2 processes using a neural network that is independent of the order of inputs. In other words, if the second neural network processing unit NN2 has inputs 1 and 2, it will output the same result even if the order of inputs 1 and 2 is changed. To put it another way, the second neural network processing unit NN2 processes using an "order invariant" neural network. For example, the second neural network processing unit NN2 processes using a "Graph Neural Network".

[0035] For the second neural network processing unit NN2, the feature vectors for input 1 and input 2 are defined as the first input feature vector x1 and the second input feature vector x2, respectively, and the weight matrix is ​​Wshared Assuming that the post-processing (activation function) is f2, the feature quantity y2 calculated by the second neural network processing unit NN2 can be obtained by the following equation 1. Here, f2 is, for example, a sigmoid function or a ReLU function. y² = f²(x¹ × W) shared +x2×W shared ) (Formula 1)

[0036] In Equation 1, the weight matrix W for the two inputs shared They are the same. Therefore, even if the order of input 1 and input 2 is swapped (i.e., if the first input feature vector x1 and the second input feature vector x2 are swapped in equation 1), the calculated feature vector y2 remains unchanged.

[0037] Furthermore, as an example of a more advanced second neural network processing unit NN2, the "Graph Attention Network" is used. The Graph Attention Network includes a multi-head attention layer. Multi-head attention is a block component that performs transformations of each token representation in a sequence by executing multiple attention heads in parallel.

[0038] On the other hand, the first neural network processing unit NN1 processes using a neural network that is dependent on the order of inputs. In other words, if the first neural network processing unit NN1 has inputs 1 and 2, swapping the order of inputs 1 and 2 will cause the first neural network processing unit NN1 to output a different result. The first neural network processing unit NN1 processes using a general neural network other than the second neural network NN2 mentioned above, such as a "Feedforward Neural Network".

[0039] A Feedforward Neural Network is a neural network in which fully connected layers are interconnected. A fully connected layer is a layer that connects all nodes in a neural network. The neural network of the second neural network processing unit NN2 is called an "order invariant" neural network, while the neural network of the first neural network processing unit NN1 is called an "order dependent" neural network.

[0040] For the first neural network processing unit NN1, if the feature vectors for input 1 and input 2 are denoted as the first input feature vector x1 and the second input feature vector x2, respectively, and the weight matrices for input 1 and input 2 are denoted as the first weight matrix W1 and the second weight matrix W2, respectively, and the post-processing (activation function) is denoted as f1, then the feature y1 calculated by the first neural network processing unit NN1 can be obtained by the following equation 2. Here, f1 is either a sigmoid function or a ReLU function, similar to f2. y1=f1(x1×W1+x2×W2) (Formula 2)

[0041] In Equation 2, the first weight matrix W1 and the second weight matrix W2 are different. Therefore, if the order of input 1 and input 2 is changed (i.e., if the first input feature vector x1 and the second input feature vector x2 are swapped in Equation 2), the calculated feature vector y1 will change.

[0042] As described above, and as will be explained in more detail later, AND nodes are dependent on their inputs. Therefore, the features of an AND node are calculated by the first neural network processing unit NN1, which is dependent on its input. In other words, if there are multiple inputs to an AND node, the calculated features will change if the order of the inputs changes. On the other hand, and as will be explained in more detail later, OR nodes are not dependent on their inputs. Therefore, the features of an OR node are calculated by the second neural network processing unit NN2, which is not dependent on its input. In other words, if there are multiple inputs to an OR node, the calculated features will not change even if the order of the inputs changes.

[0043] It should be noted that the calculation methods for the first neural network processing unit NN1 and the second neural network processing unit NN2 described above are merely examples, and they can be calculated using a variety of other methods.

[0044] [1-3. Directed Graphs] A directed graph will be explained using Figures 3 to 6. Figures 3 to 5 show a directed graph according to one embodiment. Figure 6 shows the results of calculating the feature quantities of each node in the directed graph according to one embodiment. Using these figures, a directed graph will be explained, and the process by which the directed graph generation unit 320 generates a directed graph based on a query received from the host 20 will be explained. The directed graph described in this embodiment is a directed acyclic graph.

[0045] Figure 3 shows the default processing order before the transformation of the directed graph is performed. When the database management system 10 receives the above query from the host 20, the directed graph shown in Figure 3 is first generated. In the query processing shown in Figure 3, the processes described in the query are executed on a predetermined single device (server) in the order they are described. In Figure 3, for example, each process is executed on the first server 100.

[0046] This example demonstrates a query process that reads data recorded in a table within the database (N201; Read Table), calculates the average value for each condition that the read data (N202; TABLE) meets, and then filters the calculation results (N204; AVE. RESULT) to show only the data where the condition used to calculate the average falls within a certain range (N205; Filter) before outputting (N206; RESULT).

[0047] To explain using a concrete example, let's assume that a table in the database stored on the SSD 130 of the first server 100 contains a large amount of data on the company's employees. In this case, N201 reads the employee data from the table stored on the SSD 130, outputs the read result to N202, and stores it in the DRAM 120 of the first server 100. Then, this data is transferred from the DRAM 120 to the CPU 110.

[0048] In N203, the CPU 110 of the first server 100 performs a process to calculate the "average salary amount by year of joining the company" for the data input from N202. In N204, the calculated average amount is stored in DRAM 120 as the calculation result of N203. Then, in N205, only the data for years of joining the company that are equal to or greater than the minimum year of joining given as a parameter for filtering is output from the average amount stored in DRAM 120. In N206, the output data is stored in DRAM 120 as the calculation result of N205. In other words, as the final result (N206), the average salary amount by year of joining the company is output for employees who have joined the company at or above a certain year, as shown in Figure 3.

[0049] In Figure 3, blocks N201 to N206 are nodes. Among the multiple nodes, those indicated by rectangular blocks are AND nodes, and those indicated by roughly elliptical blocks are OR nodes. The arrows connecting each block are edges. The edges indicate the input and output to AND nodes and OR nodes.

[0050] For example, an AND node includes processes such as data retrieval, data aggregation (e.g., average and sum), data filtering, and data joining. In Figure 3, N201, N203, and N205 are AND nodes.

[0051] For example, an OR node can contain results such as those read from a table, aggregated averages and sums, filtered data, and merged data. If the processing results of two or more AND nodes are equivalent, only one OR node corresponds to those multiple equivalent outputs. In Figure 2, N202, N204, and N206 are OR nodes.

[0052] Figure 4 shows a directed graph after applying a logical transformation to the default directed graph. A logical transformation refers to a transformation of a directed graph by applying transformation rules, such as rearranging the order of execution of processes. In this case, multiple paths are derived in which the processing order of each AND node is changed so that a logically equivalent final result is obtained.

[0053] As shown in Figure 4, the order of table reading operations cannot be changed, so, similar to N201 and N202 in Figure 3, the table reading operation (N301; Read Table) outputs the read result (N302; TABLE). On the other hand, under the conditions of this query processing, it is possible to swap the order of the average calculation process and the filtering process, so the output from N302 branches into two, N303 and N313.

[0054] Routes N303 to N305 are the same as N203 to N205 in Figure 3, so their explanation is omitted. In Figure 4, the route N313 to N315 is provided in parallel with the route N303 to N305.

[0055] In the path from N313 to N315, the retrieved data (TABLE; N302) is filtered to include only data with an entry year equal to or greater than the minimum entry year given as a parameter for filtering (Filter; N313). Then, the average value of the data that meets the conditions used in the filtering process is calculated for each condition (Average; N315) and output (RESULT; N306) based on the filtering result (FLT. RSLT; N314).

[0056] To explain using a specific example, in N313, the CPU 110 outputs only the data for entry years equal to or greater than the minimum entry year given as a parameter for filtering the data input from N302, and in N314, the output data is stored in DRAM 120 as the calculation result of N313. In N315, the data stored in DRAM 120 in N314 is used to calculate the average salary for each entry year, and in N306, the calculated data is stored in DRAM 120 as the calculation result of N315.

[0057] As described above, whether the path is N303-N305 or N313-N315, the final result (N306) outputs the average salary by year of entry for employees who joined the company at or above a certain year of entry. In other words, N306 (OR node) is a result obtained by logically equivalent processing. Although these paths are logically equivalent, the CPU processing speed and amount may differ depending on the processing order. Therefore, for these paths, the feature quantities of each node can be calculated, and the query processing execution method can be optimized based on the calculated feature quantities.

[0058] In the directed graphs of Figures 3 and 4, a simplified configuration is shown where each AND node has only one corresponding edge (for example, N305 is connected to only one edge from N304). However, as shown in Figure 5, there are also cases where each AND node has two corresponding edges. Figure 5 specifically illustrates a configuration where two data points are input to nodes involved in join operations (N325 and N333). While Figure 4 reads data from one table, Figure 5 reads data from two different tables, as shown in N321 (Read Table 1) and N331 (Read Table 2). Aside from the above, N323-N325 in Figure 5 are similar to N303-N305 in Figure 4, and N333-N335 in Figure 5 are similar to N313-N315 in Figure 4.

[0059] In Figure 5, the AND node N325 has inputs In1 and In2. Similarly, the AND node N333 has inputs In3 and In4. Inputs In1 and In3 are inputs of the data to be used for the join process. Inputs In2 ​​and In4 are inputs of data related to the conditions for executing the join process. In other words, based on the query process, data related to the conditions for performing the join process is read from the data recorded in the table (N331; Read Table 2) and output (N332; TABLE 2).

[0060] Let's explain the AND node with two data inputs as described above using a concrete example. As shown above, N325 combines data for entry years that are equal to or greater than a certain baseline entry year. In other words, the baseline entry year corresponds to the "minimum entry year of employees to be aggregated". Therefore, input In2 of N325 and input In4 of N333 are entered with data related to the "minimum entry year of employees to be aggregated" (hereinafter referred to as "processing condition data"). Note that the "data related to the average salary amount for each entry year" entered in input In1 of N325 and input In3 of N333 is subject to processing performed in N325 and N333, so this data can be called "processing target data". Here, reading data from a table (N331; Read Table 2) corresponds to reading data from a small table containing the processing condition data (minimum entry year of employees to be aggregated), and the read data (N332; TABLE) corresponds to the processing condition data.

[0061] As described above, in N325 and N333, the data to be processed is input as input In1 and In3, and the processing condition data is input as input In2 and In4. The processing condition data is data that indicates the conditions for executing the join process in N325 and N333, as described above. Therefore, when the data to be processed is input in input In1 and In3, and the processing condition data is input in input In2 and In4, data from the minimum year of employment to be included in the aggregation will be output for the "data relating to the average amount of salary for each year of employment". If, for example, the data input to input In1 and input In2 in N325 is swapped, the data to be processed and the processing conditions will be reversed, and it will not be possible to obtain the correct output result. Similarly, if the data input to input In3 and input In4 in N333 is swapped, it will not be possible to obtain the correct output result.

[0062] In AND nodes such as N325 and N333, if the input order of the data to be processed and the processing condition data is reversed as described above, it will not be possible to obtain the correct output result. In other words, AND nodes are dependent on the input order.

[0063] In Figure 5, the OR node N326 receives inputs In5 and In6. Input In5 receives the result calculated by the path N323-N325. Input In6 receives the result calculated by the path N333-N335. Since these two paths differ only in the order of the average calculation process and the join process, the results calculated by the two paths are the same. Therefore, in Figure 5, N325 is connected to input In5 and N335 is connected to input In6, but the result obtained will be the same even if the nodes connected to input In5 and input In6 are swapped. In other words, the input order is not dependent on the OR node.

[0064] In a directed graph like the one shown in Figure 5, when calculating the feature vectors of each node using a neural network, the appropriate neural network for calculating the feature vectors differs depending on whether the target node is dependent on the input order or not. As described above, the first neural network processing unit NN1 is suitable for calculating the feature vectors of AND nodes, which are dependent on the input order. On the other hand, the second neural network processing unit NN2 is suitable for calculating the feature vectors of OR nodes, which are not dependent on the input order.

[0065] [1-4. Calculation of features during query processing] The method for calculating features during query processing will be explained using Figure 6. Figure 6 is a flowchart for executing query processing in a system according to one embodiment. The operation in the flowchart shown in Figure 6 is initiated when the host 20 issues a command to the database management system 10. In this flowchart, the calculation of features and the selection of nodes for calculating features are performed by the feature calculation unit 340, the generation and modification of directed graphs are performed by the directed graph generation unit 320, and all other operations are performed by the control unit 330. When these functional units are implemented by a single information processing device, each operation shown in Figure 6 is performed by one or more processors provided in the information processing device.

[0066] As shown in Figure 6, the control unit 330 obtains information related to the query included in the command based on the command issued from the host 20 (S601; Query). Next, the directed graph generation unit 320 creates an initial directed graph (Figure 3) based on the content defined by the query, and generates the directed graphs shown in Figures 4 and 5 (S602; AND OR Graph) by performing logical transformations on that directed graph.

[0067] Next, the feature calculation unit 340 selects the node to which the feature calculation will be performed (S603; Node). In S603, nodes are selected in order from those whose inputs have been determined. For example, in Figure 5, N321 or N331 is selected first. Since the output of each node is performed after the feature quantities of each node have been determined, N322 is not selected until the feature quantities of N321 have been calculated. Similarly, N332 is not selected until the feature quantities of N331 have been calculated. N333 is not selected until both the feature quantities of N322 and N332 have been calculated.

[0068] Figure 7 shows the results of calculating the feature quantities of each node in a directed graph according to one embodiment. In Figure 7, the [V#] (where # is a natural number) written next to each node indicates the order in which the feature quantities were calculated. In other words, in Figure 7, the feature quantities were calculated in the order N321, N331, N322, N332, N323, N333, N324, N334, N325, N335, and N326. However, as mentioned above, the feature quantities can be calculated in order from the node in which the input is determined, and the example is not limited to this one.

[0069] Next, the control unit 330 determines whether the node selected in S603 is an AND node or an OR node (S604; AND?). If the selected node is an AND node (Yes in S604), the control unit 330 uses the first neural network processing unit NN1 to calculate the feature quantities of the selected AND node (S605; NN1). On the other hand, if the selected node is an OR node (No in S604), the control unit 330 uses the second neural network processing unit NN2 to calculate the feature quantities of the selected OR node (S606; NN2).

[0070] As described above, the calculation of features for AND nodes in S605 is performed by inputting the features of the OR nodes input to the selected AND node into the first neural network processing unit NN1, except for N321 and N331 which do not receive input from OR nodes. For example, in Figure 5, when calculating features for the N325 fusion process, the features of N325 are calculated by inputting the features of N324 (OR node) and N332 (OR node) input to N325 (AND node) into the first neural network processing unit NN1.

[0071] Similarly, the calculation of OR node features in S606 is performed by inputting the feature quantities of the AND nodes input to the selected OR node into the second neural network processing unit NN2. For example, in Figure 5, when calculating the feature quantities for the final result of N326, the feature quantities of N326 are calculated by inputting the feature quantities of N325 (AND node) and N335 (AND node) input to N326 (OR node) into the second neural network processing unit NN2.

[0072] Following S605 or S606, the control unit 330 determines whether the calculation of features for each node is complete (S607; Finish?). If the calculation of features is complete for all nodes shown in Figure 5 (Yes in S607), the control unit 330 executes the query (S608; Exe. Query). On the other hand, if the calculation of features is not complete for all nodes shown in Figure 5 (No in S607), the control unit 330 returns to S603 and selects the next target node. When the query is executed in S608, the control unit 330 sends a message to the host 20 via the host interface 310 indicating that the query has been executed (S609; Rep. Query Result).

[0073] [1-5. Optimizing query processing using features] If the command from host 20 includes optimization of the query processing execution method, the control unit 330 determines an appropriate processing path based on the calculated feature quantities for each node. Specifically, the control unit 330 compares the feature quantities calculated for at least one of N323 to N325 with the feature quantities calculated for at least one of N333 to N335 to select an appropriate path. Based on this comparison of feature quantities, the control unit 330 may, for example, select a path with a faster processing speed, or a path that places less burden on the processing unit (e.g., memory capacity used, power consumption, and server usage fees).

[0074] For example, the control unit 330 predicts the processing cost of calculating the processing result corresponding to an AND node based on the feature quantities of the AND nodes included in the directed graph. Specifically, the control unit 330 can predict the processing costs of the average calculation process (N335) and the merging process (N325), respectively, based on the feature quantities of the AND nodes N333 and N325. If the average calculation process has a lower processing cost than the merging process, the control unit 330 selects the path from N323 to N325. On the other hand, if the merging process has a lower processing cost than the average calculation process, the control unit 330 selects the path from N333 to N335.

[0075] In addition to route selection, the calculated features can be used to provide various other functions. For example, based on the features of an OR node, it is possible to predict the processing cost required to obtain the processing result corresponding to that OR node and provide a function to notify the user of the predicted cost in advance.

[0076] Furthermore, for example, a function can be provided to calculate the scheduling priority when executing the processing of an AND node based on the features of that AND node. Scheduling priority means, for example, determining which query processing to perform first when multiple different query processing requests are received at the same time.

[0077] As described above, according to the database management system 10 of this embodiment, in a directed graph, the calculation of features for AND nodes that depend on the input order and the calculation of features for OR nodes that do not depend on the input order can be processed by neural networks appropriate for each, thereby enabling the calculation of features appropriate for each node.

[0078] [2. Second Embodiment] The database management system 10 according to the second embodiment will be described with reference to Figure 8. The database management system 10 according to the second embodiment is similar to the database management system 10 according to the first embodiment. In the following description, the explanation of the same configuration as the database management system 10 according to the first embodiment will be omitted, and the differences between the two will be mainly described. In the database management system 10 according to the second embodiment, the overall configuration of the database management system and the configuration of the feature calculation unit are the same as in the first embodiment.

[0079] [2-1. Directed Graphs] The directed graph according to this embodiment will be explained using Figure 8. The directed graph shown in Figure 8 is a directed graph obtained by performing a physical transformation on a directed graph to which a logical transformation has been applied (see Figure 4).

[0080] Physical transformation refers to the transformation of a directed graph by applying transformation rules regarding which information processing device will execute the processing of the directed graph, and which storage device will store the data obtained as a result of the processing. In physical transformation, "physical properties" representing information such as the information processing device that will execute the processing and the storage device that will store the processing results are assigned to the nodes, and the directed graph is further expanded according to these physical properties. In this case as well, multiple paths are derived in which the processing order of each AND node is changed so that a logically equivalent final result is obtained. When physical transformation is performed on both paths in the directed graph shown in Figure 4, there are many possible paths. Therefore, Figure 8 illustrates the case where the path from N313 to N315 in the directed graph shown in Figure 4 is executed, and the final result is stored in the second server 200.

[0081] As described above, "physical properties" are information that indicates the attributes of the data, defining how the output data of the AND node is physically stored. In the case of Figure 8, multiple paths are derived considering the case where each process is executed on the first server 100 or the second server 200.

[0082] As shown in Figure 8, the order of table read operations cannot be changed, so, similar to N201 and N202 in Figure 3 and N301 and N302 in Figure 4, the table read operation (N401; Read Table) is executed, and the read data (N402; TABLE) is stored in the DRAM 120 of the first server 100. In Figure 8, physical properties are indicated in parentheses above the target node. As shown in Figure 8, for example, in N402, the data is stored in the DRAM 120 of the first server 100 ([Sv1_DRAM]).

[0083] The data stored in DRAM120 may be processed by either the first server 100 or the second server 200, so the output from N402 branches accordingly.

[0084] First, let's explain the case where processing is performed on the second server 200. The data stored in DRAM 120 is transferred to the second server 200 (N403; Trans. Sv2). As a result of the transfer process, the transferred data is stored in the DRAM 220 of the second server 200 (N404; TABLE, [Sv2_DRAM]). This data is then transferred from DRAM 220 to the CPU 210.

[0085] The route from N405 to N408 in Figure 8 is the same as the route from N303 to N306 shown in Figure 4, so no explanation is provided. Similarly, the route from N415 to N417 in Figure 8 is the same as the route from N313 to N315 shown in Figure 4, so no explanation is provided. The calculation result of the average value at N406 and the result of the filtering process at N416 are both stored in the DRAM 220 of the second server 200 ([Sv2_DRAM]).

[0086] Next, we will describe the case where the processing is handled by the first server 100. In this case, the data stored in the DRAM 120 is transferred to the CPU 110. The CPU 110 performs a filtering process on the data, selecting only the data that falls within a certain range under specific conditions (N423; Filter). The filtered data is then stored in the DRAM 120 as a result of the filtering process (N424; FLT. RSLT, [Sv1_DRAM]).

[0087] The data stored in DRAM120 is transferred to the second server 200 (N425;Trans. Sv2). The transferred data is then stored in the DRAM220 of the second server 200 as a result of the transfer process (N416;FLT. RSLT, [Sv2_DRAM]). In this data transfer, the data may be transferred directly from the CPU110 of the first server 100 to the CPU210 of the second server 200 in Figure 8.

[0088] Whether the output branched from N402 passes through N403, N404, N415, and N416, or through N423, N424, N425, and N416, a filtering process is performed before the calculation of the average value, so N416 (OR node) is a result obtained through logically equivalent processing.

[0089] For the directed graph shown in Figure 8, the control unit 330 calculates the feature quantities of each node in the manner shown in Figure 6, and determines an appropriate processing path based on the calculated feature quantities of each node. Specifically, the control unit 330 compares the feature quantities calculated for at least one of N405 to N407 with the feature quantities calculated for at least one of N415 to N417 and the feature quantities calculated for at least one of N423 to N425 to select an appropriate path. By comparing these feature quantities, the control unit 330 may, for example, select a path with a faster processing speed, or a path that places less burden on the processing unit (e.g., memory capacity used, power consumption, and server usage fees).

[0090] For example, the control unit 330 determines, based on the feature quantities of the AND nodes N415 and N425, which are the AND nodes, which the calculation result of the OR node N416 should be calculated based on the processing corresponding to which AND node. More specifically, the feature quantity of N415 includes information related to the cost of transferring the table to the second server 200 and the cost of performing the filtering process on the second server 200. The feature quantity of N425 includes the cost of performing the filtering process on the first server 100 and the cost of transferring the filtering result to the second server 200. Therefore, as described above, by selecting which AND node to execute based on the feature quantities of N415 and N425, it is possible to determine whether the filtering process should be performed on the first server 100 or the second server 200. Here, the first server 100 may be referred to as the "first information processing device," and the second server 200 may be referred to as the "second information processing device."

[0091] Although the above paths are logically equivalent, the CPU processing speed and processing volume may differ depending on the processing order and the server on which the processing is performed. Therefore, when the control unit 330 selects a path, it can optimize the query processing execution method by using information on the server's performance in addition to the feature quantities of each node. Furthermore, when calculating the feature quantities of each node, information on the server's performance may be pre-inputted into the AND node feature calculation unit 341 and the OR node feature calculation unit 342.

[0092] As described above, the database management system 10 according to this embodiment offers the same advantages as the database management system 10 according to the first embodiment, in addition to enabling optimization of the processing path among multiple devices.

[0093] Although embodiments of the present invention have been described above with reference to the drawings, the present invention is not limited to the above embodiments, and can be modified as appropriate without departing from the spirit of the invention. For example, a database management system based on this embodiment, with additions, deletions, or design changes made by a person skilled in the art, is also included in the scope of the present invention as long as it retains the gist of the invention. Furthermore, the above embodiments can be combined as appropriate as long as they do not contradict each other, and technical matters common to each embodiment are included in each embodiment even without explicit description.

[0094] Any effects or benefits other than those brought about by the embodiments described above, if they are clear from the description herein or easily predictable to a person skilled in the art, are naturally considered to be brought about by the present invention. [Explanation of Symbols]

[0095] 10: Database management system, 11: Management server, 12: Query processing execution unit, 20: Host, 100: First server, 200: Second server, 310: Host interface, 320: Directed graph generation unit, 330: Control unit, 340: Feature calculation unit, 341: Node feature calculation unit, 342: Node feature calculation unit, 343: Feature memory

Claims

1. A database management system comprising a processor and memory, which manages a database, The aforementioned processor, It is configured to execute query processing against the database using a directed graph created based on a query received from a host, The aforementioned directed graph is One or more first nodes corresponding to the processing included in the query processing, One or more second nodes corresponding to the processing result of the first node, Includes edges indicating inputs and outputs to the first node and the second node, The aforementioned processor, The system is configured to calculate the feature quantities of the first node and the second node, In the calculation of the features of the first node, the features of the second node, which are input to the first node where the features are calculated, are input to a first neural network that has a dependency on the order of inputs, and the calculation is performed. A database management system configured to perform the calculation of the features of the second node by inputting the features of the first node, which are input to the second node where the features are calculated, into a second neural network that is independent of the order of inputs.

2. The database management system further comprises a first information processing device and a second information processing device capable of executing the query processing, The database management system according to claim 1, wherein the processor determines whether to have the processing at the first node performed by the first information processing device or the second information processing device, based on the feature quantities of the first node calculated by the first neural network.

3. The first node includes the third node and the fourth node, In the directed graph, the edge from the second node branches and connects to the third node and the fourth node, The aforementioned processor, The system is configured to calculate the feature quantities of the third node and the feature quantities of the fourth node, In the calculation of the features of the third node, the features of the second node, which are input to the third node where the features are calculated, are input to the first neural network and the calculation is performed. In the calculation of the features of the fourth node, the features of the second node, which are input to the fourth node where the features are calculated, are input to the first neural network and the calculation is performed. The database management system according to claim 1, which determines whether to execute the query processing on the third node or the fourth node based on the features of the third node and the features of the fourth node.

4. The database management system according to claim 1, wherein the processor calculates the processing cost for obtaining a processing result corresponding to the second node based on the feature quantities of the second node calculated by the second neural network.

5. The database management system according to claim 4, wherein the processing cost includes at least one of the processing time at the first node and the time and memory capacity used at the second node.

6. The database management system according to claim 1, wherein the processor determines the priority of processing for calculating processing results corresponding to the first node based on the feature quantities of the first node calculated by the first neural network.

7. A method for performing query processing on a database using a directed graph, in response to queries received from a host, The aforementioned directed graph is One or more first nodes corresponding to the processing included in the query processing, One or more second nodes corresponding to the processing result of the first node, Includes edges indicating inputs and outputs to the first node and the second node, The aforementioned method, Based on the above query, create the directed graph, The feature quantities of the first node and the second node are calculated, When calculating the feature quantities of the first node, the feature quantities of the second node, which are input to the first node where the feature quantities are calculated, are input to a first neural network that has a dependency on the order of inputs, and the calculation is performed. A method for calculating the features of the second node, wherein the features of the first node, which are input to the second node where the features are calculated, are input to a second neural network that is independent of the order of inputs, and the calculation is performed.

8. Directed graph generation unit, Feature calculation unit, A database management system comprising: a query processing execution unit configured to perform query processing on a database in response to a query received from a host, The directed graph generation unit, It is configured to create a directed graph based on the aforementioned query, The aforementioned directed graph is One or more first nodes corresponding to the processing included in the query processing, One or more second nodes corresponding to the processing result of the first node, Includes edges indicating inputs and outputs to the first node and the second node, The feature calculation unit described above, The system is configured to calculate the feature quantities of the first node and the second node, When calculating the feature quantities of the first node, the feature quantities of the second node, which are input to the first node where the feature quantities are calculated, are input to a first neural network that has a dependency on the order of inputs, and the calculation is performed. A database management system configured to calculate the features of the second node by inputting the features of the first node, which are input to the second node where the features are calculated, into a second neural network that is independent of the order of inputs.

Citation Information

Patent Citations

  • Configuration-parametric query optimization

    US20090327254A1

  • Wheelchair System with Motion Sensors and Neural Stimulation

    US20190038484A1

  • Optimizing search query logic to speed retrieval

    US8661023B1