DATABASE QUERY OPTIMIZER THAT TAKES NETWORK CHOICE INTO CONSIDERATION
In a networked computer system that includes multiple nodes and multiple networks interconnecting the nodes, a database query optimizer takes network choice into consideration when optimizing a query. The query optimizer logs historical information for queries that includes network information. A network monitor determines network characteristics of the multiple networks. The query optimizer then selects a network for a query based on the network characteristics, and optionally based on the historical information as well. The result is a query optimizer that takes network choice into consideration, thereby providing a query that is optimized according to the characteristics of the networks.
Latest IBM Patents:
- INTERACTIVE DATASET EXPLORATION AND PREPROCESSING
- NETWORK SECURITY ASSESSMENT BASED UPON IDENTIFICATION OF AN ADVERSARY
- NON-LINEAR APPROXIMATION ROBUST TO INPUT RANGE OF HOMOMORPHIC ENCRYPTION ANALYTICS
- Back-side memory element with local memory select transistor
- Injection molded solder head with improved sealing performance
1. Technical Field
This disclosure generally relates to database query optimizations, and more specifically relates to a query optimizer that takes network choice into consideration when executing a query in a system that includes multiple nodes and multiple network paths.
2. Background Art
Database systems have been developed that allow a computer to store a large amount of information in a way that allows a user to search for and retrieve specific information in the database. For example, an insurance company may have a database that includes all of its policy holders and their current account information, including payment history, premium amount, policy number, policy type, exclusions to coverage, etc. A database system allows the insurance company to retrieve the account information for a single policy holder among the thousands and perhaps millions of policy holders in its database.
Retrieval of information from a database is typically done using queries. A database query typically includes one or more predicate expressions interconnected with logical operators. Database query optimizers have been developed that evaluate queries and determine how to best execute the queries based on a number of different factors that affect query performance. However, none of the known query optimizers take into account the choice of network in executing a query. As a result, known query optimizers cannot optimize a query based on characteristics of multiple networks.
BRIEF SUMMARYIn a networked computer system that includes multiple nodes and multiple networks interconnecting the nodes, a database query optimizer takes network choice into consideration when optimizing a query. The query optimizer logs historical information for queries that includes network information. A network monitor determines network characteristics of the multiple networks. The query optimizer then selects a network for a query based on the network characteristics, and optionally based on the historical information as well. The result is a query optimizer that takes network choice into consideration, thereby providing a query that is optimized according to the characteristics of the networks.
The foregoing and other features and advantages will be apparent from the following more particular description, as illustrated in the accompanying drawings.
The disclosure will be described in conjunction with the appended drawings, where like designations denote like elements, and:
Computer systems have been developed that include multiple nodes coupled to each other via multiple different network paths. The BlueGene supercomputer family developed by IBM includes thousands of compute nodes coupled together via multiple different networks. For example, in the BlueGene architecture, nodes are interconnected by both a torus network and a logical tree network. The torus network connects the nodes in a three-dimensional mesh with wrap around links. The logical tree network connects all nodes in a binary tree configuration, where each node has a parent and two children, although some nodes may have one or zero children, depending on the hardware configuration. In the BlueGene architecture, the torus and logical tree networks are independent networks, which means they do not share network resources such as links or packet injection FIFOs.
When nodes are interconnected with different independent networks, as in the case of the BlueGene architecture, the choice of which network to use can affect the performance of database queries that include other nodes. As a result, a query optimizer can now take into account the choice of network when executing a database query. Known query optimizers take many things into consideration when optimizing a database query, but no known query optimizer has taken network choice into consideration when executing a query.
The claims and disclosure herein provide a query optimizer that takes network choice into consideration when executing a query. The query optimizer logs historical information for queries that indicates past network selection when executing a query. A network monitor determines network characteristics for each of the networks. The query optimizer may then select a network based on attributes of the query itself, based on the historical information, and based on the network characteristics. The result is a query optimizer that can more optimally execute queries by taking network choice into consideration when executing a query on a node in a networked computer system that is coupled via multiple networks to other nodes.
Referring to
Some specific examples of network characteristics 124 are shown in the table of
Referring to
Main memory 120 preferably contains data 121, an operating system 122, a network monitor 123, and a database query optimizer 125. Data 121 represents any data that serves as input to or output from any program in computer system 100. Operating system 122 is a multitasking operating system known in the industry as i5/OS; however, those skilled in the art will appreciate that the spirit and scope of this disclosure is not limited to any one operating system. Network monitor 123 is a software mechanism that monitors characteristics of the multiple networks coupled to computer system 100. The network monitor logs these characteristics as network characteristics 124. The database query optimizer includes a network selection mechanism 126 and historical information 127. When the query optimizer 125 executes a database query, it logs historical information 127 that includes choice of network information. The network selection mechanism 126 takes network choice into consideration when executing a query by looking at attributes of the query itself and/or network characteristics 124 and/or historical information 127 for the query. By taking network choice into consideration when executing a query, the query optimizer 125 may enhance the performance of the query.
Computer system 100 utilizes well known virtual addressing mechanisms that allow the programs of computer system 100 to behave as if they only have access to a large, single storage entity instead of access to multiple, smaller storage entities such as main memory 120 and DASD device 155. Therefore, while data 121, operating system 122, network monitor 123 and query optimizer 125 are shown to reside in main memory 120, those skilled in the art will recognize that these items are not necessarily all completely contained in main memory 120 at the same time. It should also be noted that the term “memory” is used herein generically to refer to the entire virtual memory of computer system 100, and may include the virtual memory of other computer systems coupled to computer system 100.
Processor 110 may be constructed from one or more microprocessors and/or integrated circuits. Processor 110 executes program instructions stored in main memory 120. Main memory 120 stores programs and data that processor 110 may access. When computer system 100 starts up, processor 110 initially executes the program instructions that make up operating system 122.
Although computer system 100 is shown to contain only a single processor and a single system bus, those skilled in the art will appreciate that a query optimizer that takes network choice into consideration may be practiced using a computer system that has multiple processors and/or multiple buses. In addition, the interfaces that are used preferably each include separate, fully programmed microprocessors that are used to off-load compute-intensive processing from processor 110. However, those skilled in the art will appreciate that these functions may be performed using I/O adapters as well.
Display interface 140 is used to directly connect one or more displays 165 to computer system 100. These displays 165, which may be non-intelligent (i.e., dumb) terminals or fully programmable workstations, are used to provide system administrators and users the ability to communicate with computer system 100. Note, however, that while display interface 140 is provided to support communication with one or more displays 165, computer system 100 does not necessarily require a display 165, because all needed interaction with users and other processes may occur via one or more of the network interfaces.
Network interfaces, shown in
At this point, it is important to note that while the description above is in the context of a fully functional computer system, those skilled in the art will appreciate that the query optimizer may be distributed as a program product in a variety of forms, and the claims extend to all suitable types of computer-readable media used to actually carry out the distribution. Examples of suitable computer-readable media include: recordable media such as floppy disks and CD-RW (e.g., 195 of
Embodiments herein may also be delivered as part of a service engagement with a client corporation, nonprofit organization, government entity, internal organizational structure, or the like. These embodiments may include configuring a computer system to perform some or all of the methods described herein, and deploying software, hardware, and web services that implement some or all of the methods described herein. These embodiments may also include analyzing the client's operations, creating recommendations responsive to the analysis, building systems that implement portions of the recommendations, integrating the systems into existing processes and infrastructure, metering use of the systems, allocating expenses to users of the systems, and billing for use of the systems.
Referring to
When executing a query that involves selecting a network, the query optimizer preferably logs historical information including the network selection so this historical information may be used the next time a query is executed (e.g., see step 450 in
The network monitor 123 in
Method 700 in
The network monitor 123 preferably stores information it determines from the networks as network characteristics 124 shown in
Now we present some simple examples to illustrate how a query optimizer can take network choice into consideration when executing a database query. Let's assume a query references data stored on a single node. One suitable criteria for the query optimizer is to choose the fastest available network to the node based on the network characteristics. In a different example, we assume data is located on different nodes. For a read or write, the query optimizer could choose the network with good “gather” characteristics, such as a logical tree network. For both reads and writes, the query optimizer could choose the network with good “all-to-all” characteristics, such as a mesh or torus network. In all cases, link contention and busy networks preferably would be avoided.
Allowing a query optimizer to take network choice into consideration when executing a query is a powerful concept, especially when used in a massively parallel computer system such as a BlueGene computer system developed by IBM. BlueGene is well-suited to databases that are partitioned over a number of different nodes, thereby requiring many different nodes to be involved in processing a query. In this environment, the intelligent selection of which network to use when a query optimizer processes a query can significantly improve query performance.
One skilled in the art will appreciate that many variations are possible within the scope of the claims. Thus, while the disclosure is particularly shown and described above, it will be understood by those skilled in the art that these and other changes in form and details may be made therein without departing from the spirit and scope of the claims. For example, any suitable heuristic or criteria may be used to select a network for executing a database query. The disclosure and claims herein expressly extend to any suitable heuristic or criteria for a query optimizer to select a network for executing a database query. In addition, while the examples herein describe the selection of a single network for executing a query, the disclosure and claims herein expressly extend to selecting multiple networks for executing a query.
Claims
1. A computer-implemented method for executing a query to a distributed database in a networked computer system that is coupled to a plurality of networks, the method comprising the steps of:
- (A) providing a plurality of nodes coupled to the plurality of networks, each of the plurality of networks comprising a communication path between at least two of the plurality of nodes, each node comprising at least one processor and memory, the plurality of nodes comprising the distributed database with a first node including first data in the distributed database and a second node including second data in the distributed database, the plurality of networks allowing communication between the plurality of nodes;
- (B) on a third of the plurality of nodes, executing the query that retrieves the first data in the distributed database and the second data in the distributed database by performing the steps of: (B1) determining characteristics of the plurality of networks between the first, second and third nodes; and (B2) selecting at least one of the plurality of networks for executing the query to the distributed database according to the characteristics of the plurality of networks between at least two nodes involved in processing the query and according to historical information that includes which of the plurality of networks were used during at least one previous execution of the query.
2. The method of claim 1 wherein step (B) selects the at least one of the plurality of networks based on at least one parameter in the query that specifies which network to select when executing the query.
3. The method of claim 1 wherein step (B) selects the at least one of the plurality of networks based on layout of the at least two nodes involved in processing the query.
4. The method of claim 1 wherein the characteristics of the plurality of networks comprise network topology.
5. The method of claim 1 wherein the characteristics of the plurality of networks comprise network utilization.
6. The method of claim 1 wherein the characteristics of the plurality of networks comprise network latency.
7. A computer-implemented method for executing a query to a distributed database in a networked computer system that includes a plurality of networks, the method comprising the steps of:
- (A) providing a plurality of nodes coupled to the plurality of networks, each of the plurality of networks comprising a communication path between at least two of the plurality of nodes, each node comprising at least one processor and memory, the plurality of nodes comprising the distributed database with a first node including first data in the distributed database and a second node including second data in the distributed database, the plurality of networks allowing communication between the plurality of nodes;
- (B) on a third of the plurality of nodes, executing the query that retrieves the first data in the distributed database and the second data in the distributed database by performing the steps of: determining whether the query specifies a network for executing the query; when the query specifies the network for executing the query, and when the specified network is available, using the specified network to execute the query; when the query does not specify the network for executing the query, performing the steps of: determining which of the plurality of nodes are involved in processing the query; determining whether layout of the plurality of nodes involved in processing the query determines which network to use in processing the query; when the layout of the plurality of nodes involved in processing the query determines which network to use in processing the query, and when the determined network is available, processing the query using the determined network; when the layout of the plurality of nodes involved in processing the query does not determine which network to use in processing the query, determining available networks for processing the query from a network monitor, and using at least one of the available networks to process the query.
Type: Application
Filed: Feb 18, 2013
Publication Date: Jun 20, 2013
Patent Grant number: 10452654
Applicant: INTERNATIONAL BUSINESS MACHINES CORPORATION (Armonk, NY)
Inventor: International Business Machines Corporation (Armonk, NY)
Application Number: 13/769,734
International Classification: G06F 17/30 (20060101);