WO2016092604A1 - Data processing system and data access method - Google Patents
Data processing system and data access method Download PDFInfo
- Publication number
- WO2016092604A1 WO2016092604A1 PCT/JP2014/082366 JP2014082366W WO2016092604A1 WO 2016092604 A1 WO2016092604 A1 WO 2016092604A1 JP 2014082366 W JP2014082366 W JP 2014082366W WO 2016092604 A1 WO2016092604 A1 WO 2016092604A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- query
- dbms
- external
- unit
- server
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
Definitions
- Information communication systems especially the use of database management systems in information systems.
- DBMS database management systems
- Patent Document 1 As a means for processing data by combining data of a plurality of database management systems (hereinafter referred to as DBMS), in Patent Document 1, a user registers an external function so that a query to another DBMS is sent to another DBMS. Send and get the execution result.
- DBMS database management systems
- the DBMS that manages the external data is optimally configured for the queries required by the analysis server. There is a problem that it takes time to execute the query. In particular, when a plurality of DBMSs to be combined operate on the same physical computer, there is no method for processing a query by changing to an optimal configuration based on the processing contents of the query and the analysis process being executed.
- the query processing provided by the present invention has a function of changing a configuration in which a part of the processing is executed by an external DBMS to a configuration in which the management server and the external DB server can cooperate to execute the query at high speed.
- the configuration change function for each query also realizes control suitable for each query by changing the configuration based on the priority according to the analysis server or the user.
- the resource adjustment unit of the management server inquires the external DBMS about an execution plan when the external DBMS executes the target query.
- the plan information linkage unit of the external DBMS provides the management server with an execution plan of a query executed by the DBMS.
- the resource adjustment unit of the management server manages the resources of the external DB server, specifies the resources necessary to execute the query quickly by acquiring and combining the execution plans of the queries executed by the external DB server, Request resource allocation to an external DB server.
- the external DB server adjusts the resource allocation based on the contents of the query and executes the query. Can be executed with
- FIG. 1 shows a configuration of a data processing system targeted by the present invention.
- 7 shows a query processing flow in the embodiment. 7 shows a query processing flow in the embodiment. 7 shows a query processing flow in the embodiment.
- An example of a query is shown.
- generation part of the analysis server is shown.
- the processing flow of the external query process part in an Example is shown.
- the example of the execution management table in an Example is shown.
- the example of the analysis DB information which the analysis DB management part of a management server manages in the Example is shown.
- the example of the user information which the analyst information management part of a management server manages in the Example is shown.
- surface which the resource adjustment part of a management server manages in the Example is shown.
- the processing flow in which the resource adjustment unit determines resource allocation from the plan cost information received from the external DB server and transmits the resource allocation information to the external server is shown.
- the processing flow in which the resource adjustment unit determines resource allocation from the plan cost information received from the external DB server and transmits the resource allocation information to the external server is shown.
- the resource adjustment unit receives a query execution completion from the analysis server and recalculates the resource allocation.
- An example of an external DB server resource managed by the resource adjustment unit is shown.
- the example of the resource allocation table which a resource adjustment part manages is shown.
- the example of the information of the external DB server which the external DB management part of a management server manages is shown. Another example query is shown. An embodiment in which the function of the management server exists in the external DB server is shown. An embodiment in which an external DB server is composed of a plurality of servers and a shared storage is shown. In the embodiment, the external DB server is composed of a plurality of servers, and the storage of each server stores different external DB data.
- FIG. 1 shows the configuration of a data processing system targeted by the present invention.
- the analysis server 1 (100) is a computer on which the database management system DBMS1 (101) operates.
- the analysis server 1 (100) has a hardware configuration in which a CPU 151, a memory 153, a disk 155, and a network interface card (NIC 157) used for communication with other computers are connected by a system bus (not shown).
- the operating system (OS 159) controls hardware and application software.
- DBMS1 (101) is data processing software that operates as one of the applications of the OS 159 and has the following functions.
- the communication unit 103 includes an external input / output unit 141 used for information communication with the outside of the DBMS.
- the communication destination includes a query distribution unit 143 and a query collection unit 145 including an analysis application, a DB management console, a management server, and an external DBMS.
- the access management unit 105 determines whether a request arriving at the external input / output unit 141 of the DBMS 1 (101) can be processed.
- the information that is the basis of the determination includes a user name, password, authority information set for the user name, connection source computer name, connection source IP address, and authority information set for the data to be accessed. .
- the SQL analysis unit 107 analyzes a query written in SQL received from the client, and confirms the grammar. In addition, the character string query is broken down into meaningful units such as tokens for later processing.
- the plan generation unit 109 determines a query execution plan (internal processing order) by using data information such as the execution record and size stored in the DBMS 1 (101). In the present embodiment, description will be made using a cost-based plan.
- the external query processing unit 111 is a unique part in the present invention, and operates when requesting a processing result of an external DBMS in processing a query.
- the SQL execution unit 113 executes a query by manipulating data based on the query execution plan generated by the plan generation unit 109.
- Analysis data 120 indicates data managed by DBMS 1 (101).
- DBMS 1 data managed by DBMS 1 (101).
- a sales table 123 that stores the sales of each product for each period, and an index 121 that is data for efficiently operating the sales table are illustrated.
- the remote DB data 130 retains the type of data that needs to refer to the external DBMS and the latest data when analyzing the analysis data 120 and the data in the external DBMS in combination.
- economic index data (131) possessed by DBMS3 (340), which will be described later, and SNS data (133) possessed by DBMS4 (370) can be referred to.
- data processing software is described here as a database management system, software in which a query processing function is added to a data processing base such as Apache (TM) Hadoop (R) may be used.
- TM Apache
- R Hadoop
- analysis DBMSs that use external DBMSs, such as DBMS 2 (401) of analysis server 2 (400) as well as analysis server 1 (100).
- the management server 200 instructs the configuration change of the external DBMS in accordance with the query to be processed. Similar to the analysis server 1 (100), the management server 200 is a computer having a CPU 201, a memory 203, a disk 205, and a NIC 207 as hardware and connected by a system bus (not shown). As an application of an operating system (OS) 209 that operates on the management server 200, software that manages information necessary for configuration change operates.
- OS operating system
- the resource adjustment unit 211 receives a query and a query execution plan from the DBMS1 (101) and DBMS2 (401), and instructs a configuration change from the management unit information described later and the execution plan of the external DBMS.
- the external DB management unit 221 manages basic information of an external DBMS that can be used by the analysis server.
- the analysis DB management unit 223 manages basic information of an analysis server that uses an external database.
- the analyst information management unit 225 manages the correspondence between the user priority in each analysis server and the priority when using an external DBMS.
- the management server 200 is described as an independent server. However, the same processing may be performed by an analysis server or an external DB server (an example in which an operation is performed by an external DB server is described in the second embodiment). ).
- the external DB server 300 is a server that operates a DBMS that is used as an auxiliary to the analysis separately from the analysis DBMS. Similar to the analysis server 1 (100) and the management server 200, the basic hardware and system software include a CPU 301, a memory 303, a disk 305, a NIC 307, and an OS 309.
- the external DB server 300 stores two types of data as an example.
- DBMS 3 (340) manages economic indicators 357
- DBMS 4 (370) manages information (387) exchanged by social networking service (SNS).
- SNS social networking service
- DBMSs are managed by different DBMSs because the optimum management method differs for each type of data.
- the DBMS 3 (340) and the DBMS 4 (370) have the same configuration for explanation.
- the communication units 341 and 371 include reception units 432 and 372 and transmission units 344 and 374, respectively, and communicate with the upper DBMS and the management server 200.
- the access management units 343 and 373 have the same role as the access management unit 105 of the DBMS 1 (101).
- the SQL analysis units 345 and 375 have the same role as the SQL analysis unit 107.
- the plan generation units 347 and 377 generate an execution plan for processing the query.
- the plan information cooperation units 349 and 379 are one of the features of the present invention, and perform preprocessing to process the query generated by the external query processing unit 111 of the DBMS 1 (101). Further, regarding preprocessing, the communication units 341 and 371 are used to cooperate with the management server 200 and the resource allocation unit 320.
- the query processing units 352 and 382 have the same role as the SQL execution unit 113.
- the DB basic information management units 353 and 383 hold management information of the DBMS.
- the resource allocation unit 320 changes the resources allocated to the DBMS 3 (340) and the DBMS 4 (370) in cooperation with the function of the OS (309) and the DB basic information management unit (353, 383) based on the instruction of the management server 200. To do.
- each DBMS may be operating on a separate server.
- Each DBMS may operate as a process of the OS (309) or a process on a virtual machine realized by a virtualization mechanism supported by a recent computer.
- each DBMS does not use the emulation necessary for virtual machine execution, but the name space of various resources is different and usage is tuned by the container mechanism provided by the OS (309) and other system software. It may operate as a container.
- the analysis application uses an analysis database and an external database via the analysis database.
- the client 1 (500) has the same hardware and OS as the analysis server 1 (100).
- the DB management console 1 (503) has a function of managing the DBMS 1 (101) and can set a connection for using an external DBMS.
- the analysis application 1 (501) is an application program that issues a query for data analysis.
- FIG. 1 shows a client 2 (510) and a client 3 (520) as an example in addition to the client 1 (500).
- the client and server, and the server are connected by a network (561, 563).
- FIG. 2 shows the flow of processing when the analysis application 1 requests the analysis server 1 for an analysis query that combines the data of the analysis server and the external DB server in the system of FIG.
- the external input / output unit 141 of the DBMS 1 (101) receives the query transmitted by the analysis application 1 (501) (step S1001).
- the access management unit 105 and the SQL analysis unit 107 of the DBMS 1 (101) authenticate and analyze the received query.
- the access management unit 105 determines whether or not the query is issued from a user whose processing is permitted by the DBMS 1 from the user name and password used for the connection.
- the SQL analysis unit 107 divides the authenticated query in units of meaningful character strings (tokens) and determines whether the query conforms to the SQL grammar.
- the access management unit 105 checks whether the user who has requested the query has the access authority to the table to be operated.
- the plan generation unit 109 generates a function used when executing the query, the order of execution, and the processing cost as an execution plan (step S1003). Although not shown in FIG. 1, the statistical information accumulated in the processing so far is used for generating the execution plan. Note that at the time of step S1003, the process using the external DB server does not need to know the detailed cost value.
- the external query processing unit 111 of the DBMS 1 (101) is a part that is one of the features of the present invention, and specifies a part to be processed by the external DB server from the received query (step S1006).
- the external query processing unit 111 refers to the query and the execution plan of the query, and sets the query that refers to the remote DB data 130 as the processing target of the external DB server.
- the external query processing unit 111 defines, as a section, a query that can be requested in parallel for a query processed by the external DB server. For example, for the product information stored in the sales table of the analysis server, the query shown in FIG.
- FIG. 5 for examining the relationship between the sales in the top 10 districts, the economic status of the relevant district, and the number of appearances in the SNS is shown in FIG. It becomes an execution plan.
- functions used such as scan, filter, and combination to be used for executing a query, and an estimate for executing the function are illustrated.
- a section is defined in which a query is requested in parallel to the DBMS 3 (340) that manages the economic index and the DBMS 4 (370) that manages the SNS.
- the external query processing unit 111 of the DBMS 1 (101) executes query conversion on the part processed by the external DB server specified in step S1006 among the queries received in step S1001, and the converted query and corresponding execution are executed.
- the plan and cost information (plan cost information) are transmitted to the management server 200 (step S1008). Details of the query conversion are shown in FIG.
- the external query processing unit 111 uses the function of the query distribution unit 143 to transmit the converted query and plan cost information to be executed by the external DB server to the management server 200.
- the resource adjustment unit 211 of the management server 200 receives the new query and plan cost information of the analysis server transmitted in step S1008.
- the resource adjustment unit 211 analyzes the received query, and requests detailed plan cost information for executing the query in the external DB server for each external DB server (step S1022).
- the DBMS receiving units (342, 372) operating on the external DB server 300 receive the plan cost information presentation request from the management server 200.
- the access management unit (343, 373) confirms that the reception is a request from the management server 200 (step S1032).
- the DBMS plan information linkage unit (349, 379) operating on the external DB server 300 is one of the features of the present invention. Based on the request from the management server, the execution plan can be generated without executing the query. And has a function of notifying the resource adjustment unit of plan cost information.
- the plan information cooperation unit (349, 379) takes out the query included in the plan cost information presentation request, and requests the SQL analysis unit (345, 375) for analysis.
- the SQL analysis unit (345, 375) analyzes the character string constituting the query, and returns the result to the plan information cooperation unit (349, 379).
- the plan information cooperation unit (349, 379) passes the analysis result to the plan generation unit (347, 377), and requests the execution plan generation of the query.
- the plan generation unit (347, 377) calculates an execution plan and a cost estimate for executing the query (in the case of the query in FIG. 5, the inside of the dotted line in FIG. 6 corresponds, except for the underlined portion).
- the plan information cooperation unit (349, 379) calculates, from the calculated cost, characteristic information such as whether a CPU or I / O is important, necessary resources, parallel execution degree, etc. when executing a query. .
- the characteristic information includes the degree of using the CPU calculated from the cost, the degree of emphasizing I / O, the possible parallelism within the DBMS, and the output format of the result. In the case of the query in FIG. 5, the underlined information in FIG. 6 corresponds.
- the degree of emphasis on I / O increases because random disk I / O is involved.
- the degree of parallel execution is calculated from the data storage method and the query processing method.
- the degree of parallelism decreases because the process is unified even if there are abundant calculation resources.
- the degree of parallelism can be increased.
- a result output format there are a case where the result can be returned every time data matching the condition is found, and a case where the result is collectively output for aggregation.
- the plan information cooperation unit (349, 379) requests the transmission unit (344, 374) to transmit the plan cost information including the characteristic information.
- the transmission units (344, 374) transmit the requested plan cost information to the management server 200 (step S1045).
- the resource adjustment unit 211 of the management server 200 receives the processing result from the external DB server (step S1051).
- FIG. 3 shows a continuation of FIG. 2 and subsequent diagrams of the query processing flow in the embodiment.
- the resource adjustment unit 211 includes plan cost information received from the external DB server, external DBMS information managed by the external DB management unit 221, analysis server information managed by the analysis DB management unit 223, and analyst information management unit 225. Based on the user information to be managed, the configuration of the external DB server for processing the query requested by the analysis server is calculated (step S1053). Details will be described later.
- the resource adjustment unit 211 requests the resource allocation unit 320 of the external DB server 300 to change the configuration as resource allocation information (step S1055).
- the resource allocation unit 320 of the external DB server 300 receives the resource allocation information transmitted in step S1055, and changes the configuration of resources allocated to the DBMS based on the resource allocation information. After changing the assignment, the resource assignment unit 320 transmits assignment completion to the management server 200 (step S1062).
- the resource adjustment unit 211 of the management server 200 receives the assignment completion transmitted in step S1065 (step S1071).
- the resource adjustment unit 211 transmits the query processing completion of the external DBMS as a reply to the converted query and the plan cost information received in step S1008 to the DBMS1 (101) of the analysis server 1 (100) (step S1073). At this time, hint information for correcting the execution plan of the query may be transmitted at the same time.
- the external query processing unit 111 of the DBMS 1 (101) receives the query processing preparation completion transmitted in step S1073 using the function of the query collection unit 145 (step S1081). If there is hint information for correcting the execution plan, the process may return to step S1003 and the execution plan may be corrected again.
- the SQL execution unit 113 of the DBMS 1 (101) starts query processing according to the execution plan (step S1083).
- FIG. 4 shows a continuation of FIG. 3 and subsequent drawings of the query processing flow in the embodiment.
- the SQL execution unit 113 When the SQL execution unit 113 refers to external DBMS information, the SQL execution unit 113 transmits a query to the external DB server via the external query processing unit 111.
- the external query processing unit 111 transmits the converted query to the external DB server using the function of the query distribution unit 143 (step S1085).
- the DBMS (340, 370) operating on the external DB server 300 receives and executes the query transmitted from the DBMS1 (101), and transmits the processing result (step S1091).
- the receiving units (342, 372) receive the query transmitted from the DBMS1 (101).
- the access management unit (343, 373) of the DBMS operating on the external DB server 300 confirms that the received query is communication from a correct server and an authorized user.
- the SQL analysis unit (345, 375) of the DBMS analyzes a character string constituting the query.
- the plan generation unit (347, 377) generates, as an execution plan, the order of processing when executing a query and the calculation method to be used.
- the query processing units (352, 382) execute the operation of data held in the DBMS based on the plan generated by the plan generation unit (347, 377).
- the execution result of the query is transmitted to the DBMS 1 (101) of the analysis server 1 (100) that issued the query by the transmission unit (344, 374).
- the query collection unit 145 of the DBMS 1 (101) receives the execution result of the query requested in step S1085 from the external DB server, and advances the query processing (step S1111).
- the external query processing unit (111) of the DBMS1 (101) performs the execution to the management server 200 by using the function of the query distribution unit 143 when the specific section specified in step S1073 ends (including the completion of the query). The completion of the section is notified (step S1119).
- the resource adjustment unit 211 of the management server 200 receives the section end notification from the DBMS 1 (101) (step S1131).
- the resource adjustment unit 211 of the management server 200 calculates the resource allocation again from the section completion notification, the query and plan cost information received in step S1022, and the resource allocation calculated in step S1053 (step S1133).
- the resource adjustment unit 211 of the management server 200 transmits the calculated resource allocation information to the external DB server when the allocation is necessary again (step S1135).
- step S1062 The processing in the external DB server has already been described as step S1062.
- the resource adjustment unit 211 of the management server 200 receives the resource allocation change result from the external DB server, and confirms the resource allocation result (step S1071).
- the DBMS 1 (101) transmits the query execution result received in step S1001 to the analysis application 1 (501) from the external input / output unit 141 (step S1117).
- FIG. 7 shows a processing flow of the external query processing unit 111 of the analysis server 1 (100).
- the external query processing unit 111 converts (1) a part of the query received from the client to be executed by the external DB server (steps S1006 and S1008), and (2) a reception process of query processing preparation completion transmitted from the management server ( (Step S1081), (3) Query transmission to external DB server (Step S1085), (4) Query execution result reception from external DB server (Step S1111), (5) End of section to management server at end of section (Step S1119) are five main functions.
- the external query processing unit 111 When the external query processing unit 111 is called, it first determines whether it is a call from the plan generation unit 109 and conversion of a new query is requested (step S2001). When it corresponds, the process after step S2003 is performed (function (1)). As a determination method, there are a method of holding a caller module name in a transaction management data structure not shown in FIG. 1 and the like, and a method of holding a flag indicating whether or not query conversion is completed.
- the external query processing unit 111 searches for an execution plan of the query from the execution plans managed by the plan generation unit 109 (step S2003).
- the search includes a method of making an inquiry to the plan generation unit 109 and having pointer information to the execution plan in the management data structure.
- the external query processing unit 111 specifies a portion of the execution plan acquired by the search that requires a query to the external DBMS, determines whether the query can be executed in parallel on a plurality of external DBMSs, A section is set in the executable part (step S2005).
- the external query processing unit 111 first identifies a part that needs to be inquired of an external DBMS when a table to be operated in the execution plan is managed by the remote DB data 130. For example, as shown in FIG. 6, the economic index table is referred to in the query for analyzing the district where the sales of the product X shown in FIG. 5 are high, the economic index of the district, and the SNS information about the product (A).
- the part (a) referring to the SNS table is an inquiry to the external DBMS.
- the external query processing unit 111 determines a portion that can be executed in parallel in the execution plan for inquiring an external DBMS, sets a unit that can be executed in parallel as a section, and sets an ID for each section.
- the external query processing unit 111 uses data dependent on the execution plan and information on functions used in order to identify parallel execution locations. The portion where the subsequent processing cannot be performed unless the data is prepared becomes the boundary of the section.
- the part for calculating the data to be combined can be executed independently if there is a sufficient computing resource, so that it can be determined that the part can be executed in parallel.
- the parts (a) and (b) are processes that can be calculated after the district ID is calculated, and are based on nested loop joins that are generally processed in parallel in a parallel DBMS. For the data acquisition process, it is determined as the same section.
- the external query processing unit 111 gives information such as analysis server information, user information requesting the query, and transaction ID in addition to the section ID to the query (step S2007).
- the analysis server information includes a server name and an IP address.
- As a setting method there are a method of using the comment sentence shown in step S2005 and a method of adding to a part of data to be sent to the management server.
- the external query processing unit 111 transmits the query and the plan cost information to the management server 200 using the function of the query distribution unit 143 (step S2009).
- the external query processing unit 111 is a call to the query collection unit 145, and determines whether the message passed is ready for query processing (step S2021). When it corresponds, it progresses to step 2027 (function (2)). If not, the process proceeds to step S2031.
- the external query processing unit 111 calls the SQL execution unit 113 and starts executing a query using data of the external DB server (step S2027). Although not shown in this flow, when the query processing preparation completion message includes hint information for plan correction of the external DB, this flow may be terminated and the process may return to step S1008.
- the external query processing unit 111 determines from the communication contents whether the called trigger is a call from the query collection unit 145 and reception of a query processing result (step S2031). If applicable, the process proceeds to step S2033 (function (4)). Otherwise, the process proceeds to step S2041.
- the external query processing unit 111 determines whether it is an execution request to the external DB server by a call from the SQL execution unit 113 (step S2041). When it corresponds, it progresses to step S2043 (function (3)). If not, step S2045 is executed (function (5)).
- the external query processing unit 111 uses the query distribution unit 143 to send the corresponding part of the query converted in step S2007 to the target external DB server in order to acquire the data of the external DBMS required by the SQL execution unit 113. (Step S2043).
- the external query processing unit 111 determines whether the query currently being executed has been completed or whether all the queries have been completed. Confirmation is made (step S2045).
- the external query processing unit 111 uses the function of the external input / output unit 141 to transmit information about the external DBMS and the completed section to the management server 200.
- the resource adjustment unit 211 of the management server 200 executes the following four processes broadly: (1) Request plan cost information from the external DB server, (2) Assign resources from the plan cost information received from the external DB server And send resource allocation information to the external DB server, (3) receive resource allocation completion from the external DB server, send query preprocessing completion to the analysis server, and (4) receive query execution completion from the analysis server Then, the resource allocation is recalculated and the resource allocation of the external DB server is changed as in (2).
- the process (1) of the resource adjustment unit 211 corresponds to step S1022 shown in FIG.
- the resource adjustment unit 211 receives the query and the plan cost information from the DBMS 1 (101) of the analysis server 1 (100)
- the resource adjustment unit 211 registers the query information in the execution management table 1100 illustrated in FIG.
- the execution management table 1100 is a data structure that holds information about a query being executed while the analysis server requests a query from an external DBMS.
- the execution management table 1100 holds the identifier (1101) of the analysis DB server, the transaction ID (1103) assigned by the analysis DB server, the total number of sections of the requested query (1105), and the section ID (1107) currently being executed. To do.
- external DB server information the external DBMS (1109) being used, the status of the query (1111), the number of messages waiting for a response (1113), and the ratio of target resources to be set in the external DBMS (1115) It has information on the setting resource (1117) actually set, and a pointer (1118) to a resource allocation table allocated for each external DBMS. Further, a list (1119) of a section for changing the resource allocation, information (1121) of the address where the requested query is recorded, and data (1123) for referring to the plan cost information acquired from the analysis server and the external DB server ). In FIG. 8, information (transaction ID 1) of a query requested by DBMS 1 is registered as 1151.
- the query received by the resource adjustment unit 211 from the analysis server includes the analysis DBMS information, user information, external DBMS information, and the like given by the external query processing unit 111 of the DBMS 1 (101) in step S2007 in addition to the SQL sentence. Embedded.
- the section information calculated by the query processing unit 111 in step S2005 is added to the cost-based execution plan used in a general DBMS.
- the query plan executed by the external DBMS at this time is not necessarily accurate. For example, in the query of FIG. 5, the cost of (a) (b) in the plan of FIG.
- the resource adjustment unit 211 inquires the external DB server for detailed plan cost information of a query executed by the external DB server. Specifically, a query for which a section is set is extracted for each external DB server from the query character string.
- the resource adjustment unit 211 manages information for connecting to an external DBMS and information on a server on which an external DB server operates, using external database information 2100 shown in FIG.
- the resource adjustment unit 211 specifies the host name, IP address, and port number for inquiring plan cost information by combining the extracted query and the external database information 2100.
- the resource adjustment unit 211 transmits a plan cost information inquiry message to the specified destination for the external DBMS.
- the resource adjustment unit 221 changes the status 1111 of the execution management table 1100 during the plan inquiry.
- the process (2) of the resource adjustment unit 211 receives the plan cost information inquired from the external DBMS and determines the resource allocation.
- the resource adjustment unit 211 receives the above-described inquiry result of the plan cost information from the external DBMS for each section.
- the resource procurement unit 211 receives from the external DB server the plan cost information of the query that the analysis server requests to the external DBMS.
- the resource adjustment unit 211 decreases the response waiting 1113 that holds the number of messages waiting for a response to the query in the execution management table 1100 by one.
- the resource adjustment unit 211 determines whether the response waiting 1113 of the query is 0. If 0, message reception is complete. If it is not 0, the resource adjustment unit 211 waits for the arrival of the plan cost information because all the plan cost information from the external DBMS has not arrived.
- FIG. 12 shows a processing flow when determining the resource allocation of the external DB server. This flow is a detailed version of step S1053.
- the resource adjustment unit 211 first searches the analysis DB information 1200 shown in FIG. 9 and acquires the priority of the DBMS that requested the query (step S4201).
- the analysis DB information 1200 stores the DBMS name, IP address, priority, and the like of the analysis server that requests the query.
- the analysis DB information 1200 is data managed by the external DB management unit 221 and is updated by a system administrator or a system management program (not shown in FIG. 1) when an analysis server is added to or deleted from the information system.
- the resource adjustment unit 211 extracts user information included in the query 1121 of the execution management table 1100.
- the resource adjustment unit 211 searches the user information 1300 shown in FIG. 10, and acquires the priority when using the external DB server from the analysis DBMS name and user name that requested the query (step S4203).
- the user information 1300 in FIG. 10 is data managed by the analyst information management unit 225, and is updated by the system administrator or the system management program in accordance with the analysis server change and the user change.
- the resource adjustment unit 211 refers to the priority correspondence table 1400 in FIG. 11 and acquires the target priority corresponding to the DBMS priority obtained in step S4201 and the user priority obtained in step S4203 (step S4203). S4207).
- the priority correspondence table 1400 is a correspondence table between query priorities and target allocation resource amounts managed in advance by the resource adjustment unit 211.
- the resource adjustment unit 211 assigns the acquired target allocation resource amount to the target allocation resource 1115 of the execution management table 1100 as the target allocation resource amount of the query.
- the resource adjustment unit 211 recalculates the section and calculates the number of the section whose allocation is changed from the plan cost information acquired from each external DBMS (step S4209).
- an external DBMS generates a plan for a query requested by the analysis server, the detailed cost of the plan and the parts that can be executed in parallel are known.
- the resource adjustment unit 211 reconfigures information related to a specific section of the DBMS based on the plan cost information. In the execution plan, the resource adjustment unit 211 sets a temporary internal section at a place where the processing time exceeds a certain time or a place where the degree of parallelism changes. For example, in the part (a) of FIG.
- the resource adjustment unit 211 calculates a basic allocation amount to be allocated until the first allocation change section is reached from the received plan cost information and the target resource calculated in step S4207 (step S4211).
- the basic allocation amount corresponds to the amount of resources to be allocated when no change is necessary in later determination processing, such as when the resources of the external DB server can be occupied in the execution of a query.
- the plan cost information includes the characteristic information in the query execution calculated in step S1034.
- the resource adjustment unit 211 refers to the characteristic information of the section to be allocated, and determines that the CPU resource for the query is increased when the CPU utilization characteristic of the execution plan is high. Also, the CPU resource allocation is increased even when the degree of parallel execution is high.
- I / O resources are increased. If the size of the operation target table exceeds a predetermined criterion, it is determined to increase the memory resource.
- a value determined for the entire system or a value set for each external DBMS may be used.
- the resource adjustment unit 211 checks whether or not the resource allocation target range is on a single external DB server within the execution interval of the query to be processed (step S4213).
- the resource adjustment unit 211 confirms whether or not the query is executed by a plurality of external DBMSs within the interval for calculating the resource allocation in the execution management table 1100 for the interval calculated in step S4209. For this purpose, referring to the external database information 2100 in FIG. 17, the physical server of the external DBMS to be executed is confirmed.
- the process proceeds to step S4215. Otherwise, the process proceeds to step S4233.
- step S4209 When the section is reconstructed in step S4209 when proceeding to step S4233, the section number of the entire query is updated (in the above example, “1-DBMS4-internal section 1” is changed to “section 1”, “ 1-DBMS4-internal section 2 "is set to” section 2 ").
- the resource adjustment unit 211 recalculates sections and allocation change sections with respect to DBMS queries operating on the same server (step S4215). First, the resource adjustment unit 211 recalculates the internal section calculated in step 4209 in consideration of a query that operates in parallel. Among plans executed in the section set by the analysis server, a plan that takes a certain time (eg, 60 seconds) for execution time estimation and returns a result to the analysis server is defined as a new section. The resource adjustment unit 211 adds a section number to the review section 1119 of the execution management table as a section for changing the allocation for a section exceeding a certain time.
- a certain time eg, 60 seconds
- the resource adjustment unit 211 executes certain sections N and N + 1, (a) one consumes a large amount of resource x in the section N, the other consumes a small amount of resource y in the section N + 1, or (b) one of them Allocation is also changed for a section where the resources used are greatly different at the change of section, such as a small consumption of resource x in section N and a large consumption of resource y in section N + 1 on the other side.
- the external query processing unit 111 of the analysis server 100 can use means for designating a section in which resource allocation is changed.
- the resource adjustment unit 211 refers to the plan cost information of each external DBMS in the section, and confirms the execution result output method and execution time (step S4217). For example, in a query composed of four sections that refer to DBMS3 and DBMS4, when section 1 and section 2 are executed with the same resource allocation in step S4215, the sum of the estimated execution times of section 3 and section 2 of DBMS3 is When the difference is larger (for example, three times) than the sum of the estimated execution times of the section 1 and the section 2 of the DBMS 4, it is determined to be true. Moreover, in the same example, if there is a section in which the results are returned little by little in the sections 1 and 2 of the DBMS 3 and the DBMS 4, the result is true. If the query has a relevant property, the process advances to step S4219. Otherwise, the process proceeds to step S4221.
- FIG. 13 shows a processing flow in which the resource adjustment unit 211 determines resource allocation following FIG.
- the resource adjustment unit 211 assigns resources preferentially to queries that return results little by little in step S4217 and queries that have a long execution time (step S4219). For example, in a query with a short execution time and a query that returns execution results collectively at the end, half of the calculation result of the basic allocation amount calculated in S4211 is allocated to a resource amount of a query with a long execution time and a query that returns results little by little. . When the results are returned little by little, the analysis server that has requested the query can start the subsequent processing based on the results by allocating resources preferentially.
- the resource adjustment unit 211 compares the CPU execution cost and the I / O load cost ratio among the plan cost information of queries executed by a plurality of external DBMSs in the same section (step S4221). If there is a bias exceeding the ratio determined by the system, the process proceeds to step S4223. Otherwise, the process proceeds to step S4225.
- the resource adjustment unit 211 distributes the CPU resource and the I / O resource according to the difference in the ratio when the query executed at the same time has different load characteristics between the CPU and the I / O (step S4223). For example, when the CPU usage cost of the DBMS 3 is 90, the I / O cost is 10, the CPU usage cost of the DBMS 4 is 10, and the I / O cost is 90 in a certain section, the DBMS 3 and the DBMS 4 The ratio of each usage cost is used as the resource allocation amount.
- the resource adjustment unit 211 determines whether the parallel execution degree of the query executed in the section is high (step S4225).
- the reference value used for the determination here can be (a) a reference value set in advance or (b) the number of cores assigned to the DBMS executing the query. If it is determined that the degree of parallelism is high, the process proceeds to step S4227. Otherwise, the process proceeds to step S4229.
- the resource adjustment unit 211 assigns the CPU (core) of the server on which the DBMS operates to the DBMS that executes the query in consideration of the priority (step S4227).
- the resource adjustment unit 211 holds a resource management table 2000 shown in FIG. 15 for each external DB server to be managed. In the resource management table 2000, the amount of resources, the amount of unallocated remaining resources, and the allocated resource amount for each DBMS operating on the server are managed for each type of resource mounted on the server.
- the resource adjustment unit 211 allocates a core to a DBMS of a query with a high degree of parallel execution within the allocation amount determined in step S4209.
- the resource adjustment unit 211 determines whether or not the work memory required from the cost is larger than a certain amount within the section to be executed with the same resource allocation (step S4229). If applicable, the process proceeds to step S4231. Otherwise, the process proceeds to step S4233.
- the resource adjustment unit 211 uses the allocation amount calculated in step S4207, the resource management table 2000 of the external DB server on which the query is executed, and the ratio calculated in step S4229.
- the memory capacity to be added to each DBMS is determined (step S4231).
- the resource adjustment unit 211 sets the resource allocation determined in the previous steps in the resource allocation table 1600 shown in FIG. 16 (step 4233).
- the resource allocation table 1600 is created for each transaction transmitted from the analysis server (101) to the external DB server for the number of external DBMSs to be used.
- the resource adjustment unit 211 determines the allocation, and records the target resource amount and the actually set resource amount for the elements of the resource to be allocated and executed by the resource allocation unit 320.
- the resource adjustment unit 211 sets a target allocated resource amount based on the resource allocation obtained by calculation and the resource amount in the resource management table 2000.
- the amount set as the target allocation resource in the resource allocation table 1600 is set to an ideal resource amount when the analysis server that requested the query can occupy the external DB server.
- the setting resource of the resource allocation table 1600 the same amount as the target allocation resource is registered as an initial value. For example, when another query is already operating and the query is executed in parallel, the adjusted resource amount is registered by calculation in a subsequent step such as step S4235.
- the resource adjustment unit 211 compares the resource amount set in step S4233 with the remaining resource amount in the resource management table 2000 of FIG. 15 to determine whether allocation is possible (step S4234). If so, complete the process. Otherwise, step S4235 is executed.
- the resource adjustment unit 211 refers to the setting resource 1117 and the priority correspondence table 1400 of the execution management table 1100 and searches for an allocation amount having a lower priority than the currently set resource 1117. For the type of resource to be allocated, the allocated resource amount at the searched allocation amount is calculated (step S4235).
- the resource adjustment unit 211 sends a resource allocation request to the external DB server used for executing the query.
- the flow of this process is as follows.
- the resource adjustment unit 211 subtracts the determined resource allocation and the value of the set resource of the resource allocation table 1600 from the remaining resource amount of the resource management table 2000, and adds it to the resource amount of each DBMS.
- the resource adjustment unit 211 determines whether to change the resources of a plurality of external DBMSs. When changing the resources of a plurality of external DBMSs, the resource adjustment unit 211 refers to the external database information 2100 in FIG. 17 and confirms whether the databases to be changed are the same physical server.
- the external database information 2100 holds information on an address, a port number, a user name and password, a data size, and the number of analysis databases that may be connected for each external DBMS.
- a resource allocation request for the plurality of DBMSs is transmitted as one allocation request.
- a resource allocation request is transmitted to the corresponding external DB server as each resource allocation request.
- the process (3) of the resource adjustment unit 211 receives the resource allocation completion from the external DB server, and transmits the completion of the query pre-processing to the analysis server.
- the resource adjustment unit 211 receives a resource allocation completion message from the resource allocation unit 320 of the external DB server 300.
- the resource adjustment unit 211 decreases the number of response waits 1113 related to the query execution in the execution management table 1100 by one.
- the resource adjustment unit 211 determines whether the value of the response wait number 1113 in the query execution is 0. When it is not 0, it is a case where a query is executed in parallel by a plurality of external DB servers in the section, and a completion notification of a resource adjustment request to another external DB server is waited for.
- the resource adjustment unit 211 When the response wait number 1113 is 0, the resource adjustment unit 211 notifies the DBMS1 (101) of the analysis server 100 that the query processing preparation is complete. The resource adjustment unit 211 updates the status 1111 of the execution management table 1100 during execution. Next, the resource adjustment unit 211 transmits query processing preparation completion to the DBMS 1 (101) of the analysis server 100 that uses the external DB server. When transmitting the query processing preparation completion, the resource adjustment unit 211 simultaneously includes the section information recorded in the review section 1119 of the execution management table 1100 when calculating the resource allocation. When the section is reconfigured in steps S4213 and S4215, the resource adjustment unit 211 also transmits the reconfigured section information. Further, the resource adjustment unit 211 sets a response waiting 1113 in the execution management table 1100 in order to receive the section completion message transmitted by the analysis server.
- the process (4) of the resource adjustment unit 211 receives the query execution section completion from the analysis server and recalculates the resource allocation.
- FIG. 14 shows this processing flow.
- the resource adjustment unit 211 receives the section completion notification transmitted by the DBMS 1 (101) of the analysis server 100 in step S1119.
- the resource adjustment unit 211 decreases the response waiting number stored in the response waiting 1113 of the execution management table 1100 by 1 and waits until the completion notification of the same section is completed.
- the resource adjustment unit 211 updates the section ID (1107) of the execution management table 1100 and starts the flow of FIG.
- the resource adjustment unit 211 checks whether or not the completed section is the last section (step S4407). For this purpose, the resource adjustment unit 211 compares the number of all sections 1105 in the execution management table 1100 with the section ID (1107) updated in step S4405. If the total number of sections 1105 matches the section ID (1107), it means that the last section has been executed, and the process proceeds to step S4409. If they do not coincide with each other, it means that the resource adjustment unit 211 has reached the section for performing the reallocation, calculated at the time of resource allocation, and proceeds to step S4411.
- the resource adjustment unit 211 refers to the execution management table 1100, the priority correspondence table 1400, and the resource management table 2000, and calculates the amount of resources added to execute the query (step S4409). Since the query processing is completed, the set resource of the resource allocation table 1600 linked to 1118 of the execution management table 1100 is released. Further, the resource adjustment unit 211 searches for queries in which the setting resource 1117 does not reach the target resource 1115 from other queries registered in the execution management table 1100 and executed in parallel, and finds the insufficient resources. It may be assigned.
- the resource adjustment unit 211 recalculates the resource allocation for executing the next section from the information stored in the execution management table 1100, the query traced from the execution management table, and the plan cost information for the query (step S4411). ).
- the resource adjustment unit 211 requests the external DB server to allocate the resources determined in steps S4409 and S4411 (step S4413).
- the same method as the method for transmitting the resource allocation request to the external DB server when the resource allocation is completed can be used.
- the transaction information of the query is deleted from the execution management table 1100.
- the resource allocation unit 320 of the external DB server 300 When the resource allocation unit 320 of the external DB server 300 receives a resource allocation request from the resource adjustment unit 211 of the management server 200, it cooperates with the DBMS 3 (340) and DBMS 4 (370) and functions of the operating system (OS) (309). Add and delete resources using. For example, when the DBMS is operating as an application process of the OS and the CPU resource is changed, the number of cores used is increased or decreased using an affinity function that designates a core to be executed. Further, the resource allocation unit 320 may change not only the number of cores but also the process execution priority. When changing resources related to external storage I / O, the resource allocation unit 320 adjusts the bandwidth of the I / O device used by the target DBMS using the management function of the external storage.
- OS operating system
- the resource allocation unit 320 When allocating memory resources, the resource allocation unit 320 confirms that the memory managed by the OS (309) has a free space, and notifies the DB basic information management units 353 and 383) of the memory allocation.
- the DB basic information management unit (353, 383) secures a working memory based on the notified information.
- the resource allocation unit 320 notifies the DB basic information management unit (353, 383) of the release request.
- the DB basic information management unit (353, 383) releases the working memory.
- the resource allocation unit 320 uses the management function of the container to increase or decrease the CPU utilization rate allocated to the container as a change in CPU resources, or Change the allocation by increasing or decreasing the number of cores to be executed.
- the resource allocation unit 320 changes the reserved bandwidth for the I / O device used by the container. The same bandwidth change is performed for the network.
- the resource allocation unit 320 adds the memory allocated to the container and notifies the DB basic information management unit (353, 383) of the DBMS 3, 4 (340, 370).
- the DB basic information management unit (353, 383) secures a working memory for placing an intermediate table, which is used in executing a query.
- a memory area such as an intermediate table is first released, and the DB basic information management unit (353, 383) notifies the resource allocation unit 320, so that a part allocated to the container This memory is removed from the container usage target.
- the resource allocation unit 320 When the DBMSs 3 and 4 (340 and 370) are applications in the virtual machine using the virtualization mechanism, the resource allocation unit 320 performs resource allocation in cooperation with the virtualization platform and the DBMS operating on the OS (309). Execute. When increasing or decreasing the CPU resource, the resource allocation unit 320 changes the CPU utilization rate or the number of execution cores of the virtual machine on which the target DBMS is operating. Furthermore, the resource allocation unit 320 may change the number of cores and the utilization rate of the virtual CPU allocated to the DBMS by using the function of the OS on the virtual machine. When increasing or decreasing the I / O resource, the resource allocation unit 320 changes the I / O bandwidth of the virtual device used by the virtual machine on which the target DBMS operates.
- the resource allocation unit 320 uses a virtualization platform function to increase the memory allocated to the virtual machine on which the target DBMS operates.
- the resource allocation unit 320 communicates with the DBMS on the virtual machine and notifies the DB basic information management unit (353, 383) of the memory addition. If there is sufficient memory in the virtual machine, the memory expansion for the virtual machine may be omitted.
- the resource allocation unit 320 communicates with the DBMS on the virtual machine, notifies the DB basic information management unit (353, 383) of the memory release, and releases a part of the memory used by the DBMS. .
- the resource allocation unit 320 reduces the memory allocation to the virtual machine by using the virtualization infrastructure function.
- the resource allocation unit 320 When the resource allocation is completed, the resource allocation unit 320 notifies the management server 200 of the completion of the resource allocation change.
- the query in FIG. 5 sorts the sales by the analysis server and searches the top 10 cases for the economic index and SNS. As shown in the execution plan of FIG. 6, the search to the external DB server cannot be performed until the top 10 cases are determined.
- FIG. 18 shows an example of a query different from FIG.
- the query in FIG. 18 calculates the number of individual products taken up in 2013 by sales, economic indicators, and social media for sales in 2013 among the sales data stored in DBMS 1 of the analysis server. To do. Since the economic index can be obtained regardless of the product, the sales table search and the economic index search can be executed simultaneously. Moreover, since the economic index search cost is lower than the SNS table search cost, it is more efficient to obtain the result of the economic index first and allocate resources to the DBMS 4 in which the SNS information is accumulated after the execution is completed. As described above, by performing resource allocation for each query execution, the allocation is optimal for query execution, and the query can be executed at high speed.
- FIG. 19 is a different embodiment, and shows an example in which the functions of the management server 200 and the external DB server 300 in FIG. 1 operate on the external DB server 1800 on the same computer (hardware such as a CPU). And details of software modules are omitted).
- the external DB server 1800 When the external DB server 1800 is used, communication between the resource adjustment unit 211, the external DBMS (340, 370), and the resource allocation unit 320 is not a network interface card (NIC) normally used for communication between computers, but lighter. Use interprocess communication that can be handled.
- NIC network interface card
- plan cost information request of the query from the resource adjustment unit 211 to the external DBMS the transmission of the plan cost information from the external DBMS to the resource adjustment unit 211, the resource allocation from the resource adjustment unit 211 to the resource allocation unit 320 A request (including reassignment) and an assignment completion notification from the resource assignment unit 320 to the resource adjustment unit 211 are applicable.
- data read / write to the shared memory may be used as a method for realizing inter-process communication.
- the time for determining whether to execute in the same section used in steps S4209 and S4215 is shorter. Can be.
- the resource adjustment unit 211 and the external DB management unit 221 can use the resource information managed by the resource management table 2000 and the external database information 2100 by directly querying the OS of the external DB server 1800. By directly using the resource adjustment unit 211 and the external DB management unit 221, the resource allocation calculation can be performed with a more accurate resource amount managed by the OS.
- FIG. 20 shows a further different embodiment, in which DBMSs for managing external data operate on different servers, and the data is stored in the shared storage.
- the external DB management unit 221 uses the storage information area of the external database information 2100 to manage information related to data storage in the DBMS. Thereby, even when the IP address and the physical server name are different, it is possible to detect the case where the storage apparatus is shared.
- the resource adjustment unit 211 executes the flow of step S4215 to allocate I / O resources even if the servers differ depending on the storage performance and the shared state. adjust.
- the resource allocation unit 1 (2510) and the resource allocation unit 2 (2520) consider the increase or decrease of the cache amount and the increase or decrease of the bandwidth in the shared storage. I do. Further, when the storage apparatus has a plurality of I / O ports and the bandwidth can be changed by changing the number of ports to be used, the setting of the ports may be changed using the management function of the storage apparatus.
- the resource adjustment unit 211 can also manage the external DB server 1 (2501) to activate the DBMS 4 (370) and execute the query. For example, if the query to be executed with high priority in steps S4201 and S4203 cannot be assigned in step S4233, instead of executing step S4235, the query is executed on another external DB server sharing the storage. Start the DBMS to be executed.
- the resource adjustment unit 211 when recalculating the query interval and the allocation change interval in step S4215, refers to the execution management table 1100 and the resource management table 2000, and the server on which one DBMS operates. If the remaining resource amount is less than a preset reference value, a DBMS that executes a query to the other server is started. When starting the DBMS, the resource adjustment unit 211 issues a request to the resource allocation unit of the target server. The resource allocation unit of the server activates the DBMS based on the request. When there are a plurality of external DB servers for the same DBMS, the resource adjustment unit 211 notifies the analysis server as to which server the query should be requested as hint information when the query processing preparation transmitted in step 1073 is completed.
- the resource adjustment unit 211 does not start the DBMS when resources are insufficient for query execution of the DBMS 4 (370) in the external DB server 1.
- management may be performed so that the query is executed by the DBMS of the external DB server 1.
- FIG. 21 shows a part of a configuration of another embodiment in which the DBMS of external data operates on different external DB servers, and the storage is connected to each server.
- the storage is not shared, but the storage 2510 and the storage 2540 hold the same data SNS387.
- the DBMS 4 (370) that executes the query related to the SNS can be executed by both the external DB server 1 (2501) and the external DB server 2 (2531).
- the external DB management unit 221 records the server in which the data is written as storage information of the external database information 2100 and also records information of another server that provides the same role as the DBMS.
- the external DB management unit 221 registers the DBMS 6 in the column of another server of the DBMS 4 in the external database information 2100 (in this case, it is illustrated in FIG. 17). (The DBMS6 line is also registered separately).
- the resource adjustment unit 211 When there are a plurality of external DB servers that execute the same external data query, the resource adjustment unit 211 requests all candidate external DB servers when requesting the plan cost information to the external DB server in step S1022 To do. In step S4209, the resource adjustment unit 211 selects which DBMS to inquire from the obtained plan cost information. For example, the DBMS having the shortest execution time is selected from the cost information and the available resource information, and the section in which recalculation and allocation of the section is changed is selected by the execution plan of the DBMS. Alternatively, one or a plurality of DBMSs to be preferentially used may be determined for each external data to be processed, and plan cost information may be requested only for the target DBMS.
- the resource adjustment unit 211 selects another DBMS that executes the query of the same external data, instead of step S4235, if the allocation cannot be performed in step S4233, and allocates resources. Calculate whether is possible.
- 101 analysis server 1 109 plan generation unit, 111 external query processing unit, 113 SQL execution unit, 200 management server, 211 resource adjustment unit, 300 external DB server, 320 resource allocation unit, 347 plan generation unit, 349 plan information linkage unit 377 Plan generation unit, 379 Plan information linkage unit, 1100 execution management table, 1200 analysis DB information, 1300 user information, 1400 priority correspondence table, 2000 resource management table, 2100 external database information
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
It takes time to combine data being managed separately in a plurality of database management systems and to perform processing such as analysis on the data. In the present invention, when a query is to be executed in an external database, a management server and an external DB server work in cooperation with each other and modify a query to be transmitted to the external DB server, on the basis of the computer resources of the external DB server, so that the modified query can be executed at high speed. Further, the amount of resources to be allocated for execution of a query is determined on the basis of the importance of the user who executes the query and the importance of the database to be used, and the query is executed in accordance with the levels of importance.
Description
情報通信システム、特に、情報システムにおけるデータベース管理システムの使用に関する。
Information communication systems, especially the use of database management systems in information systems.
企業では、業務および経営を行うために、生産、購買を管理するためのトランザクション処理システムや、企業活動で生じたデータを蓄積するデータウェアハウスなど、用途の異なるデータベースを複数構築している。近年、日々蓄積される大量のデータを分析して、新たな価値を見出し経営に活かす動きがある。これを実現するためには、複数のデータベースに格納されているデータを組み合わせて、分析クエリを実行する必要がある。
In order to conduct business and management, companies have built multiple databases for different purposes, such as transaction processing systems for managing production and purchasing, and data warehouses that store data generated by corporate activities. In recent years, there is a movement to analyze a large amount of data accumulated every day, find new value, and utilize it for management. In order to realize this, it is necessary to execute an analysis query by combining data stored in a plurality of databases.
複数のデータベース管理システム(以下、DBMSと記す)のデータを組み合わせてデータを処理するための手段として、特許文献1では、ユーザが外部関数を登録することで、別DBMSへのクエリを別DBMSへ送信し、実行結果を得る。
As a means for processing data by combining data of a plurality of database management systems (hereinafter referred to as DBMS), in Patent Document 1, a user registers an external function so that a query to another DBMS is sent to another DBMS. Send and get the execution result.
分析サーバに蓄積しているデータに加えて、別に管理されている外部のデータを組み合わせて分析処理を行う際、外部のデータを管理するDBMSは、分析サーバが要求するクエリに最適な構成となっていないため、クエリの実行に時間がかかる課題がある。特に、組み合わされる複数のDBMSが同一の物理計算機上で動作する場合、クエリの処理内容と実行中の分析処理に基づいて、最適な構成に変更してクエリを処理する方法が存在しない。
When performing analysis processing by combining external data managed separately in addition to the data stored in the analysis server, the DBMS that manages the external data is optimally configured for the queries required by the analysis server. There is a problem that it takes time to execute the query. In particular, when a plurality of DBMSs to be combined operate on the same physical computer, there is no method for processing a query by changing to an optimal configuration based on the processing contents of the query and the analysis process being executed.
本発明が提供するクエリ処理は、処理の一部を外部のDBMSで実行するクエリに関して、管理サーバと外部DBサーバが協調して、クエリを高速に実行できる構成へ変更する機能を持つ。クエリごとの構成変更機能はまた、分析サーバや利用者に応じた優先度に基づいた構成変更を行うことで、個々のクエリに適した制御を実現する。
分析サーバのDBMSにおいて外部のDBMSのデータを参照するクエリを検出した場合、DBMSの外部クエリ処理部は、クエリ、クエリの実行プランと付加情報を、外部DBサーバを管理する管理サーバに送信し、DBMSをクエリ実行に最適な構成とするよう依頼する。
管理サーバの資源調整部は、依頼を元に、外部DBMSが対象となるクエリを実行した際の実行プランを外部DBMSに問い合わせる。
外部DBMSのプラン情報連携部は、当該DBMSで実行するクエリの実行プランを管理サーバに提供する。
管理サーバの資源調整部は、外部DBサーバの資源を管理すると共に、外部DBサーバで実行するクエリの実行プランを取得して組み合わせることで、クエリを早く実行するために必要な資源を特定し、外部DBサーバに資源割当てを依頼する。 The query processing provided by the present invention has a function of changing a configuration in which a part of the processing is executed by an external DBMS to a configuration in which the management server and the external DB server can cooperate to execute the query at high speed. The configuration change function for each query also realizes control suitable for each query by changing the configuration based on the priority according to the analysis server or the user.
When a query referring to data of an external DBMS is detected in the DBMS of the analysis server, the external query processing unit of the DBMS transmits the query, the execution plan of the query, and additional information to the management server that manages the external DB server, Request the DBMS to be configured optimally for query execution.
Based on the request, the resource adjustment unit of the management server inquires the external DBMS about an execution plan when the external DBMS executes the target query.
The plan information linkage unit of the external DBMS provides the management server with an execution plan of a query executed by the DBMS.
The resource adjustment unit of the management server manages the resources of the external DB server, specifies the resources necessary to execute the query quickly by acquiring and combining the execution plans of the queries executed by the external DB server, Request resource allocation to an external DB server.
分析サーバのDBMSにおいて外部のDBMSのデータを参照するクエリを検出した場合、DBMSの外部クエリ処理部は、クエリ、クエリの実行プランと付加情報を、外部DBサーバを管理する管理サーバに送信し、DBMSをクエリ実行に最適な構成とするよう依頼する。
管理サーバの資源調整部は、依頼を元に、外部DBMSが対象となるクエリを実行した際の実行プランを外部DBMSに問い合わせる。
外部DBMSのプラン情報連携部は、当該DBMSで実行するクエリの実行プランを管理サーバに提供する。
管理サーバの資源調整部は、外部DBサーバの資源を管理すると共に、外部DBサーバで実行するクエリの実行プランを取得して組み合わせることで、クエリを早く実行するために必要な資源を特定し、外部DBサーバに資源割当てを依頼する。 The query processing provided by the present invention has a function of changing a configuration in which a part of the processing is executed by an external DBMS to a configuration in which the management server and the external DB server can cooperate to execute the query at high speed. The configuration change function for each query also realizes control suitable for each query by changing the configuration based on the priority according to the analysis server or the user.
When a query referring to data of an external DBMS is detected in the DBMS of the analysis server, the external query processing unit of the DBMS transmits the query, the execution plan of the query, and additional information to the management server that manages the external DB server, Request the DBMS to be configured optimally for query execution.
Based on the request, the resource adjustment unit of the management server inquires the external DBMS about an execution plan when the external DBMS executes the target query.
The plan information linkage unit of the external DBMS provides the management server with an execution plan of a query executed by the DBMS.
The resource adjustment unit of the management server manages the resources of the external DB server, specifies the resources necessary to execute the query quickly by acquiring and combining the execution plans of the queries executed by the external DB server, Request resource allocation to an external DB server.
外部のDBサーバで管理されているデータと分析サーバのデータを組み合わせる分析処理において、外部のDBサーバがクエリの内容に基づいて資源の割当てを調整し、クエリを実行するため、分析処理を短時間で実行できるようになる。
In the analysis process that combines the data managed by the external DB server and the analysis server data, the external DB server adjusts the resource allocation based on the contents of the query and executes the query. Can be executed with
実施例を用いて説明する。
This will be described using examples.
図1は、本発明が対象としているデータ処理システムの構成を示している。分析サーバ1(100)は、データベース管理システムDBMS1(101)が動作する計算機である。分析サーバ1(100)は、CPU151、メモリ153、ディスク155、他計算機との通信に用いるネットワークインタフェースカード(NIC157)が、図示されていないシステムバスで接続されたハードウェア構成となっている。分析サーバ1(101)では、オペレーティングシステム(OS159)が、ハードウェアとアプリケーションソフトウェアを制御する。
FIG. 1 shows the configuration of a data processing system targeted by the present invention. The analysis server 1 (100) is a computer on which the database management system DBMS1 (101) operates. The analysis server 1 (100) has a hardware configuration in which a CPU 151, a memory 153, a disk 155, and a network interface card (NIC 157) used for communication with other computers are connected by a system bus (not shown). In the analysis server 1 (101), the operating system (OS 159) controls hardware and application software.
DBMS1(101)は、OS159のアプリケーションのひとつとして動作し、以下の機能を持つデータ処理ソフトウェアである。
DBMS1 (101) is data processing software that operates as one of the applications of the OS 159 and has the following functions.
通信部103は、DBMSの外部との情報通信に使用される外部入出力部141を含む。通信先としては、分析アプリケーション、DB管理コンソール、管理サーバ、外部のDBMSを含みクエリ配布部143やクエリ回収部145を持つ。
The communication unit 103 includes an external input / output unit 141 used for information communication with the outside of the DBMS. The communication destination includes a query distribution unit 143 and a query collection unit 145 including an analysis application, a DB management console, a management server, and an external DBMS.
アクセス管理部105は、DBMS1(101)の外部入出力部141に到着した要求が処理可能かどうかを判断する。判断の元となる情報としては、ユーザ名、パスワード、ユーザ名に対して設定された権限情報、接続元の計算機名、接続元のIPアドレス、アクセス対象となるデータに設定された権限情報がある。
The access management unit 105 determines whether a request arriving at the external input / output unit 141 of the DBMS 1 (101) can be processed. The information that is the basis of the determination includes a user name, password, authority information set for the user name, connection source computer name, connection source IP address, and authority information set for the data to be accessed. .
SQL解析部107は、クライアントから受信したSQLで書かれたクエリを解析し、文法確認を行う。また、後の処理に向け、文字列のクエリを、トークンなどの意味のある単位に分解する。
The SQL analysis unit 107 analyzes a query written in SQL received from the client, and confirms the grammar. In addition, the character string query is broken down into meaningful units such as tokens for later processing.
プラン生成部109は、DBMS1(101)内に保持されている実行実績、サイズなどのデータの情報を用いて、クエリ実行プラン(内部の処理順番)を決定する。本実施例では、コストベースのプランを用いて説明する。
The plan generation unit 109 determines a query execution plan (internal processing order) by using data information such as the execution record and size stored in the DBMS 1 (101). In the present embodiment, description will be made using a cost-based plan.
外部クエリ処理部111は、本発明における独自の部位であり、クエリの処理にあたり、外部のDBMSの処理結果を要求する際に、動作する。
The external query processing unit 111 is a unique part in the present invention, and operates when requesting a processing result of an external DBMS in processing a query.
SQL実行部113は、プラン生成部109が生成したクエリ実行プランに基づき、データを操作してクエリを実行する。
The SQL execution unit 113 executes a query by manipulating data based on the query execution plan generated by the plan generation unit 109.
分析データ120は、DBMS1(101)で管理しているデータを示している。ここでは、種種のデータのうち、各商品の売上げを期間ごとに格納した売上表123と、売上表を効率的に操作するためのデータであるインデックス121が図示されている。
Analysis data 120 indicates data managed by DBMS 1 (101). Here, among various types of data, a sales table 123 that stores the sales of each product for each period, and an index 121 that is data for efficiently operating the sales table are illustrated.
リモートDBデータ130は、分析データ120と、外部のDBMSにあるデータを組み合わせて分析する際、外部のDBMSを参照する必要があるデータの種類と直近のデータが保持される。本実施例では、後述するDBMS3(340)が持つ経済指標のデータ(131)とDBMS4(370)が持つSNSのデータ(133)が参照できる。
The remote DB data 130 retains the type of data that needs to refer to the external DBMS and the latest data when analyzing the analysis data 120 and the data in the external DBMS in combination. In this embodiment, economic index data (131) possessed by DBMS3 (340), which will be described later, and SNS data (133) possessed by DBMS4 (370) can be referred to.
なお、ここでは、データ処理ソフトウェアをデータベース管理システムとして記載したが、Apache(TM) Hadoop(R)のようなデータ処理基盤にクエリ処理機能を加えたソフトウェアを用いてもよい。
Although the data processing software is described here as a database management system, software in which a query processing function is added to a data processing base such as Apache (TM) Hadoop (R) may be used.
外部のDBMSを利用する分析用のDBMSは、分析サーバ1(100)だけでなく、分析サーバ2(400)のDBMS2(401)のように、複数存在してもよい。
There may be a plurality of analysis DBMSs that use external DBMSs, such as DBMS 2 (401) of analysis server 2 (400) as well as analysis server 1 (100).
管理サーバ200は、分析用のDBMS(DBMS1、DBMS2等)が外部のDBMSを利用する際に、処理するクエリに合わせて外部のDBMSの構成変更を指示する。管理サーバ200は、分析サーバ1(100)と同様に、ハードウェアとして、CPU201、メモリ203、ディスク205、NIC207を持ち、図示されていないシステムバスで接続された計算機である。管理サーバ200で動作するオペレーティングシステム(OS)209のアプリケーションとして、構成変更に必要となる情報を管理するソフトウェアが動作する。
When the analysis DBMS (DBMS1, DBMS2, etc.) uses an external DBMS, the management server 200 instructs the configuration change of the external DBMS in accordance with the query to be processed. Similar to the analysis server 1 (100), the management server 200 is a computer having a CPU 201, a memory 203, a disk 205, and a NIC 207 as hardware and connected by a system bus (not shown). As an application of an operating system (OS) 209 that operates on the management server 200, software that manages information necessary for configuration change operates.
資源調整部211は、DBMS1(101)、DBMS2(401)からクエリとクエリの実行プランを受け取り、後述する管理部の情報および、外部のDBMSの実行プランより構成変更を指示する。
The resource adjustment unit 211 receives a query and a query execution plan from the DBMS1 (101) and DBMS2 (401), and instructs a configuration change from the management unit information described later and the execution plan of the external DBMS.
外部DB管理部221は、分析サーバが利用可能な外部のDBMSの基本情報を管理する。
The external DB management unit 221 manages basic information of an external DBMS that can be used by the analysis server.
分析DB管理部223は、外部データベースを利用する分析サーバの基本情報を管理する。
The analysis DB management unit 223 manages basic information of an analysis server that uses an external database.
分析者情報管理部225は、各分析サーバにおけるユーザの優先度と、外部のDBMS利用時の優先度の対応を管理する。
The analyst information management unit 225 manages the correspondence between the user priority in each analysis server and the priority when using an external DBMS.
なお、本実施例では、管理サーバ200は独立のサーバとして記載しているが、同様の処理を分析サーバや外部DBサーバで動作させてもよい(外部DBサーバで動作する例は、実施例2で示す)。
In this embodiment, the management server 200 is described as an independent server. However, the same processing may be performed by an analysis server or an external DB server (an example in which an operation is performed by an external DB server is described in the second embodiment). ).
外部DBサーバ300は、分析用のDBMSとは別に、分析に補助的に用いるDBMSを動作させるサーバである。基本的なハードウェアとシステムソフトウェアは、分析サーバ1(100)、管理サーバ200と同様に、CPU301、メモリ303、ディスク305、NIC307、OS309から構成される。
The external DB server 300 is a server that operates a DBMS that is used as an auxiliary to the analysis separately from the analysis DBMS. Similar to the analysis server 1 (100) and the management server 200, the basic hardware and system software include a CPU 301, a memory 303, a disk 305, a NIC 307, and an OS 309.
外部DBサーバ300には、例として、2種類のデータが格納されている。DBMS3(340)は、経済指標357を、DBMS4(370)は、ソーシャルネットワーキングサービス(SNS)で交換されている情報(387)を管理する。DBMSは、データの種類ごとに最適な管理方法が異なるため、異なるDBMSで管理されている。ただし、本実施例では、説明のためDBMS3(340)とDBMS4(370)は、同じ構成をしている。
The external DB server 300 stores two types of data as an example. DBMS 3 (340) manages economic indicators 357, and DBMS 4 (370) manages information (387) exchanged by social networking service (SNS). DBMSs are managed by different DBMSs because the optimum management method differs for each type of data. However, in this embodiment, the DBMS 3 (340) and the DBMS 4 (370) have the same configuration for explanation.
通信部341、371は、受信部432、372と、送信部344、374をそれぞれ含み、上位のDBMS、管理サーバ200と通信を行う。
The communication units 341 and 371 include reception units 432 and 372 and transmission units 344 and 374, respectively, and communicate with the upper DBMS and the management server 200.
アクセス管理部343、373は、DBMS1(101)のアクセス管理部105と同様な役割を持つ。
The access management units 343 and 373 have the same role as the access management unit 105 of the DBMS 1 (101).
SQL解析部345、375は、SQL解析部107と同様の役割を持つ。
The SQL analysis units 345 and 375 have the same role as the SQL analysis unit 107.
プラン生成部347、377は、クエリを処理するための実行プランを生成する。
The plan generation units 347 and 377 generate an execution plan for processing the query.
プラン情報連携部349、379は、本発明の特徴のひとつであり、DBMS1(101)の外部クエリ処理部111が生成したクエリを処理するために前処理を実行する。また、前処理に関し、通信部341、371を用いて管理サーバ200、資源割当て部320と連携する。
The plan information cooperation units 349 and 379 are one of the features of the present invention, and perform preprocessing to process the query generated by the external query processing unit 111 of the DBMS 1 (101). Further, regarding preprocessing, the communication units 341 and 371 are used to cooperate with the management server 200 and the resource allocation unit 320.
クエリ処理部352、382は、SQL実行部113と同様の役割を持つ。
The query processing units 352 and 382 have the same role as the SQL execution unit 113.
DB基本情報管理部353、383は、当該DBMSの管理情報を保持する。
The DB basic information management units 353 and 383 hold management information of the DBMS.
資源割当て部320は、管理サーバ200の指示に基づき、OS(309)の機能およびDB基本情報管理部(353、383)と協調して、DBMS3(340)とDBMS4(370)に割当てる資源を変更する。
The resource allocation unit 320 changes the resources allocated to the DBMS 3 (340) and the DBMS 4 (370) in cooperation with the function of the OS (309) and the DB basic information management unit (353, 383) based on the instruction of the management server 200. To do.
なお、本実施例では、外部DBサーバ300上でDBMS3(340)とDBMS4(370)が動作しているが、各DBMSが別々のサーバで動作してもよい。また、各DBMSは、OS(309)のプロセスとして動作しても、近年の計算機でサポートされている仮想化機構で実現される仮想マシン上のプロセスとして動作してもよい。さらに、各DBMSは、仮想マシンの実行に必要なエミュレーションを用いるのではなく、OS(309)および他のシステムソフトウェアが提供するコンテナ機構により、各種資源の名前空間が異なり、利用量がチューニングされたコンテナとして動作してもよい。
In this embodiment, the DBMS 3 (340) and the DBMS 4 (370) are operating on the external DB server 300, but each DBMS may be operating on a separate server. Each DBMS may operate as a process of the OS (309) or a process on a virtual machine realized by a virtualization mechanism supported by a recent computer. In addition, each DBMS does not use the emulation necessary for virtual machine execution, but the name space of various resources is different and usage is tuned by the container mechanism provided by the OS (309) and other system software. It may operate as a container.
分析アプリケーションは、分析データベースと、分析データベースを経由して外部のデータベースを利用する。クライアント1(500)は、図示されていないが、分析サーバ1(100)と同様なハードウェアとOSを持つ。DB管理コンソール1(503)は、DBMS1(101)を管理する機能を持ち、外部のDBMSを利用するための接続を設定できる。分析アプリケーション1(501)は、データ分析のためのクエリを発行するアプリケーションプログラムである。クライアントは複数存在することも可能であり、図1では、クライアント1(500)の他に、例としてクライアント2(510)、クライアント3(520)が示されている。クライアントとサーバ、サーバ間はネットワーク(561、563)で接続されている。
The analysis application uses an analysis database and an external database via the analysis database. Although not shown, the client 1 (500) has the same hardware and OS as the analysis server 1 (100). The DB management console 1 (503) has a function of managing the DBMS 1 (101) and can set a connection for using an external DBMS. The analysis application 1 (501) is an application program that issues a query for data analysis. There can be a plurality of clients, and FIG. 1 shows a client 2 (510) and a client 3 (520) as an example in addition to the client 1 (500). The client and server, and the server are connected by a network (561, 563).
図2は、図1のシステムにおいて、分析アプリケーション1が、分析サーバと外部DBサーバのデータを組み合わせた分析クエリを、分析サーバ1へ要求した際の処理の流れを示している。
FIG. 2 shows the flow of processing when the analysis application 1 requests the analysis server 1 for an analysis query that combines the data of the analysis server and the external DB server in the system of FIG.
DBMS1(101)の外部入出力部141は、分析アプリケーション1(501)が送信したクエリを受信する(ステップS1001)。DBMS1(101)のアクセス管理部105とSQL解析部107は、受信したクエリを認証、解析する。アクセス管理部105は、クエリがDBMS1で処理が許可されているユーザから出されているかどうかを、接続に用いられたユーザ名、パスワードから判定する。SQL解析部107は、後続の処理を容易にするために、認証が終わったクエリを意味のある文字列(トークン)の単位で区切るとともに、当該クエリがSQLの文法に従っているかどうかを判定する。クエリで参照する表に対してアクセス権限が設定されている場合、アクセス管理部105は、クエリを要求したユーザが操作対象となる表へのアクセス権限を持つか確認する。
The external input / output unit 141 of the DBMS 1 (101) receives the query transmitted by the analysis application 1 (501) (step S1001). The access management unit 105 and the SQL analysis unit 107 of the DBMS 1 (101) authenticate and analyze the received query. The access management unit 105 determines whether or not the query is issued from a user whose processing is permitted by the DBMS 1 from the user name and password used for the connection. In order to facilitate the subsequent processing, the SQL analysis unit 107 divides the authenticated query in units of meaningful character strings (tokens) and determines whether the query conforms to the SQL grammar. When the access authority is set for the table referred to by the query, the access management unit 105 checks whether the user who has requested the query has the access authority to the table to be operated.
プラン生成部109は、クエリを実行する際に利用する機能、実行の順番、処理コストを実行プランとして生成する(ステップS1003)。実行プランの生成には、図1には図示されていないが、これまでの処理で蓄積した統計情報を用いる。なお、ステップS1003の時点で、外部DBサーバを使用する処理は、詳細なコスト値はわからなくともよい。
The plan generation unit 109 generates a function used when executing the query, the order of execution, and the processing cost as an execution plan (step S1003). Although not shown in FIG. 1, the statistical information accumulated in the processing so far is used for generating the execution plan. Note that at the time of step S1003, the process using the external DB server does not need to know the detailed cost value.
DBMS1(101)の外部クエリ処理部111は、本発明の特徴のひとつとなる部分であり、受信したクエリの中から外部DBサーバで処理する部分を特定する(ステップS1006)。外部クエリ処理部111は、クエリおよびクエリの実行プランを参照し、リモートDBデータ130を参照するクエリを、外部DBサーバの処理対象とする。さらに、外部クエリ処理部111は、外部DBサーバで処理するクエリについて、並列で要求か可能なクエリを区間として定義する。例えば、分析サーバの売上表に格納されている商品の情報について、上位10地区の売上と、該当地区の経済状況、SNSでの登場回数の関係を調べる図5に示すクエリは、図6に示す実行プランとなる。図6では、クエリを実行するために、使用するスキャン、フィルタ、結合等の利用する機能と機能の実行にかかる見積もりが図示されている。また、経済指標を管理するDBMS3(340)とSNSを管理するDBMS4(370)へ並列でクエリを要求する区間が定義されている。
The external query processing unit 111 of the DBMS 1 (101) is a part that is one of the features of the present invention, and specifies a part to be processed by the external DB server from the received query (step S1006). The external query processing unit 111 refers to the query and the execution plan of the query, and sets the query that refers to the remote DB data 130 as the processing target of the external DB server. Furthermore, the external query processing unit 111 defines, as a section, a query that can be requested in parallel for a query processed by the external DB server. For example, for the product information stored in the sales table of the analysis server, the query shown in FIG. 5 for examining the relationship between the sales in the top 10 districts, the economic status of the relevant district, and the number of appearances in the SNS is shown in FIG. It becomes an execution plan. In FIG. 6, functions used such as scan, filter, and combination to be used for executing a query, and an estimate for executing the function are illustrated. Further, a section is defined in which a query is requested in parallel to the DBMS 3 (340) that manages the economic index and the DBMS 4 (370) that manages the SNS.
DBMS1(101)の外部クエリ処理部111は、ステップS1001で受信したクエリのうち、ステップS1006で特定した外部DBサーバで処理する部分について、クエリの変換を実行し、変換したクエリと、該当する実行プランとコスト情報(プランコスト情報)を管理サーバ200に送信する(ステップS1008)。クエリ変換の詳細については、図7で示す。外部クエリ処理部111は、クエリ配布部143の機能を利用して、管理サーバ200へ、外部DBサーバで実行する変換済クエリとプランコスト情報を送信する。
The external query processing unit 111 of the DBMS 1 (101) executes query conversion on the part processed by the external DB server specified in step S1006 among the queries received in step S1001, and the converted query and corresponding execution are executed. The plan and cost information (plan cost information) are transmitted to the management server 200 (step S1008). Details of the query conversion are shown in FIG. The external query processing unit 111 uses the function of the query distribution unit 143 to transmit the converted query and plan cost information to be executed by the external DB server to the management server 200.
管理サーバ200の資源調整部211は、ステップS1008で送信された、分析サーバの新しいクエリとプランコスト情報を受信する。資源調整部211は、受信したクエリを解析し、外部DBサーバでクエリを実行する際の詳細なプランコスト情報を、外部DBサーバごとに要求する(ステップS1022)。
The resource adjustment unit 211 of the management server 200 receives the new query and plan cost information of the analysis server transmitted in step S1008. The resource adjustment unit 211 analyzes the received query, and requests detailed plan cost information for executing the query in the external DB server for each external DB server (step S1022).
外部DBサーバ300で動作するDBMSの受信部(342、372)は、管理サーバ200からのプランコスト情報提示要求を受信する。アクセス管理部(343、373)は、受信が管理サーバ200からの要求であることを確認する(ステップS1032)。
The DBMS receiving units (342, 372) operating on the external DB server 300 receive the plan cost information presentation request from the management server 200. The access management unit (343, 373) confirms that the reception is a request from the management server 200 (step S1032).
外部DBサーバ300で動作するDBMSのプラン情報連携部(349、379)は、本発明の特徴のひとつであり、管理サーバからの要求に基づき、クエリの実行はせずに、実行プランの生成と、プランコスト情報を資源調整部に通知する機能を持つ。
The DBMS plan information linkage unit (349, 379) operating on the external DB server 300 is one of the features of the present invention. Based on the request from the management server, the execution plan can be generated without executing the query. And has a function of notifying the resource adjustment unit of plan cost information.
プラン情報連携部(349、379)は、プランコスト情報提示要求に含まれるクエリを取り出し、SQL解析部(345、375)に解析を要求する。SQL解析部(345、375)は、クエリを構成する文字列を解析し、結果をプラン情報連携部(349、379)に返す。プラン情報連携部(349、379)は、解析結果をプラン生成部(347、377)に渡し、クエリの実行プラン生成を依頼する。プラン生成部(347、377)は、クエリを実行する際の実行プランとコスト見積もりを算出する(図5のクエリの場合、図6の点線内が該当する。ただし下線部は除く)。
The plan information cooperation unit (349, 379) takes out the query included in the plan cost information presentation request, and requests the SQL analysis unit (345, 375) for analysis. The SQL analysis unit (345, 375) analyzes the character string constituting the query, and returns the result to the plan information cooperation unit (349, 379). The plan information cooperation unit (349, 379) passes the analysis result to the plan generation unit (347, 377), and requests the execution plan generation of the query. The plan generation unit (347, 377) calculates an execution plan and a cost estimate for executing the query (in the case of the query in FIG. 5, the inside of the dotted line in FIG. 6 corresponds, except for the underlined portion).
プラン情報連携部(349、379)は、算出されたコストから、クエリを実行する際に、CPUとI/Oのどちらが重要となるか、必要な資源、並列実行度などの特性情報を算出する。特性情報とは、コストから算出されるCPUを利用する度合い、I/Oを重視する度合い、DBMS内部での可能処理並列度、結果の出力形式などになる。図5のクエリの場合、図6の下線部の情報が相当する。
The plan information cooperation unit (349, 379) calculates, from the calculated cost, characteristic information such as whether a CPU or I / O is important, necessary resources, parallel execution degree, etc. when executing a query. . The characteristic information includes the degree of using the CPU calculated from the cost, the degree of emphasizing I / O, the possible parallelism within the DBMS, and the output format of the result. In the case of the query in FIG. 5, the underlined information in FIG. 6 corresponds.
例えば、クエリの実行において、サイズの大きいインデックスの探索が含まれる場合、ランダムなディスクI/Oを伴うためI/Oを重視する度合いが上がる。また、データの格納方式とクエリの処理方式から並列実行度を算出する。クエリの一部にソート処理とフィルタ処理が含まれる場合は、計算資源が豊富にあっても処理が一元化されるため並列度が落ちる。逆にデータがパーティショニングされている場合は、並列度を上げることができる。結果の出力形式としては、条件に合うデータが見つかるたびに結果を返せる場合と、集約をするため最後にまとめて結果を出す場合がある。
For example, when a search for a large index is included in the execution of a query, the degree of emphasis on I / O increases because random disk I / O is involved. Also, the degree of parallel execution is calculated from the data storage method and the query processing method. When a sort process and a filter process are included in a part of a query, the degree of parallelism decreases because the process is unified even if there are abundant calculation resources. Conversely, if the data is partitioned, the degree of parallelism can be increased. As a result output format, there are a case where the result can be returned every time data matching the condition is found, and a case where the result is collectively output for aggregation.
プラン情報連携部(349、379)は、特性情報を含むプランコスト情報の送信を、送信部(344、374)に依頼する。送信部(344、374)は、依頼されたプランコスト情報を管理サーバ200に送信する(ステップS1045)。
The plan information cooperation unit (349, 379) requests the transmission unit (344, 374) to transmit the plan cost information including the characteristic information. The transmission units (344, 374) transmit the requested plan cost information to the management server 200 (step S1045).
管理サーバ200の資源調整部211は、外部DBサーバから処理結果を受信する(ステップS1051)。
The resource adjustment unit 211 of the management server 200 receives the processing result from the external DB server (step S1051).
図3は、実施例におけるクエリの処理フローの図2以降の続きを示している。
FIG. 3 shows a continuation of FIG. 2 and subsequent diagrams of the query processing flow in the embodiment.
資源調整部211は、外部DBサーバから受信したプランコスト情報、外部DB管理部221が管理する外部のDBMSの情報、分析DB管理部223が管理する分析サーバの情報、分析者情報管理部225が管理するユーザの情報を基に、分析サーバが要求するクエリを処理するための外部DBサーバの構成を計算する(ステップS1053)。詳細は、後述する。
The resource adjustment unit 211 includes plan cost information received from the external DB server, external DBMS information managed by the external DB management unit 221, analysis server information managed by the analysis DB management unit 223, and analyst information management unit 225. Based on the user information to be managed, the configuration of the external DB server for processing the query requested by the analysis server is calculated (step S1053). Details will be described later.
資源調整部211は、構成変更を資源割当て情報として、外部DBサーバ300の資源割当て部320に依頼する(ステップS1055)。
The resource adjustment unit 211 requests the resource allocation unit 320 of the external DB server 300 to change the configuration as resource allocation information (step S1055).
外部DBサーバ300の資源割当て部320は、ステップS1055で送信された資源割当て情報を受信し、資源割当て情報に基づき、DBMSに割り当てている資源の構成を変更する。資源割当て部320は、割当ての変更後、割当て完了を管理サーバ200へ送信する(ステップS1062)。
The resource allocation unit 320 of the external DB server 300 receives the resource allocation information transmitted in step S1055, and changes the configuration of resources allocated to the DBMS based on the resource allocation information. After changing the assignment, the resource assignment unit 320 transmits assignment completion to the management server 200 (step S1062).
管理サーバ200の資源調整部211は、ステップS1065で送信された割当て完了を受信する(ステップS1071)。
The resource adjustment unit 211 of the management server 200 receives the assignment completion transmitted in step S1065 (step S1071).
資源調整部211は、分析サーバ1(100)のDBMS1(101)にステップS1008で受信した変換済クエリとプランコスト情報の返信として、外部のDBMSのクエリ処理準備完了を送信する(ステップS1073)。なお、この際、クエリの実行プランを修正するためのヒント情報を同時に送信してもよい。
The resource adjustment unit 211 transmits the query processing completion of the external DBMS as a reply to the converted query and the plan cost information received in step S1008 to the DBMS1 (101) of the analysis server 1 (100) (step S1073). At this time, hint information for correcting the execution plan of the query may be transmitted at the same time.
DBMS1(101)の外部クエリ処理部111は、クエリ回収部145の機能を用いて、ステップS1073で送信されたクエリ処理準備完了を受信する(ステップS1081)。実行プラン修正のヒント情報がある場合は、ステップS1003に戻り、実行プラン再度修正してもよい。
The external query processing unit 111 of the DBMS 1 (101) receives the query processing preparation completion transmitted in step S1073 using the function of the query collection unit 145 (step S1081). If there is hint information for correcting the execution plan, the process may return to step S1003 and the execution plan may be corrected again.
DBMS1(101)のSQL実行部113は、実行プランに従い、クエリの処理を開始する(ステップS1083)。
The SQL execution unit 113 of the DBMS 1 (101) starts query processing according to the execution plan (step S1083).
図4は、実施例におけるクエリの処理フローの図3以降の続きを示している。
FIG. 4 shows a continuation of FIG. 3 and subsequent drawings of the query processing flow in the embodiment.
SQL実行部113が、外部のDBMSの情報を参照する場合、外部クエリ処理部111を経由して外部DBサーバへクエリを送信する。外部クエリ処理部111は、クエリ配布部143の機能を用いて、外部DBサーバへ変換したクエリを送信する(ステップS1085)。
When the SQL execution unit 113 refers to external DBMS information, the SQL execution unit 113 transmits a query to the external DB server via the external query processing unit 111. The external query processing unit 111 transmits the converted query to the external DB server using the function of the query distribution unit 143 (step S1085).
外部DBサーバ300で動作するDBMS(340、370)では、DBMS1(101)から送信されたクエリを受信して、実行し、処理結果を送信する(ステップS1091)。受信部(342、372)は、DBMS1(101)から送信されたクエリを受信する。外部DBサーバ300で動作するDBMSのアクセス管理部(343、373)は、受信したクエリが正しいサーバかつ正規のユーザからの通信であることを確認する。DBMSのSQL解析部(345、375)は、クエリを構成する文字列を解析する。プラン生成部(347、377)は、クエリを実行する際の処理の順番や、利用する計算方法を実行プランとして生成する。クエリ処理部(352、382)は、プラン生成部(347、377)が生成したプランを基に、当該DBMSに保持しているデータの操作を実行する。クエリの実行結果は、送信部(344、374)により、クエリを発行した分析サーバ1(100)のDBMS1(101)に送信される。
The DBMS (340, 370) operating on the external DB server 300 receives and executes the query transmitted from the DBMS1 (101), and transmits the processing result (step S1091). The receiving units (342, 372) receive the query transmitted from the DBMS1 (101). The access management unit (343, 373) of the DBMS operating on the external DB server 300 confirms that the received query is communication from a correct server and an authorized user. The SQL analysis unit (345, 375) of the DBMS analyzes a character string constituting the query. The plan generation unit (347, 377) generates, as an execution plan, the order of processing when executing a query and the calculation method to be used. The query processing units (352, 382) execute the operation of data held in the DBMS based on the plan generated by the plan generation unit (347, 377). The execution result of the query is transmitted to the DBMS 1 (101) of the analysis server 1 (100) that issued the query by the transmission unit (344, 374).
DBMS1(101)のクエリ回収部145は、外部DBサーバから、ステップS1085で要求したクエリの実行結果を受信し、クエリ処理を進める(ステップS1111)。
The query collection unit 145 of the DBMS 1 (101) receives the execution result of the query requested in step S1085 from the external DB server, and advances the query processing (step S1111).
DBMS1(101)の外部クエリ処理部(111)は、ステップS1073で指定した特定の区間が終了すると(クエリの完了も含む)、クエリ配布部143の機能を用い、管理サーバ200へ、実行していた区間の完了を通知する(ステップS1119)。
The external query processing unit (111) of the DBMS1 (101) performs the execution to the management server 200 by using the function of the query distribution unit 143 when the specific section specified in step S1073 ends (including the completion of the query). The completion of the section is notified (step S1119).
管理サーバ200の資源調整部211は、DBMS1(101)からの区間終了通知を受信する(ステップS1131)。
The resource adjustment unit 211 of the management server 200 receives the section end notification from the DBMS 1 (101) (step S1131).
管理サーバ200の資源調整部211は、区間完了通知、ステップS1022で受信したクエリとプランコスト情報、ステップS1053で算出した資源割当てより、再度資源割当てを計算する(ステップS1133)。
The resource adjustment unit 211 of the management server 200 calculates the resource allocation again from the section completion notification, the query and plan cost information received in step S1022, and the resource allocation calculated in step S1053 (step S1133).
管理サーバ200の資源調整部211は、再度割当てが必要な場合、計算した資源割当て情報を外部DBサーバへ送信する(ステップS1135)。
The resource adjustment unit 211 of the management server 200 transmits the calculated resource allocation information to the external DB server when the allocation is necessary again (step S1135).
外部DBサーバでの処理は、ステップS1062として既に記載している。
The processing in the external DB server has already been described as step S1062.
管理サーバ200の資源調整部211は、外部DBサーバからの資源割当て変更結果を受信し、資源割当ての結果を確認する(ステップS1071)。
The resource adjustment unit 211 of the management server 200 receives the resource allocation change result from the external DB server, and confirms the resource allocation result (step S1071).
DBMS1(101)は、クエリの実行が完了すると、外部入出力部141より、ステップS1001で受けたクエリの実行結果を分析アプリケーション1(501)に送信する(ステップS1117)。
When the query execution is completed, the DBMS 1 (101) transmits the query execution result received in step S1001 to the analysis application 1 (501) from the external input / output unit 141 (step S1117).
図7は、分析サーバ1(100)の外部クエリ処理部111の処理フローを示している。外部クエリ処理部111は、(1)クライアントから受信したクエリのうち外部DBサーバで実行する部分の変換(ステップS1006、S1008)、(2)管理サーバから送信されるクエリ処理準備完了の受信処理(ステップS1081)、(3)外部DBサーバへのクエリ送付(ステップS1085)、(4)外部DBサーバからのクエリ実行結果の受信(ステップS1111)、(5)区間終了時に管理サーバへ区間終了を通知(ステップS1119)、の5つが主要機能となる。
FIG. 7 shows a processing flow of the external query processing unit 111 of the analysis server 1 (100). The external query processing unit 111 converts (1) a part of the query received from the client to be executed by the external DB server (steps S1006 and S1008), and (2) a reception process of query processing preparation completion transmitted from the management server ( (Step S1081), (3) Query transmission to external DB server (Step S1085), (4) Query execution result reception from external DB server (Step S1111), (5) End of section to management server at end of section (Step S1119) are five main functions.
外部クエリ処理部111は、呼び出されると、まず、プラン生成部109からの呼び出しであり、新規クエリの変換が要求されているかを判定する(ステップS2001)。該当する場合、ステップS2003以降の処理を実行する(機能(1))。なお、判定の方法としては、図1などで図示されていないトランザクションの管理データ構造に、呼出し元モジュール名を保持する方法、クエリの変換が完了したかどうかを示すフラグを保持する方法がある。
When the external query processing unit 111 is called, it first determines whether it is a call from the plan generation unit 109 and conversion of a new query is requested (step S2001). When it corresponds, the process after step S2003 is performed (function (1)). As a determination method, there are a method of holding a caller module name in a transaction management data structure not shown in FIG. 1 and the like, and a method of holding a flag indicating whether or not query conversion is completed.
外部クエリ処理部111は、プラン生成部109が管理する実行プランの中から、当該クエリの実行プランを検索する(ステップS2003)。検索は、プラン生成部109に問い合わせを行う、管理データ構造に実行プランへのポインタ情報を持つなどの方法がある。
The external query processing unit 111 searches for an execution plan of the query from the execution plans managed by the plan generation unit 109 (step S2003). The search includes a method of making an inquiry to the plan generation unit 109 and having pointer information to the execution plan in the management data structure.
外部クエリ処理部111は、検索で取得した実行プランのうち、外部のDBMSに問い合わせが必要な部分を特定すると共に、クエリが複数の外部DBMS上で並列に実行できるかどうかを判定し、並列に実行できる部分に区間を設定する(ステップS2005)。外部クエリ処理部111は、まず、実行プランの中で操作対象となる表がリモートDBデータ130で管理されている場合に、外部のDBMSに問い合わせが必要な部分と特定する。例えば、図5に示した商品Xの売上げが高い地区と、その地区の経済指標と、商品に関するSNSの情報を分析するクエリでは、図6に示すように、経済指標表を参照する(ア)とSNS表を参照する(イ)の部分は、外部DBMSへの問い合わせとなる。
The external query processing unit 111 specifies a portion of the execution plan acquired by the search that requires a query to the external DBMS, determines whether the query can be executed in parallel on a plurality of external DBMSs, A section is set in the executable part (step S2005). The external query processing unit 111 first identifies a part that needs to be inquired of an external DBMS when a table to be operated in the execution plan is managed by the remote DB data 130. For example, as shown in FIG. 6, the economic index table is referred to in the query for analyzing the district where the sales of the product X shown in FIG. 5 are high, the economic index of the district, and the SNS information about the product (A). The part (a) referring to the SNS table is an inquiry to the external DBMS.
さらに、外部クエリ処理部111は、外部のDBMSに問い合わせる実行プランのうち、並列で実行できる箇所を決め、並列実行ができる単位を区間とし、区間ごとにIDを設定する。外部クエリ処理部111は、並列実行箇所を特定するために、実行プランで依存しているデータと使用される機能の情報を用いる。データがそろわなければ後続の処理ができない部分は、区間の境界となる。また、結合処理において、結合の対象となるデータを計算する部分は、計算資源に余裕があれば独立に実行できるため、並列実行が可能な箇所と判定できる。図6の実行プランの例では、(ア)の部分と(イ)の部分は、地区IDを算出したあとに計算可能な処理であり、並列DBMSにおいて一般的に並列処理されるネストループ結合によるデータ取得処理のため、同一の区間と判定している。
Furthermore, the external query processing unit 111 determines a portion that can be executed in parallel in the execution plan for inquiring an external DBMS, sets a unit that can be executed in parallel as a section, and sets an ID for each section. The external query processing unit 111 uses data dependent on the execution plan and information on functions used in order to identify parallel execution locations. The portion where the subsequent processing cannot be performed unless the data is prepared becomes the boundary of the section. In addition, in the combining process, the part for calculating the data to be combined can be executed independently if there is a sufficient computing resource, so that it can be determined that the part can be executed in parallel. In the example of the execution plan in FIG. 6, the parts (a) and (b) are processes that can be calculated after the district ID is calculated, and are based on nested loop joins that are generally processed in parallel in a parallel DBMS. For the data acquisition process, it is determined as the same section.
外部クエリ処理部111は、区間ID以外に、分析サーバの情報、クエリを要求しているユーザ情報、トランザクションIDなどの情報をクエリに付与する(ステップS2007)。分析サーバの情報としては、サーバ名やIPアドレスなどがある。設定の方法としては、ステップS2005で示したコメント文を使う方法や、管理サーバに送るデータの一部に加える方法がある。
The external query processing unit 111 gives information such as analysis server information, user information requesting the query, and transaction ID in addition to the section ID to the query (step S2007). The analysis server information includes a server name and an IP address. As a setting method, there are a method of using the comment sentence shown in step S2005 and a method of adding to a part of data to be sent to the management server.
外部クエリ処理部111は、クエリ配布部143の機能を利用して、管理サーバ200へ、クエリとプランコスト情報を送信する(ステップS2009)。
The external query processing unit 111 transmits the query and the plan cost information to the management server 200 using the function of the query distribution unit 143 (step S2009).
外部クエリ処理部111は、ステップS2001において呼出しがプラン生成部109からでない場合、クエリ回収部145の呼出しであり、渡されるメッセージがクエリ処理準備完了かどうかを判定する(ステップS2021)。該当する場合は、ステップ2027に進む(機能(2))。該当しない場合は、ステップS2031に進む。
If the call is not from the plan generation unit 109 in step S2001, the external query processing unit 111 is a call to the query collection unit 145, and determines whether the message passed is ready for query processing (step S2021). When it corresponds, it progresses to step 2027 (function (2)). If not, the process proceeds to step S2031.
外部クエリ処理部111は、SQL実行部113を呼び、外部DBサーバのデータを利用するクエリの実行を開始する(ステップS2027)。なお、このフローには、図示していないが、クエリ処理準備完了のメッセージに外部DBのプラン修正のヒント情報が入っている場合、本フローを終了して、ステップS1008に戻ってもよい。
The external query processing unit 111 calls the SQL execution unit 113 and starts executing a query using data of the external DB server (step S2027). Although not shown in this flow, when the query processing preparation completion message includes hint information for plan correction of the external DB, this flow may be terminated and the process may return to step S1008.
外部クエリ処理部111は、呼び出された契機が、クエリ回収部145からの呼び出しであり、クエリ処理結果の受信であるかどうかを、通信内容から判定する(ステップS2031)。該当する場合はステップS2033に進む(機能(4))。そうでない場合は、ステップS2041に進む。
The external query processing unit 111 determines from the communication contents whether the called trigger is a call from the query collection unit 145 and reception of a query processing result (step S2031). If applicable, the process proceeds to step S2033 (function (4)). Otherwise, the process proceeds to step S2041.
外部クエリ処理部111は、呼出し元がプラン生成部109でも通信部103からでもない場合、SQL実行部113からの呼出しで、外部DBサーバへの実行要求かどうかを判定する(ステップS2041)。該当する場合、ステップS2043に進む(機能(3))。非該当の場合は、ステップS2045を実行する(機能(5))。
If the call source is neither the plan generation unit 109 nor the communication unit 103, the external query processing unit 111 determines whether it is an execution request to the external DB server by a call from the SQL execution unit 113 (step S2041). When it corresponds, it progresses to step S2043 (function (3)). If not, step S2045 is executed (function (5)).
外部クエリ処理部111は、SQL実行部113が必要とする外部のDBMSのデータを取得するため、ステップS2007で変換したクエリのうち該当する部分を、対象の外部DBサーバへクエリ配布部143を利用して送信する(ステップS2043)。
The external query processing unit 111 uses the query distribution unit 143 to send the corresponding part of the query converted in step S2007 to the target external DB server in order to acquire the data of the external DBMS required by the SQL execution unit 113. (Step S2043).
外部クエリ処理部111は、SQL実行部113からの呼出しであり、呼出しの原因が外部DBサーバへのクエリ実行でない場合、実行中のクエリの区間が完了したか、クエリがすべて完了したかどうかを確認する(ステップS2045)。外部クエリ処理部111は、外部入出力部141の機能を利用し、外部DBMSと終了した区間の情報を、管理サーバ200へ送信する。
If the external query processing unit 111 is a call from the SQL execution unit 113 and the cause of the call is not a query execution to the external DB server, the external query processing unit 111 determines whether the query currently being executed has been completed or whether all the queries have been completed. Confirmation is made (step S2045). The external query processing unit 111 uses the function of the external input / output unit 141 to transmit information about the external DBMS and the completed section to the management server 200.
管理サーバ200の資源調整部211は、大きく分けて次の4つの処理を実行する:(1)外部DBサーバへプランコスト情報を要求、(2)外部DBサーバから受信したプランコスト情報より資源割当てを確定し、外部DBサーバへ資源割当て情報を送信、(3)外部DBサーバから資源割当て完了を受信し、分析サーバへクエリ前処理の完了を送信、(4)分析サーバからクエリ実行完了を受取り、資源割当てを再計算し(2)と同様に外部DBサーバの資源割当てを変更する。
The resource adjustment unit 211 of the management server 200 executes the following four processes broadly: (1) Request plan cost information from the external DB server, (2) Assign resources from the plan cost information received from the external DB server And send resource allocation information to the external DB server, (3) receive resource allocation completion from the external DB server, send query preprocessing completion to the analysis server, and (4) receive query execution completion from the analysis server Then, the resource allocation is recalculated and the resource allocation of the external DB server is changed as in (2).
資源調整部211の処理(1)は、図2に示したステップS1022に相当する。資源調整部211は、分析サーバ1(100)のDBMS1(101)からクエリとプランコスト情報を受信すると、図8に示す実行管理テーブル1100にクエリの情報を登録する。実行管理テーブル1100は、分析サーバが外部のDBMSにクエリを依頼している間、実行中のクエリに関する情報を保持するデータ構造である。実行管理テーブル1100は、分析DBサーバの識別子(1101)、分析DBサーバが割り当てたトランザクションID(1103)、要求したクエリの全区間数(1105)、現在実行している区間ID(1107)を保持する。さらに、外部DBサーバの情報として、使用している外部のDBMS(1109)、クエリのステータス(1111)、応答を待っているメッセージの数(1113)、外部のDBMSに設定すべき目標資源の割合(1115)、実際に設定している設定資源(1117)の情報、外部のDBMSごとに割当てた資源割当てテーブルへのポインタ(1118)を持つ。また、資源の割当てを変える区間のリスト(1119)、要求されたクエリを記録しているアドレスの情報(1121)、分析サーバおよび外部DBサーバから取得したプランコスト情報を参照するためのデータ(1123)も持つ。図8では、1151として、DBMS1が要求しているクエリの情報(トランザクションID1)が登録されている。
The process (1) of the resource adjustment unit 211 corresponds to step S1022 shown in FIG. When the resource adjustment unit 211 receives the query and the plan cost information from the DBMS 1 (101) of the analysis server 1 (100), the resource adjustment unit 211 registers the query information in the execution management table 1100 illustrated in FIG. The execution management table 1100 is a data structure that holds information about a query being executed while the analysis server requests a query from an external DBMS. The execution management table 1100 holds the identifier (1101) of the analysis DB server, the transaction ID (1103) assigned by the analysis DB server, the total number of sections of the requested query (1105), and the section ID (1107) currently being executed. To do. Further, as external DB server information, the external DBMS (1109) being used, the status of the query (1111), the number of messages waiting for a response (1113), and the ratio of target resources to be set in the external DBMS (1115) It has information on the setting resource (1117) actually set, and a pointer (1118) to a resource allocation table allocated for each external DBMS. Further, a list (1119) of a section for changing the resource allocation, information (1121) of the address where the requested query is recorded, and data (1123) for referring to the plan cost information acquired from the analysis server and the external DB server ). In FIG. 8, information (transaction ID 1) of a query requested by DBMS 1 is registered as 1151.
資源調整部211が分析サーバから受信するクエリには、DBMS1(101)の外部クエリ処理部111がステップS2007で付与した分析DBMSの情報、ユーザ情報、外部のDBMSの情報などがSQL文に加えて埋め込まれている。
The query received by the resource adjustment unit 211 from the analysis server includes the analysis DBMS information, user information, external DBMS information, and the like given by the external query processing unit 111 of the DBMS 1 (101) in step S2007 in addition to the SQL sentence. Embedded.
資源調整部211が分析サーバから受信したプランコスト情報には、一般のDBMSで利用されているコストベースの実行プランに、クエリ処理部111がステップS2005で算出した区間情報が追加されている。なお、この時点で外部のDBMSで実行するクエリのプランについては正確であるとは限らない。例えば、図5のクエリで、図6のプランの(ア)(イ)の内部はコストが出ていなくともよい。
In the plan cost information received by the resource adjustment unit 211 from the analysis server, the section information calculated by the query processing unit 111 in step S2005 is added to the cost-based execution plan used in a general DBMS. Note that the query plan executed by the external DBMS at this time is not necessarily accurate. For example, in the query of FIG. 5, the cost of (a) (b) in the plan of FIG.
資源調整部211は、外部DBサーバで実行するクエリの詳細なプランコスト情報を外部DBサーバに問い合わせる。具体的には、クエリの文字列から、区間が設定されているクエリを、外部DBサーバごとに抽出する。資源調整部211は、外部のDBMSへ接続する情報、外部DBサーバが動作するサーバの情報を図17に示す外部データベース情報2100で管理している。資源調整部211は、抽出したクエリと外部データベース情報2100を組み合わせて、プランコスト情報を問い合わせるためのホスト名、IPアドレス、ポート番号を特定する。資源調整部211は、プランコスト情報問合せメッセージを、特定した外部のDBMSへの宛先へ送信する。資源調整部221は、実行管理テーブル1100のステータス1111をプラン問合せ中に変更する。
The resource adjustment unit 211 inquires the external DB server for detailed plan cost information of a query executed by the external DB server. Specifically, a query for which a section is set is extracted for each external DB server from the query character string. The resource adjustment unit 211 manages information for connecting to an external DBMS and information on a server on which an external DB server operates, using external database information 2100 shown in FIG. The resource adjustment unit 211 specifies the host name, IP address, and port number for inquiring plan cost information by combining the extracted query and the external database information 2100. The resource adjustment unit 211 transmits a plan cost information inquiry message to the specified destination for the external DBMS. The resource adjustment unit 221 changes the status 1111 of the execution management table 1100 during the plan inquiry.
資源調整部211の処理(2)は、外部のDBMSへ問い合わせたプランコスト情報を受信し資源割当てを確定する。資源調整部211は、まず、上述したプランコスト情報の問合せ結果を、区間ごとにそれぞれ外部のDBMSから受信する。資源調達部211は、外部DBサーバから、分析サーバが外部のDBMSに要求するクエリのプランコスト情報
を受信する。資源調整部211は、実行管理テーブル1100において当該クエリの応答待ちのメッセージ数を保持している応答待ち1113の1減らす。資源調整部211は、当該クエリの応答待ち1113が0かどうかを判定する。0であれば、メッセージの受信が完了となる。資源調整部211は、0でなければ、外部のDBMSからのプランコスト情報がすべて届いていないため、プランコスト情報の到着を待つ。 The process (2) of theresource adjustment unit 211 receives the plan cost information inquired from the external DBMS and determines the resource allocation. First, the resource adjustment unit 211 receives the above-described inquiry result of the plan cost information from the external DBMS for each section. The resource procurement unit 211 receives from the external DB server the plan cost information of the query that the analysis server requests to the external DBMS. The resource adjustment unit 211 decreases the response waiting 1113 that holds the number of messages waiting for a response to the query in the execution management table 1100 by one. The resource adjustment unit 211 determines whether the response waiting 1113 of the query is 0. If 0, message reception is complete. If it is not 0, the resource adjustment unit 211 waits for the arrival of the plan cost information because all the plan cost information from the external DBMS has not arrived.
を受信する。資源調整部211は、実行管理テーブル1100において当該クエリの応答待ちのメッセージ数を保持している応答待ち1113の1減らす。資源調整部211は、当該クエリの応答待ち1113が0かどうかを判定する。0であれば、メッセージの受信が完了となる。資源調整部211は、0でなければ、外部のDBMSからのプランコスト情報がすべて届いていないため、プランコスト情報の到着を待つ。 The process (2) of the
図12は、外部DBサーバの資源割当てを確定する際の処理フローを示している。本フローは、ステップS1053を詳細化したものである。
FIG. 12 shows a processing flow when determining the resource allocation of the external DB server. This flow is a detailed version of step S1053.
資源調整部211は、まず、図9に示す分析DB情報1200を検索し、クエリを依頼したDBMSの優先度を取得する(ステップS4201)。分析DB情報1200は、クエリを要求する分析サーバのDBMSの名前、IPアドレス、優先度などが格納されている。分析DB情報1200は、外部DB管理部221が管理するデータであり、情報システムに分析サーバが追加、削除されると、システム管理者または図1に図示していないシステム管理プログラムによって更新される。
The resource adjustment unit 211 first searches the analysis DB information 1200 shown in FIG. 9 and acquires the priority of the DBMS that requested the query (step S4201). The analysis DB information 1200 stores the DBMS name, IP address, priority, and the like of the analysis server that requests the query. The analysis DB information 1200 is data managed by the external DB management unit 221 and is updated by a system administrator or a system management program (not shown in FIG. 1) when an analysis server is added to or deleted from the information system.
資源調整部211は、実行管理テーブル1100のクエリ1121内に含まれているユーザ情報を抽出する。資源調整部211は、図10に示すユーザ情報1300を検索し、クエリを要求した分析DBMS名とユーザ名から、外部DBサーバを利用する際の優先度を取得する(ステップS4203)。図10のユーザ情報1300は、分析者情報管理部225によって管理されているデータであり、分析サーバの変更、ユーザの変更に伴いシステム管理者またはシステム管理プログラムによって更新される。
The resource adjustment unit 211 extracts user information included in the query 1121 of the execution management table 1100. The resource adjustment unit 211 searches the user information 1300 shown in FIG. 10, and acquires the priority when using the external DB server from the analysis DBMS name and user name that requested the query (step S4203). The user information 1300 in FIG. 10 is data managed by the analyst information management unit 225, and is updated by the system administrator or the system management program in accordance with the analysis server change and the user change.
資源調整部211は、図11にある優先度対応表1400を参照し、ステップS4201で求めたDBMSの優先度と、ステップS4203で求めたユーザの優先度に対応する目標割当て量を取得する(ステップS4207)。優先度対応表1400は、資源調整部211があらかじめ管理するクエリの優先度と目標割当て資源量の対応表である。資源調整部211は、取得した目標割当て資源量を、当該クエリの目標割当て資源量として、実行管理テーブル1100の目標割当て資源1115に代入する。
The resource adjustment unit 211 refers to the priority correspondence table 1400 in FIG. 11 and acquires the target priority corresponding to the DBMS priority obtained in step S4201 and the user priority obtained in step S4203 (step S4203). S4207). The priority correspondence table 1400 is a correspondence table between query priorities and target allocation resource amounts managed in advance by the resource adjustment unit 211. The resource adjustment unit 211 assigns the acquired target allocation resource amount to the target allocation resource 1115 of the execution management table 1100 as the target allocation resource amount of the query.
資源調整部211は、個々の外部のDBMSから取得したプランコスト情報より、区間の再計算と、割当てを変更する区間の番号を計算する(ステップS4209)。外部のDBMSが、分析サーバが要求するクエリのプランを生成すると、プランの詳細なコストや、並列実行が可能な部分などがわかる。資源調整部211は、プランコスト情報に基づき、DBMSの特定の区間に関する情報を再構成する。資源調整部211は、実行プランにおいて、処理時間が一定時間を超える個所や、並列度が変わる個所において、仮の内部的な区間を設定する。例えば、図6の(イ)の部分において、表のスキャンで大幅に実行時間がかかる場合、表スキャンの部分を「1-DBMS4-内部区間1」、「1-DBMS4-内部区間2」などに分割する。また、処理に一定の時間がかかり、クエリを要求したDBMSに結果が返る個所を割当て変更区間とする。
The resource adjustment unit 211 recalculates the section and calculates the number of the section whose allocation is changed from the plan cost information acquired from each external DBMS (step S4209). When an external DBMS generates a plan for a query requested by the analysis server, the detailed cost of the plan and the parts that can be executed in parallel are known. The resource adjustment unit 211 reconfigures information related to a specific section of the DBMS based on the plan cost information. In the execution plan, the resource adjustment unit 211 sets a temporary internal section at a place where the processing time exceeds a certain time or a place where the degree of parallelism changes. For example, in the part (a) of FIG. 6, if the table scan takes a lot of execution time, the table scan part is changed to “1-DBMS4-internal section 1”, “1-DBMS4-internal section 2”, etc. To divide. Further, a portion where processing takes a certain amount of time and a result is returned to the DBMS that requested the query is defined as an allocation change section.
資源調整部211は、受信したプランコスト情報とステップS4207で計算した目標資源から最初の割当て変更区間に到達するまでに割り当てる基本割当て量を計算する(ステップS4211)。基本割当て量は、クエリの実行において外部DBサーバの資源を占有できる場合など、後の判断処理で変更が不要な場合に割り当てる資源の量に相当する。プランコスト情報には、ステップS1034で計算したクエリ実行における特性情報が含まれている。資源調整部211は、割当ての対象となる区間の特性情報を参照し、実行プランのCPU利用特性が高い場合は、当該クエリに対するCPU資源を増やすことを決定する。また、並列実行度が高い場合についても、CPU資源の割当てを増やす。これに対し、インデックスの操作などでI/O負荷が高い特性を持つ場合は、I/O資源を増やす。操作対象の表の大きさがあらかじめ決めた基準を超える場合は、メモリ資源を増やすことを決定する。この基準の値は、システム全体で決められた値、外部のDBMSごと設定した値を用いてもよい。
The resource adjustment unit 211 calculates a basic allocation amount to be allocated until the first allocation change section is reached from the received plan cost information and the target resource calculated in step S4207 (step S4211). The basic allocation amount corresponds to the amount of resources to be allocated when no change is necessary in later determination processing, such as when the resources of the external DB server can be occupied in the execution of a query. The plan cost information includes the characteristic information in the query execution calculated in step S1034. The resource adjustment unit 211 refers to the characteristic information of the section to be allocated, and determines that the CPU resource for the query is increased when the CPU utilization characteristic of the execution plan is high. Also, the CPU resource allocation is increased even when the degree of parallel execution is high. On the other hand, if the I / O load is high due to an index operation or the like, I / O resources are increased. If the size of the operation target table exceeds a predetermined criterion, it is determined to increase the memory resource. As the reference value, a value determined for the entire system or a value set for each external DBMS may be used.
資源調整部211は、処理対象となるクエリの実行区間内において、資源割当ての対象となる範囲が単一の外部DBサーバ上かどうかを確認する(ステップS4213)。資源調整部211は、ステップS4209で計算した区間について、実行管理テーブル1100の資源割当てを計算する区間内において複数の外部のDBMSでクエリが実行されるかどうかを確認する。このために、図17の外部データベース情報2100を参照し、実行対象となる外部のDBMSの物理サーバを確認する。対象区間において複数の外部のDBMS上でクエリを実行し、それらの外部のDBMSが実際には1台の外部DBサーバ上で動作している場合は、ステップS4215に進む。そうでない場合は、ステップS4233へ進む。なお、ステップS4233に進む際、ステップS4209で区間を再構成した場合は、クエリ全体の区間番号を更新する(上記の例では、「1-DBMS4-内部区間1」を「区間1」に、「1-DBMS4-内部区間2」を「区間2」に設定する)。
The resource adjustment unit 211 checks whether or not the resource allocation target range is on a single external DB server within the execution interval of the query to be processed (step S4213). The resource adjustment unit 211 confirms whether or not the query is executed by a plurality of external DBMSs within the interval for calculating the resource allocation in the execution management table 1100 for the interval calculated in step S4209. For this purpose, referring to the external database information 2100 in FIG. 17, the physical server of the external DBMS to be executed is confirmed. When a query is executed on a plurality of external DBMSs in the target section, and these external DBMSs are actually operating on one external DB server, the process proceeds to step S4215. Otherwise, the process proceeds to step S4233. When the section is reconstructed in step S4209 when proceeding to step S4233, the section number of the entire query is updated (in the above example, “1-DBMS4-internal section 1” is changed to “section 1”, “ 1-DBMS4-internal section 2 "is set to" section 2 ").
資源調整部211は、同一のサーバで動作するDBMSのクエリに関して、区間、割当て変更区間を再計算する(ステップS4215)。資源調整部211は、まず、ステップ4209で計算した内部区間に関し、並行して動作するクエリを考慮して再計算する。分析サーバが設定した区間内で実行されるプランの中で、実行時間の見積もりが、一定時間(例:60秒)かかるプランで分析サーバへの結果の返信があるプランを新しい区間として定義する。資源調整部211は、一定時間を超える区間については割当てを変更する区間として、実行管理テーブルの見直し区間1119に区間番号を追加する。また、資源調整部211は、ある区間NとN+1を実行する際に、(ア)一方が区間Nで資源xを大量消費、他方が区間N+1で資源yを少量消費、または(イ)一方が区間Nで資源xを少量消費、他方が区間N+1で資源yを大量消費、のように区間の変わり目で、使用される資源が大きく異なる区間についても割当てを変更する。なお、分析サーバ100の外部クエリ処理部111が、資源割当てを変更する区間を指定する手段を利用することもできる。
The resource adjustment unit 211 recalculates sections and allocation change sections with respect to DBMS queries operating on the same server (step S4215). First, the resource adjustment unit 211 recalculates the internal section calculated in step 4209 in consideration of a query that operates in parallel. Among plans executed in the section set by the analysis server, a plan that takes a certain time (eg, 60 seconds) for execution time estimation and returns a result to the analysis server is defined as a new section. The resource adjustment unit 211 adds a section number to the review section 1119 of the execution management table as a section for changing the allocation for a section exceeding a certain time. Further, when the resource adjustment unit 211 executes certain sections N and N + 1, (a) one consumes a large amount of resource x in the section N, the other consumes a small amount of resource y in the section N + 1, or (b) one of them Allocation is also changed for a section where the resources used are greatly different at the change of section, such as a small consumption of resource x in section N and a large consumption of resource y in section N + 1 on the other side. It should be noted that the external query processing unit 111 of the analysis server 100 can use means for designating a section in which resource allocation is changed.
資源調整部211は、当該区間のそれぞれの外部のDBMSのプランコスト情報を参照し、実行結果の出力方法と実行時間について確認する(ステップS4217)。例えば、DBMS3とDBMS4を参照する4区間で構成されるクエリのうち、ステップS4215により区間1と区間2を同じ資源割当てで実行する場合、DBMS3の区間1と区間2の実行時間の見積もりの和が、DBMS4の区間1と区間2の実行時間の見積もりの和より大きく(例えば3倍)異なる場合は真と判定する。また、同じ例で、DBMS3とDBMS4の区間1、2の中で、結果を少しずつ返す区間があれば真となる。クエリが該当する性質を持つ場合はステップS4219へ進む。そうでなければ、ステップS4221へ進む
図13は、図12に続き、資源調整部211が、資源割当てを確定する処理フローを示している。 Theresource adjustment unit 211 refers to the plan cost information of each external DBMS in the section, and confirms the execution result output method and execution time (step S4217). For example, in a query composed of four sections that refer to DBMS3 and DBMS4, when section 1 and section 2 are executed with the same resource allocation in step S4215, the sum of the estimated execution times of section 3 and section 2 of DBMS3 is When the difference is larger (for example, three times) than the sum of the estimated execution times of the section 1 and the section 2 of the DBMS 4, it is determined to be true. Moreover, in the same example, if there is a section in which the results are returned little by little in the sections 1 and 2 of the DBMS 3 and the DBMS 4, the result is true. If the query has a relevant property, the process advances to step S4219. Otherwise, the process proceeds to step S4221. FIG. 13 shows a processing flow in which the resource adjustment unit 211 determines resource allocation following FIG.
図13は、図12に続き、資源調整部211が、資源割当てを確定する処理フローを示している。 The
資源調整部211は、ステップS4217において結果を少しずつ返すクエリおよび実行時間の長いクエリに優先的に資源を割当てる(ステップS4219)。例えば、実行時間が短いクエリ、実行結果を最後にまとめて返すクエリは、S4211で計算した基本割当て量の計算結果の半分を、実行時間の長いクエリおよび結果を少しずつ返すクエリの資源量に割り当てる。結果が少しずつ返る場合、資源を優先的に割当てることで、クエリを要求した分析サーバが、上がってくる結果を元に後続の処理が開始できる。
The resource adjustment unit 211 assigns resources preferentially to queries that return results little by little in step S4217 and queries that have a long execution time (step S4219). For example, in a query with a short execution time and a query that returns execution results collectively at the end, half of the calculation result of the basic allocation amount calculated in S4211 is allocated to a resource amount of a query with a long execution time and a query that returns results little by little. . When the results are returned little by little, the analysis server that has requested the query can start the subsequent processing based on the results by allocating resources preferentially.
資源調整部211は、同一区間に複数の外部のDBMSで実行されるクエリのプランコスト情報のうち、CPUの実行コストとI/Oの負荷コストの比率を比較する(ステップS4221)。システムで決められた比率を上回る偏りがある場合は、ステップS4223へ進む。そうでない場合は、ステップS4225へ進む。
The resource adjustment unit 211 compares the CPU execution cost and the I / O load cost ratio among the plan cost information of queries executed by a plurality of external DBMSs in the same section (step S4221). If there is a bias exceeding the ratio determined by the system, the process proceeds to step S4223. Otherwise, the process proceeds to step S4225.
資源調整部211は、同時に実行されるクエリがCPUとI/Oの負荷特性が異なる場合、CPU資源とI/O資源を比率の差に応じて配分する(ステップS4223)。例えば、ある区間においてDBMS3のCPU利用コストが90、I/Oコストが10、DBMS4のCPU利用コストが10、I/Oコストが90の場合は、DBMS3とDBMS4には、配分できる資源量のうち、それぞれの利用コストの割合を資源割当て量とする。
The resource adjustment unit 211 distributes the CPU resource and the I / O resource according to the difference in the ratio when the query executed at the same time has different load characteristics between the CPU and the I / O (step S4223). For example, when the CPU usage cost of the DBMS 3 is 90, the I / O cost is 10, the CPU usage cost of the DBMS 4 is 10, and the I / O cost is 90 in a certain section, the DBMS 3 and the DBMS 4 The ratio of each usage cost is used as the resource allocation amount.
資源調整部211は、区間で実行されるクエリの並列実行度が高いかどうかを判定する(ステップS4225)。ここで判定に用いる基準値は、(ア)あらかじめ設定されて基準値や、(イ)クエリを実行するDBMSに対して割当てているコア数、を用いることができる。並列度が高いと判定された場合、ステップS4227に進む。そうでない場合は、ステップS4229に進む。
The resource adjustment unit 211 determines whether the parallel execution degree of the query executed in the section is high (step S4225). The reference value used for the determination here can be (a) a reference value set in advance or (b) the number of cores assigned to the DBMS executing the query. If it is determined that the degree of parallelism is high, the process proceeds to step S4227. Otherwise, the process proceeds to step S4229.
資源調整部211は、クエリの並列実行度が高い場合、DBMSが動作するサーバが持つCPU(コア)を、優先度を考慮した上で、クエリを実行するDBMSに割当てる(ステップS4227)。資源調整部211は、管理対象となる外部DBサーバごとに、図15に示す資源管理テーブル2000を保持する。資源管理テーブル2000には、サーバに搭載されている資源の種類ごとに、資源の量と、未割当ての残り資源量、サーバ上で動作するDBMSごとの割当済み資源量が管理されている。資源調整部211は、ステップS4209で確定した割当て量の範囲内で、並列実行度が高いクエリのDBMSに、コアを割当てる。
If the parallel execution degree of the query is high, the resource adjustment unit 211 assigns the CPU (core) of the server on which the DBMS operates to the DBMS that executes the query in consideration of the priority (step S4227). The resource adjustment unit 211 holds a resource management table 2000 shown in FIG. 15 for each external DB server to be managed. In the resource management table 2000, the amount of resources, the amount of unallocated remaining resources, and the allocated resource amount for each DBMS operating on the server are managed for each type of resource mounted on the server. The resource adjustment unit 211 allocates a core to a DBMS of a query with a high degree of parallel execution within the allocation amount determined in step S4209.
資源調整部211は、同一の資源割当てで実行する区間内で、コストから必要とされるワークメモリが一定量より多いか判定する(ステップS4229)。該当する場合は、ステップS4231に進む。そうでない場合は、ステップS4233に進む。
The resource adjustment unit 211 determines whether or not the work memory required from the cost is larger than a certain amount within the section to be executed with the same resource allocation (step S4229). If applicable, the process proceeds to step S4231. Otherwise, the process proceeds to step S4233.
資源調整部211は、クエリの実行に必要なワークメモリのサイズが大きい場合、ステップS4207で計算した割当て量、クエリが実行される外部DBサーバの資源管理テーブル2000、ステップS4229で計算した比率より、各DBMSに追加するメモリ容量を確定する(ステップS4231)。
When the size of the work memory necessary for executing the query is large, the resource adjustment unit 211 uses the allocation amount calculated in step S4207, the resource management table 2000 of the external DB server on which the query is executed, and the ratio calculated in step S4229. The memory capacity to be added to each DBMS is determined (step S4231).
資源調整部211は、これまでのステップで確定した資源割当てを、図16に示す資源割当てテーブル1600に設定する(ステップ4233)。資源割当てテーブル1600は、分析サーバ(101)が外部DBサーバに送信するトランザクションごとに、利用する外部のDBMSの個数分、作成される。資源割当てテーブル1600には、資源調整部211が割当てを決め、資源割当て部320が割当て実行する資源の要素について、目標とする資源量と実際に設定する資源量を記録する。資源調整部211は、計算で求めた資源割当てと、資源管理テーブル2000の資源量より、目標とする割当て資源の量を設定する。資源割当てテーブル1600の目標割当て資源で設定された量には、クエリを要求した分析サーバが外部DBサーバを占有できる場合の理想とする資源量が設定される。資源割当てテーブル1600の設定資源は、初期値として、目標割当て資源と同じ量が登録される。例えば、すでに別のクエリが動作しており、当該クエリを並列に実行する場合は、ステップS4235などの後のステップの計算により、調整された資源量が登録される。
The resource adjustment unit 211 sets the resource allocation determined in the previous steps in the resource allocation table 1600 shown in FIG. 16 (step 4233). The resource allocation table 1600 is created for each transaction transmitted from the analysis server (101) to the external DB server for the number of external DBMSs to be used. In the resource allocation table 1600, the resource adjustment unit 211 determines the allocation, and records the target resource amount and the actually set resource amount for the elements of the resource to be allocated and executed by the resource allocation unit 320. The resource adjustment unit 211 sets a target allocated resource amount based on the resource allocation obtained by calculation and the resource amount in the resource management table 2000. The amount set as the target allocation resource in the resource allocation table 1600 is set to an ideal resource amount when the analysis server that requested the query can occupy the external DB server. As the setting resource of the resource allocation table 1600, the same amount as the target allocation resource is registered as an initial value. For example, when another query is already operating and the query is executed in parallel, the adjusted resource amount is registered by calculation in a subsequent step such as step S4235.
資源調整部211は、ステップS4233で設定した資源量と、図15の資源管理テーブル2000の残りの資源量を比較し、割当て可能かを判定する(ステップS4234)。割当て可能な場合、処理を完了する。そうでない場合は、ステップS4235を実行する。
The resource adjustment unit 211 compares the resource amount set in step S4233 with the remaining resource amount in the resource management table 2000 of FIG. 15 to determine whether allocation is possible (step S4234). If so, complete the process. Otherwise, step S4235 is executed.
資源調整部211は、資源割当てができない場合、実行管理テーブル1100の設定資源1117と優先度対応表1400を参照し、現在設定されている設定資源1117よりも低い優先度の割当て量を検索する。割り当てる資源の種類について、検索した割当て量での割当て資源量を計算する(ステップS4235)。
When resource allocation cannot be performed, the resource adjustment unit 211 refers to the setting resource 1117 and the priority correspondence table 1400 of the execution management table 1100 and searches for an allocation amount having a lower priority than the currently set resource 1117. For the type of resource to be allocated, the allocated resource amount at the searched allocation amount is calculated (step S4235).
資源調整部211は、資源割当ての計算が完了すると、クエリの実行で使用する外部DBサーバに対し、資源割当要求を送付する。この処理の流れは以下となる。資源調整部211は、確定した資源割当て、資源割当てテーブル1600の設定資源の値を、資源管理テーブル2000の残りの資源量から引き、各DBMSの資源量に加算する。資源調整部211は、複数の外部のDBMSの資源を変更するかどうか判定する。複数の外部のDBMSの資源を変更する場合、資源調整部211は、図17の外部データベース情報2100を参照し、変更対象となるデータベースが同一の物理サーバかどうかを確認する。外部データベース情報2100は、外部のDBMSごとに、接続するために必要なアドレス、ポート番号、ユーザ名とパスワード、データの規模、接続する可能性のある分析データベース数の情報を保持する。1台の物理サーバ上で複数の外部のDBMSが動作している場合は、複数のDBMSに対する資源割当て要求をひとつの割当て要求として送信する。資源の割当て対象となるDBMSがひとつの場合、または、複数のDBMSがそれぞれ異なる物理サーバで動作している場合には、それぞれの資源割当て要求として、該当する外部DBサーバへ資源割当て要求を送信する。
When the resource allocation calculation is completed, the resource adjustment unit 211 sends a resource allocation request to the external DB server used for executing the query. The flow of this process is as follows. The resource adjustment unit 211 subtracts the determined resource allocation and the value of the set resource of the resource allocation table 1600 from the remaining resource amount of the resource management table 2000, and adds it to the resource amount of each DBMS. The resource adjustment unit 211 determines whether to change the resources of a plurality of external DBMSs. When changing the resources of a plurality of external DBMSs, the resource adjustment unit 211 refers to the external database information 2100 in FIG. 17 and confirms whether the databases to be changed are the same physical server. The external database information 2100 holds information on an address, a port number, a user name and password, a data size, and the number of analysis databases that may be connected for each external DBMS. When a plurality of external DBMSs are operating on one physical server, a resource allocation request for the plurality of DBMSs is transmitted as one allocation request. When there is one DBMS to which resources are to be allocated, or when a plurality of DBMSs are operating on different physical servers, a resource allocation request is transmitted to the corresponding external DB server as each resource allocation request. .
資源調整部211の処理(3)は、外部DBサーバから資源割当て完了を受信し、分析サーバへクエリ前処理の完了を送信する。
The process (3) of the resource adjustment unit 211 receives the resource allocation completion from the external DB server, and transmits the completion of the query pre-processing to the analysis server.
資源調整部211は、外部DBサーバ300の資源割当て部320より、資源割当て完了メッセージを受信する。資源調整部211は、実行管理テーブル1100の当該クエリ実行に関する応答待ち1113の個数を1減らす。
The resource adjustment unit 211 receives a resource allocation completion message from the resource allocation unit 320 of the external DB server 300. The resource adjustment unit 211 decreases the number of response waits 1113 related to the query execution in the execution management table 1100 by one.
資源調整部211は、当該クエリ実行における応答待ち数1113の値が0かどうかを判定する。0でない場合は、区間内で複数の外部DBサーバでクエリが並行に実行される場合であり、他の外部DBサーバへの資源調整依頼の完了通知を待つ。
The resource adjustment unit 211 determines whether the value of the response wait number 1113 in the query execution is 0. When it is not 0, it is a case where a query is executed in parallel by a plurality of external DB servers in the section, and a completion notification of a resource adjustment request to another external DB server is waited for.
資源調整部211は、応答待ち数1113が0の場合、分析サーバ100のDBMS1(101)にクエリ処理準備完了を通知する。資源調整部211は、実行管理テーブル1100のステータス1111を実行中に更新する。次に、資源調整部211は、外部DBサーバを利用する分析サーバ100のDBMS1(101)にクエリ処理準備完了を送信する。資源調整部211は、クエリ処理準備完了を送信する際、資源割当ての計算時に、実行管理テーブル1100の見直し区間1119に記録した区間情報を同時に含める。ステップS4213、ステップS4215にて区間を再構成した場合、資源調整部211は、再構成した区間情報についても送信する。また、資源調整部211は、分析サーバが送信する区間完了メッセージを受信するため、実行管理テーブル1100の応答待ち1113をセットする。
When the response wait number 1113 is 0, the resource adjustment unit 211 notifies the DBMS1 (101) of the analysis server 100 that the query processing preparation is complete. The resource adjustment unit 211 updates the status 1111 of the execution management table 1100 during execution. Next, the resource adjustment unit 211 transmits query processing preparation completion to the DBMS 1 (101) of the analysis server 100 that uses the external DB server. When transmitting the query processing preparation completion, the resource adjustment unit 211 simultaneously includes the section information recorded in the review section 1119 of the execution management table 1100 when calculating the resource allocation. When the section is reconfigured in steps S4213 and S4215, the resource adjustment unit 211 also transmits the reconfigured section information. Further, the resource adjustment unit 211 sets a response waiting 1113 in the execution management table 1100 in order to receive the section completion message transmitted by the analysis server.
資源調整部211の処理(4)は、分析サーバからクエリ実行区間完了を受取り、資源割当てを再計算する。図14は、この処理フローを示している。本処理フローの前提として、資源調整部211は、分析サーバ100のDBMS1(101)が、ステップS1119で送信する区間完了の通知を受信する。資源調整部211は、通知を受信すると、実行管理テーブル1100の応答待ち1113に格納されている応答待ち数を1減らし、同一区間の完了通知がそろうまで待つ。資源調整部211は、区間完了の通知がそろうと、実行管理テーブル1100の区間ID(1107)更新して、図14のフローを開始する。
The process (4) of the resource adjustment unit 211 receives the query execution section completion from the analysis server and recalculates the resource allocation. FIG. 14 shows this processing flow. As a premise of this processing flow, the resource adjustment unit 211 receives the section completion notification transmitted by the DBMS 1 (101) of the analysis server 100 in step S1119. When the resource adjustment unit 211 receives the notification, the resource adjustment unit 211 decreases the response waiting number stored in the response waiting 1113 of the execution management table 1100 by 1 and waits until the completion notification of the same section is completed. The resource adjustment unit 211 updates the section ID (1107) of the execution management table 1100 and starts the flow of FIG.
資源調整部211は、完了した区間が最後の区間であったかどうかを確認する(ステップS4407)。このために、資源調整部211は、実行管理テーブル1100にある全区間数1105と、ステップS4405で更新した区間ID(1107)を比較する。全区間数1105と区間ID(1107)が一致していれば、最後の区間の実行が終わったことを意味し、ステップS4409に進む。一致しなければ、資源調整部211が資源割当て時に算出した、再割当てを実施する区間に到達したことを意味し、ステップS4411に進む。
The resource adjustment unit 211 checks whether or not the completed section is the last section (step S4407). For this purpose, the resource adjustment unit 211 compares the number of all sections 1105 in the execution management table 1100 with the section ID (1107) updated in step S4405. If the total number of sections 1105 matches the section ID (1107), it means that the last section has been executed, and the process proceeds to step S4409. If they do not coincide with each other, it means that the resource adjustment unit 211 has reached the section for performing the reallocation, calculated at the time of resource allocation, and proceeds to step S4411.
資源調整部211は、実行管理テーブル1100、優先度対応表1400および資源管理テーブル2000を参照し、当該クエリを実行するために追加した資源量を算出する(ステップS4409)。クエリの処理が終了したため、実行管理テーブル1100の1118にリンクされている資源割当てテーブル1600の設定資源を解放する。さらに資源調整部211は、実行管理テーブル1100に登録され、並列に実行している他のクエリの中から、設定資源1117が目標資源1115に達していないクエリを検索し、不足している資源を割当ててもよい。
The resource adjustment unit 211 refers to the execution management table 1100, the priority correspondence table 1400, and the resource management table 2000, and calculates the amount of resources added to execute the query (step S4409). Since the query processing is completed, the set resource of the resource allocation table 1600 linked to 1118 of the execution management table 1100 is released. Further, the resource adjustment unit 211 searches for queries in which the setting resource 1117 does not reach the target resource 1115 from other queries registered in the execution management table 1100 and executed in parallel, and finds the insufficient resources. It may be assigned.
資源調整部211は、当該クエリに関して、実行管理テーブル1100に格納されている情報、実行管理テーブルからたどれるクエリおよびプランコスト情報より、次の区間を実行するための資源割当てを再計算する(ステップS4411)。
The resource adjustment unit 211 recalculates the resource allocation for executing the next section from the information stored in the execution management table 1100, the query traced from the execution management table, and the plan cost information for the query (step S4411). ).
資源調整部211は、ステップS4409、S4411で決定した資源の割当てを外部DBサーバに依頼する(ステップS4413)。詳細の実行内容は、既に記載した、資源割当ての完了時に外部DBサーバへ資源割当て要求を送信する方法と同様の方法が利用できる。トランザクションが最後の区間の場合は、当該クエリのトランザクションの情報を実行管理テーブル1100から削除する。
The resource adjustment unit 211 requests the external DB server to allocate the resources determined in steps S4409 and S4411 (step S4413). As the detailed execution contents, the same method as the method for transmitting the resource allocation request to the external DB server when the resource allocation is completed can be used. When the transaction is the last section, the transaction information of the query is deleted from the execution management table 1100.
外部DBサーバ300の資源割当て部320は、管理サーバ200の資源調整部211から資源割当て要求を受け付けると、DBMS3(340)、DBMS4(370)と協調し、オペレーティングシステム(OS)(309)の機能を用いて資源の追加・削除を行う。例えば、DBMSがOSのアプリケーションプロセスとして動作しており、CPU資源の変更を行う場合は、実行するコアを指定するアフィニティ機能を用いて利用コア数を増減させる。また、資源割当て部320は、コア数の変更だけでなく、プロセスの実行優先度の変更を行ってもよい。外部ストレージのI/Oに関する資源を変更する場合、資源割当て部320は、対象となるDBMSが用いるI/Oデバイスの帯域を、外部ストレージの管理機能を用いて調整する。メモリ資源を割当てる場合、資源割当て部320は、OS(309)が管理するメモリに空きがあることを確認し、DB基本情報管理部353、383)にメモリ割当てを通知する。DB基本情報管理部(353、383)は、通知された情報を元に作業メモリを確保する。メモリ資源を減らす場合、資源割当て部320は、DB基本情報管理部(353、383)へ解放依頼を通知する。通知を受け取ったDB基本情報管理部(353、383)は、作業メモリを解放する。
When the resource allocation unit 320 of the external DB server 300 receives a resource allocation request from the resource adjustment unit 211 of the management server 200, it cooperates with the DBMS 3 (340) and DBMS 4 (370) and functions of the operating system (OS) (309). Add and delete resources using. For example, when the DBMS is operating as an application process of the OS and the CPU resource is changed, the number of cores used is increased or decreased using an affinity function that designates a core to be executed. Further, the resource allocation unit 320 may change not only the number of cores but also the process execution priority. When changing resources related to external storage I / O, the resource allocation unit 320 adjusts the bandwidth of the I / O device used by the target DBMS using the management function of the external storage. When allocating memory resources, the resource allocation unit 320 confirms that the memory managed by the OS (309) has a free space, and notifies the DB basic information management units 353 and 383) of the memory allocation. The DB basic information management unit (353, 383) secures a working memory based on the notified information. When the memory resource is reduced, the resource allocation unit 320 notifies the DB basic information management unit (353, 383) of the release request. Upon receiving the notification, the DB basic information management unit (353, 383) releases the working memory.
OSが提供するコンテナ機構上でDBMSが動作している場合、資源割当て部320は、CPU資源の変更として、コンテナの管理機能を用いて、コンテナに割り当てているCPU利用率を増減する、もしくは、実行するコア数を増減することにより割当てを変更する。ディスクI/O資源の変更を行う場合、資源割当て部320は、コンテナが利用するI/Oデバイスへの予約帯域を変更する。ネットワークについても同様の帯域変更を行う。メモリ資源を増やす場合は、資源割当て部320が、コンテナに割り当てるメモリを追加し、DBMS3,4(340、370)のDB基本情報管理部(353、383)に通知する。DB基本情報管理部(353、383)は、通知された情報を元に、クエリの実行で使用する、中間表を置くための作業メモリを確保する。メモリ資源を削減する場合は、先に中間表などのメモリ領域を解放しておき、DB基本情報管理部(353、383)が資源割当て部320に通知することで、コンテナに割り当てている一部のメモリを、コンテナの利用対象から外す。
When the DBMS is operating on the container mechanism provided by the OS, the resource allocation unit 320 uses the management function of the container to increase or decrease the CPU utilization rate allocated to the container as a change in CPU resources, or Change the allocation by increasing or decreasing the number of cores to be executed. When changing the disk I / O resource, the resource allocation unit 320 changes the reserved bandwidth for the I / O device used by the container. The same bandwidth change is performed for the network. When increasing the memory resource, the resource allocation unit 320 adds the memory allocated to the container and notifies the DB basic information management unit (353, 383) of the DBMS 3, 4 (340, 370). Based on the notified information, the DB basic information management unit (353, 383) secures a working memory for placing an intermediate table, which is used in executing a query. In order to reduce memory resources, a memory area such as an intermediate table is first released, and the DB basic information management unit (353, 383) notifies the resource allocation unit 320, so that a part allocated to the container This memory is removed from the container usage target.
DBMS3、4(340、370)が仮想化機構を用いた仮想マシンの中のアプリケーションである場合、資源割当て部320は、OS(309)で動作する仮想化基盤およびDBMSと協調して資源割当てを実行する。CPU資源の増減を行う場合、資源割当て部320は、対象となるDBMSが動作している仮想マシンのCPU利用率、または実行コア数を変更する。さらに、資源割当て部320は、仮想マシン上のOSの機能を利用し、DBMSへ割当てる仮想CPUのコア数、利用率を変更してもよい。I/O資源の増減を行う場合、資源割当て部320は、対象となるDBMSが動作する仮想マシンが使用している仮想デバイスのI/O帯域を変更する。メモリ資源を追加する場合、資源割当て部320は、仮想化基盤の機能を用いて、対象となるDBMSが動作する仮想マシンに割当てるメモリを増やす。資源割り当て部320は、仮想マシン上のDBMSと通信を行い、DB基本情報管理部(353、383)へメモリ追加を通知する。なお、仮想マシン内にメモリが十分ある場合は、仮想マシンに対するメモリ増設は省略してもよい。メモリ資源を減らす場合、資源割り当て部320は、仮想マシン上のDBMSと通信を行い、DB基本情報管理部(353、383)へメモリ解放を通知し、DBMSが利用するメモリの一部を解放する。資源割当て部320は、仮想化基盤の機能を用いて、仮想マシンへのメモリ割り当てを減らす。
When the DBMSs 3 and 4 (340 and 370) are applications in the virtual machine using the virtualization mechanism, the resource allocation unit 320 performs resource allocation in cooperation with the virtualization platform and the DBMS operating on the OS (309). Execute. When increasing or decreasing the CPU resource, the resource allocation unit 320 changes the CPU utilization rate or the number of execution cores of the virtual machine on which the target DBMS is operating. Furthermore, the resource allocation unit 320 may change the number of cores and the utilization rate of the virtual CPU allocated to the DBMS by using the function of the OS on the virtual machine. When increasing or decreasing the I / O resource, the resource allocation unit 320 changes the I / O bandwidth of the virtual device used by the virtual machine on which the target DBMS operates. When adding a memory resource, the resource allocation unit 320 uses a virtualization platform function to increase the memory allocated to the virtual machine on which the target DBMS operates. The resource allocation unit 320 communicates with the DBMS on the virtual machine and notifies the DB basic information management unit (353, 383) of the memory addition. If there is sufficient memory in the virtual machine, the memory expansion for the virtual machine may be omitted. When reducing the memory resources, the resource allocation unit 320 communicates with the DBMS on the virtual machine, notifies the DB basic information management unit (353, 383) of the memory release, and releases a part of the memory used by the DBMS. . The resource allocation unit 320 reduces the memory allocation to the virtual machine by using the virtualization infrastructure function.
資源割当て部320は、資源割当てが完了すると、管理サーバ200に資源割当て変更完了を通知する。
When the resource allocation is completed, the resource allocation unit 320 notifies the management server 200 of the completion of the resource allocation change.
図5のクエリは、既に述べたとおり、分析サーバにて売り上げをソートしその上位10件について、経済指標と、SNSに検索を行っている。図6の実行プランに示すように、上位10件が決まるまで外部DBサーバへの検索が行えない。
As described above, the query in FIG. 5 sorts the sales by the analysis server and searches the top 10 cases for the economic index and SNS. As shown in the execution plan of FIG. 6, the search to the external DB server cannot be performed until the top 10 cases are determined.
図18は、図5とは異なるクエリの例を示している。図18のクエリは、分析サーバのDBMS1に格納されている売上データのうち、2013年の売上について、2013年の商品別の売上、経済指標、ソーシャルメディアで個々の商品が取り上げられた数を計算する。経済指標は、商品と関係なく求めることができるため売上表の検索と経済指標の検索は、同時に実行することができる。また、経済指標の検索コストはSNS表の検索よりも処理コストが低いため、先に経済指標の結果を求め、実行完了後にSNSの情報を蓄積したDBMS4に資源を割当てる方が効率がよい。このように、クエリ実行ごとに資源割当てを行うことで、クエリの実行に最適な割当てとなり、クエリを高速に実行することができる。
FIG. 18 shows an example of a query different from FIG. The query in FIG. 18 calculates the number of individual products taken up in 2013 by sales, economic indicators, and social media for sales in 2013 among the sales data stored in DBMS 1 of the analysis server. To do. Since the economic index can be obtained regardless of the product, the sales table search and the economic index search can be executed simultaneously. Moreover, since the economic index search cost is lower than the SNS table search cost, it is more efficient to obtain the result of the economic index first and allocate resources to the DBMS 4 in which the SNS information is accumulated after the execution is completed. As described above, by performing resource allocation for each query execution, the allocation is optimal for query execution, and the query can be executed at high speed.
図19は、異なる実施形態であり、図1における管理サーバ200の機能と外部DBサーバ300の機能が同一の計算機上である外部DBサーバ1800で動作する例を示している(CPU等のハードウェアとソフトウェアモジュールの詳細は省略している)。外部DBサーバ1800を用いる場合、資源調整部211、外部のDBMS(340、370)および資源割当て部320の通信は、計算機間の通信に通常用いられるネットワークインタフェースカード(NIC)ではなく、より軽量に処理できるプロセス間通信を用いる。具体的には、資源調整部211から外部DBMSへのクエリのプランコスト情報の要求、外部DBMSから資源調整部211へのプランコスト情報の送信、資源調整部211から資源割当て部320への資源割当て要求(再割当てを含む)、資源割当て部320から資源調整部211への割当て完了通知、が該当する。なお、プロセス間通信の実現方式として、共有メモリへのデータの読み書きを利用してもよい。
FIG. 19 is a different embodiment, and shows an example in which the functions of the management server 200 and the external DB server 300 in FIG. 1 operate on the external DB server 1800 on the same computer (hardware such as a CPU). And details of software modules are omitted). When the external DB server 1800 is used, communication between the resource adjustment unit 211, the external DBMS (340, 370), and the resource allocation unit 320 is not a network interface card (NIC) normally used for communication between computers, but lighter. Use interprocess communication that can be handled. Specifically, the plan cost information request of the query from the resource adjustment unit 211 to the external DBMS, the transmission of the plan cost information from the external DBMS to the resource adjustment unit 211, the resource allocation from the resource adjustment unit 211 to the resource allocation unit 320 A request (including reassignment) and an assignment completion notification from the resource assignment unit 320 to the resource adjustment unit 211 are applicable. Note that data read / write to the shared memory may be used as a method for realizing inter-process communication.
資源調整部211は、図19の構成は図1の構成よりも通信オーバヘッドが削減されるため、ステップS4209やS4215で利用する同一区間で実行するかどうかを判定するための時間を、より短い時間にできる。
Since the communication overhead is reduced in the resource adjustment unit 211 in the configuration of FIG. 19 compared to the configuration of FIG. 1, the time for determining whether to execute in the same section used in steps S4209 and S4215 is shorter. Can be.
資源調整部211と外部DB管理部221は、資源管理テーブル2000、外部データベース情報2100で管理する資源の情報を、外部DBサーバ1800のOSに直接問い合わせて利用することができる。資源調整部211と外部DB管理部221は、直接利用することで、OSが管理するより正確な資源量で資源の割当て計算ができる。
The resource adjustment unit 211 and the external DB management unit 221 can use the resource information managed by the resource management table 2000 and the external database information 2100 by directly querying the OS of the external DB server 1800. By directly using the resource adjustment unit 211 and the external DB management unit 221, the resource allocation calculation can be performed with a more accurate resource amount managed by the OS.
図20は、更に異なる実施例であり、外部データを管理するDBMSが、それぞれ別々のサーバ上で動作し、データは共有ストレージに格納されている例を示している。外部DB管理部221は、外部データベース情報2100のストレージの情報領域を用いて、DBMSのデータ格納に関する情報を管理する。これにより、IPアドレスや物理サーバ名が異なる場合でも、ストレージ装置が共有される場合が検出できる。資源調整部211は、ステップS4213において、割当て対象が同一かどうかを判定する際、ストレージの性能と共有状態により、サーバが異なる場合でも、ステップS4215のフローを実行し、I/O資源の割当てを調整する。
FIG. 20 shows a further different embodiment, in which DBMSs for managing external data operate on different servers, and the data is stored in the shared storage. The external DB management unit 221 uses the storage information area of the external database information 2100 to manage information related to data storage in the DBMS. Thereby, even when the IP address and the physical server name are different, it is possible to detect the case where the storage apparatus is shared. When determining whether the allocation targets are the same in step S4213, the resource adjustment unit 211 executes the flow of step S4215 to allocate I / O resources even if the servers differ depending on the storage performance and the shared state. adjust.
資源調整部211が共有ストレージの資源割当てを増減する場合、資源割当て部1(2510)、資源割当て部2(2520)は、共有ストレージ内のキャッシュ量の増減や帯域の増減も考慮して資源割当てを行う。また、ストレージ装置が複数のI/Oポートを持ち、使用するポートの本数を変えることで帯域を変えられる場合は、ストレージ装置の管理機能を用いて、ポートの設定を変えてもよい。
When the resource adjustment unit 211 increases or decreases the resource allocation of the shared storage, the resource allocation unit 1 (2510) and the resource allocation unit 2 (2520) consider the increase or decrease of the cache amount and the increase or decrease of the bandwidth in the shared storage. I do. Further, when the storage apparatus has a plurality of I / O ports and the bandwidth can be changed by changing the number of ports to be used, the setting of the ports may be changed using the management function of the storage apparatus.
また、各外部DBサーバに複数のインスタンスが用意できる場合(例えば、外部DBサーバ1(2401)にDBMS3(340)の実行バイナリの他に、DBMS4(370)の実行バイナリも配置)、資源調整部211は、外部DBサーバ1(2501)でDBMS4(370)を起動してクエリを実行するよう管理することもできる。例えば、ステップS4201とS4203で高い優先度で実行するクエリの割り当てが、ステップS4233で割り当てできなかった場合に、ステップS4235を実施する代わりに、ストレージを共有する別の外部DBサーバ上で当該クエリを実行するDBMSを起動する。また、別の例としては、ステップS4215でクエリ区間と割り当て変更区間を再計算する際に、資源調整部211は、実行管理テーブル1100と資源管理テーブル2000を参照し、一方のDBMSが動作するサーバの残りの資源量が、予め設定した基準値を下回っている場合は、他方のサーバにクエリを実行するDBMSを起動する。DBMSを起動する場合、資源調整部211は、対象となるサーバの資源割当て部に依頼を出す。サーバの資源割当て部は、依頼に基づき、DBMSを起動する。資源調整部211は、同一のDBMSに対して複数の外部DBサーバがある場合、ステップ1073で送信するクエリ処理準備完了において、クエリをどのサーバへ要求すべきかを分析サーバへヒント情報として通知する。
In addition, when a plurality of instances can be prepared in each external DB server (for example, the execution binary of DBMS4 (370) is also arranged in the external DB server 1 (2401) in addition to the execution binary of DBMS3 (340)), the resource adjustment unit 211 can also manage the external DB server 1 (2501) to activate the DBMS 4 (370) and execute the query. For example, if the query to be executed with high priority in steps S4201 and S4203 cannot be assigned in step S4233, instead of executing step S4235, the query is executed on another external DB server sharing the storage. Start the DBMS to be executed. As another example, when recalculating the query interval and the allocation change interval in step S4215, the resource adjustment unit 211 refers to the execution management table 1100 and the resource management table 2000, and the server on which one DBMS operates. If the remaining resource amount is less than a preset reference value, a DBMS that executes a query to the other server is started. When starting the DBMS, the resource adjustment unit 211 issues a request to the resource allocation unit of the target server. The resource allocation unit of the server activates the DBMS based on the request. When there are a plurality of external DB servers for the same DBMS, the resource adjustment unit 211 notifies the analysis server as to which server the query should be requested as hint information when the query processing preparation transmitted in step 1073 is completed.
なお、資源調整部211は、外部DBサーバ1でのDBMS4(370)のクエリ実行に関して、資源が不足した場合にDBMSを起動するのではなく、事前に起動状態にしておき、資源が不足した場合に、外部DBサーバ1のDBMSでクエリを実行するよう管理をしてもよい。
Note that the resource adjustment unit 211 does not start the DBMS when resources are insufficient for query execution of the DBMS 4 (370) in the external DB server 1. In addition, management may be performed so that the query is executed by the DBMS of the external DB server 1.
図21は、外部データのDBMSが、別々の外部DBサーバ上で動作し、ストレージが個々のサーバに接続される別の実施例の構成の一部を示している。この例では、ストレージを共有していないが、ストレージ2510とストレージ2540には同一のデータSNS387を保持している。SNSに関するクエリを実行するDBMS4(370)は、外部DBサーバ1(2501)と外部DBサーバ2(2531)の両方で実行できる。外部DB管理部221は、外部データベース情報2100のストレージの情報として、当該データが書かれているサーバを記録すると共に、当該DBMSと同じ役割を提供する別サーバの情報を記録する。例えば、DBMS6がSNSのクエリを実行する別のDBMSである場合、外部DB管理部221は、外部データベース情報2100においてDBMS4の別サーバの欄にDBMS6を登録する(この場合、図17では図示されていないが、DBMS6の行も別途登録される)。
FIG. 21 shows a part of a configuration of another embodiment in which the DBMS of external data operates on different external DB servers, and the storage is connected to each server. In this example, the storage is not shared, but the storage 2510 and the storage 2540 hold the same data SNS387. The DBMS 4 (370) that executes the query related to the SNS can be executed by both the external DB server 1 (2501) and the external DB server 2 (2531). The external DB management unit 221 records the server in which the data is written as storage information of the external database information 2100 and also records information of another server that provides the same role as the DBMS. For example, when the DBMS 6 is another DBMS that executes an SNS query, the external DB management unit 221 registers the DBMS 6 in the column of another server of the DBMS 4 in the external database information 2100 (in this case, it is illustrated in FIG. 17). (The DBMS6 line is also registered separately).
資源調整部211は、同一の外部データのクエリを実行する外部DBサーバが複数存在する場合、ステップS1022の外部DBサーバへのプランコスト情報の要求の際、候補となる全ての外部DBサーバに依頼する。資源調整部211は、ステップS4209において、得られたプランコスト情報より、どのDBMSに問い合わせを行うかを選択する。例えば、コスト情報と利用可能な資源情報から一番実行時間が短いDBMSを選択し、そのDBMSの実行プランで区間の再計算と割当てを変更する区間を選択する。もしくは、処理する外部データごとに優先的に利用するDBMSをひとつまたは複数決めておき、対象のDBMSのみプランコスト情報を依頼してもよい。
When there are a plurality of external DB servers that execute the same external data query, the resource adjustment unit 211 requests all candidate external DB servers when requesting the plan cost information to the external DB server in step S1022 To do. In step S4209, the resource adjustment unit 211 selects which DBMS to inquire from the obtained plan cost information. For example, the DBMS having the shortest execution time is selected from the cost information and the available resource information, and the section in which recalculation and allocation of the section is changed is selected by the execution plan of the DBMS. Alternatively, one or a plurality of DBMSs to be preferentially used may be determined for each external data to be processed, and plan cost information may be requested only for the target DBMS.
また、資源調整部211は、実施例3と同様に、ステップS4233で割り当てが行えない場合は、ステップS4235の代わりに、同一の外部データのクエリを実行する別のDBMSを選択して、資源割当てが可能かを計算する。
Similarly to the third embodiment, the resource adjustment unit 211 selects another DBMS that executes the query of the same external data, instead of step S4235, if the allocation cannot be performed in step S4233, and allocates resources. Calculate whether is possible.
101 分析サーバ1、109 プラン生成部、111 外部クエリ処理部、113 SQL実行部、200 管理サーバ、211 資源調整部、300 外部DBサーバ、320 資源割当て部、347 プラン生成部、349 プラン情報連携部、377 プラン生成部、379 プラン情報連携部、1100 実行管理テーブル、1200 分析DB情報、1300 ユーザ情報、1400 優先度対応表、2000 資源管理テーブル、2100 外部データベース情報
101 analysis server 1, 109 plan generation unit, 111 external query processing unit, 113 SQL execution unit, 200 management server, 211 resource adjustment unit, 300 external DB server, 320 resource allocation unit, 347 plan generation unit, 349 plan information linkage unit 377 Plan generation unit, 379 Plan information linkage unit, 1100 execution management table, 1200 analysis DB information, 1300 user information, 1400 priority correspondence table, 2000 resource management table, 2100 external database information
Claims (4)
- 第一のDBMSと複数の第二のDBMSと管理サーバを備えるデータ処理システムであって、
第一のDBMSは、
第一のクエリを受信する外部受信部と、
前記外部受信部が受信した第一のクエリから他のDBMSが管理するデータを抽出し、抽出したデータを同時に処理することができるデータの範囲である複数の区間に分割し、分割した区間ごとに第二のクエリを生成する外部クエリ処理部と、
生成した複数の第二のクエリを配布するクエリ配布部と、
配布した第二のクエリの処理結果を受け取るクエリ回収部とを備え
第二のDBMSは、
前記クエリ配布部が送信した第二のクエリを受信する受信部と、
受信したクエリを実行するクエリ処理部と、
第二のクエリの実行プランとコストを回答するプラン情報連携部と、
前記クエリ処理が処理した結果を第一のDBMSへ送信する送信部と備え
管理サーバは、
配布された複数の第二のクエリの実行プランとコストを問い合わせ、受け取った実行プランとコストを基に区間を変更し、変更された区間に基づき第二のクエリを実行する計算機リソース量を算出し、変更された区間に基づき第三のクエリの作成と配布を第一のDBMSへ通知する資源調整部を備え、
第二のDBMSが第三のクエリを配布された計算機リソース量に基づいて処理した結果を第一のDBMSへ送付し、
第一のDBMSが送付された第三のクエリの処理結果を集計することを特徴とするデータ処理システム。 A data processing system comprising a first DBMS, a plurality of second DBMSs, and a management server,
The first DBMS is
An external receiver for receiving the first query;
The data managed by another DBMS is extracted from the first query received by the external receiver, and the extracted data is divided into a plurality of sections that can be processed at the same time. An external query processing unit for generating a second query;
A query distribution unit that distributes the plurality of generated second queries;
And a query collection unit that receives the processing result of the distributed second query.
A receiving unit for receiving the second query transmitted by the query distributing unit;
A query processing unit for executing the received query;
A plan information linkage unit that answers the execution plan and cost of the second query;
The management server includes a transmission unit that transmits the result of the query processing to the first DBMS.
Queries the execution plans and costs of the distributed multiple second queries, changes the interval based on the received execution plans and costs, and calculates the amount of computer resources to execute the second query based on the changed intervals A resource adjustment unit for notifying the first DBMS of creation and distribution of the third query based on the changed section;
The second DBMS sends the result of processing the third query based on the distributed computer resource amount to the first DBMS,
A data processing system, wherein the processing results of the third query sent to the first DBMS are aggregated. - 前記外部受信部は複数のユーザからのクエリを受け付け、前記資源調整部はDBMSの優先度とユーザの優先度を基に資源割当て量を定めた優先度対応表を参照し、
クエリを受け付けたユーザと、前記クエリが参照するDBMSに基づき資源割当て量を決定し、
第三のクエリを作成することを特徴とする請求項1に記載のデータ処理システム。 The external reception unit accepts queries from a plurality of users, the resource adjustment unit refers to a priority correspondence table in which resource allocation amount is determined based on DBMS priority and user priority,
A resource allocation amount is determined based on a user who receives the query and a DBMS referred to by the query;
The data processing system according to claim 1, wherein a third query is created. - 外部受信部と外部クエリ処理部、クエリ配布部及びクエリ回収部を備える第一のDBMSと、受信部とクエリ処理部及びプラン情報連携部を備える複数の第二のDBMSと、管理サーバを備えるデータ処理システムのデータ処理方法であって、
第一のDBMSが備える外部受信部が第一のクエリを受信し、
外部クエリ処理部は、前記外部受信部が受信した第一のクエリから他のDBMSが管理するデータを抽出し、抽出したデータを同時に処理することができるデータの範囲である複数の区間に分割し、分割した区間ごとに第二のクエリを生成し、
クエリ配布部が生成した複数の第二のクエリを配布し、
クエリ回収部が配布した第二のクエリの処理結果を受け取り、
第二のDBMSの受信部は前記クエリ配布部が送信した第二のクエリを受信し、
クエリ処理部が受信したクエリを実行し、
プラン情報連携部が第二のクエリの実行プランとコストを回答し、
送信部が前記クエリ処理が処理した結果を第一のDBMSへ送信し、
管理サーバの資源調整部が配布された複数の第二のクエリの実行プランとコストを問い合わせ、受け取った実行プランとコストを基に区間を変更し、変更された区間に基づき第二のクエリを実行する計算機リソース量を算出し、変更された区間に基づき第三のクエリの作成と配布を第一のDBMSに通知し、
第二のDBMSが第三のクエリを配布された計算機リソース量に基づいて処理した結果を第一のDBMSへ送付し、
第一のDBMSが送付された第三のクエリの処理結果を集計することを特徴とするデータ処理システムのデータ処理方法。 Data including a first DBMS including an external reception unit, an external query processing unit, a query distribution unit, and a query collection unit, a plurality of second DBMSs including a reception unit, a query processing unit, and a plan information cooperation unit, and a management server A data processing method for a processing system,
The external receiver included in the first DBMS receives the first query,
The external query processing unit extracts data managed by another DBMS from the first query received by the external reception unit, and divides the extracted data into a plurality of sections that can be processed simultaneously. , Generate a second query for each segment,
Distribute multiple second queries generated by the query distributor,
Receive the processing result of the second query distributed by the query collection department,
The receiving unit of the second DBMS receives the second query transmitted by the query distributing unit,
Execute the query received by the query processing unit,
The plan information cooperation department answers the execution plan and cost of the second query,
The transmission unit transmits the result processed by the query process to the first DBMS,
The resource coordinator of the management server inquires about the execution plan and cost of the multiple second queries distributed, changes the interval based on the received execution plan and cost, and executes the second query based on the changed interval The amount of computer resources to be calculated, and notification of the creation and distribution of the third query to the first DBMS based on the changed section,
The second DBMS sends the result of processing the third query based on the distributed computer resource amount to the first DBMS,
A data processing method for a data processing system, wherein the processing results of a third query sent to the first DBMS are aggregated. - 前記外部受信部は複数のユーザからのクエリを受け付け、前記資源調整部はDBMSの優先度とユーザの優先度を基に資源割当て量を定めた優先度対応表を参照し、
クエリを受け付けたユーザと、前記クエリが参照するDBMSに基づき資源割当て量を決定し、
第三のクエリを作成することを特徴とする請求項3に記載のデータ処理システムのデータ処理方法。 The external reception unit accepts queries from a plurality of users, the resource adjustment unit refers to a priority correspondence table in which resource allocation amount is determined based on DBMS priority and user priority,
A resource allocation amount is determined based on a user who receives the query and a DBMS referred to by the query;
The data processing method of the data processing system according to claim 3, wherein a third query is created.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2014/082366 WO2016092604A1 (en) | 2014-12-08 | 2014-12-08 | Data processing system and data access method |
JP2016563299A JPWO2016092604A1 (en) | 2014-12-08 | 2014-12-08 | Data processing system and data access method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2014/082366 WO2016092604A1 (en) | 2014-12-08 | 2014-12-08 | Data processing system and data access method |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016092604A1 true WO2016092604A1 (en) | 2016-06-16 |
Family
ID=56106858
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2014/082366 WO2016092604A1 (en) | 2014-12-08 | 2014-12-08 | Data processing system and data access method |
Country Status (2)
Country | Link |
---|---|
JP (1) | JPWO2016092604A1 (en) |
WO (1) | WO2016092604A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112540843A (en) * | 2019-09-20 | 2021-03-23 | 杭州海康威视数字技术股份有限公司 | Resource allocation method and device, storage equipment and storage medium |
CN112950003A (en) * | 2021-02-07 | 2021-06-11 | 北京淇瑀信息科技有限公司 | User resource quota adjusting method and device and electronic equipment |
WO2022137425A1 (en) * | 2020-12-24 | 2022-06-30 | 日本電信電話株式会社 | Communication system, server, client, server control method, and client control method |
WO2023243039A1 (en) * | 2022-06-16 | 2023-12-21 | 日本電信電話株式会社 | Information processing apparatus, information processing method, and program |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007026373A (en) * | 2005-07-21 | 2007-02-01 | Hitachi Ltd | Stream data processing system and stream data processing method |
JP2008112289A (en) * | 2006-10-30 | 2008-05-15 | Internatl Business Mach Corp <Ibm> | System, method and program for integrating databases |
JP2012059130A (en) * | 2010-09-10 | 2012-03-22 | Hitachi Ltd | Computer system, data retrieval method and database management computer |
JP2013003695A (en) * | 2011-06-14 | 2013-01-07 | Toshiba Corp | Distributed database retrieval device, distributed database retrieval method and program |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007249468A (en) * | 2006-03-15 | 2007-09-27 | Hitachi Ltd | Cpu allocation method, cpu allocation program, cpu allocation device and database management system |
JP5011006B2 (en) * | 2007-07-03 | 2012-08-29 | 株式会社日立製作所 | Resource allocation method, resource allocation program, and resource allocation device |
US20120239688A1 (en) * | 2009-12-04 | 2012-09-20 | Takatoshi Yanase | Table lookup apparatus, table lookup method, and table lookup system |
US9208197B2 (en) * | 2011-10-21 | 2015-12-08 | International Business Machines Corporation | Dynamic SMT in parallel database systems |
WO2013161080A1 (en) * | 2012-04-27 | 2013-10-31 | 株式会社日立製作所 | Database management system, computer, and database management method |
JP6040745B2 (en) * | 2012-12-11 | 2016-12-07 | 富士通株式会社 | Information processing apparatus, information processing method, information processing program, and content providing system |
-
2014
- 2014-12-08 WO PCT/JP2014/082366 patent/WO2016092604A1/en active Application Filing
- 2014-12-08 JP JP2016563299A patent/JPWO2016092604A1/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007026373A (en) * | 2005-07-21 | 2007-02-01 | Hitachi Ltd | Stream data processing system and stream data processing method |
JP2008112289A (en) * | 2006-10-30 | 2008-05-15 | Internatl Business Mach Corp <Ibm> | System, method and program for integrating databases |
JP2012059130A (en) * | 2010-09-10 | 2012-03-22 | Hitachi Ltd | Computer system, data retrieval method and database management computer |
JP2013003695A (en) * | 2011-06-14 | 2013-01-07 | Toshiba Corp | Distributed database retrieval device, distributed database retrieval method and program |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112540843A (en) * | 2019-09-20 | 2021-03-23 | 杭州海康威视数字技术股份有限公司 | Resource allocation method and device, storage equipment and storage medium |
CN112540843B (en) * | 2019-09-20 | 2024-05-07 | 杭州海康威视数字技术股份有限公司 | Resource allocation method and device, storage equipment and storage medium |
WO2022137425A1 (en) * | 2020-12-24 | 2022-06-30 | 日本電信電話株式会社 | Communication system, server, client, server control method, and client control method |
JP7553838B2 (en) | 2020-12-24 | 2024-09-19 | 日本電信電話株式会社 | COMMUNICATION SYSTEM, SERVER, CLIENT, SERVER CONTROL METHOD, AND CLIENT CONTROL METHOD |
CN112950003A (en) * | 2021-02-07 | 2021-06-11 | 北京淇瑀信息科技有限公司 | User resource quota adjusting method and device and electronic equipment |
WO2023243039A1 (en) * | 2022-06-16 | 2023-12-21 | 日本電信電話株式会社 | Information processing apparatus, information processing method, and program |
Also Published As
Publication number | Publication date |
---|---|
JPWO2016092604A1 (en) | 2017-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11620308B2 (en) | Adaptive distribution method for hash operations | |
WO2019184739A1 (en) | Data query method, apparatus and device | |
CN103106249B (en) | A kind of parallel data processing system based on Cassandra | |
US11394794B2 (en) | Fast ingestion of records in a database using data locality and queuing | |
CN110008257A (en) | Data processing method, device, system, computer equipment and storage medium | |
US9774676B2 (en) | Storing and moving data in a distributed storage system | |
KR20150114965A (en) | Data stream splitting for low-latency data access | |
JP2008123040A (en) | Resource assignment method, resource assignment program and management computer | |
WO2016092604A1 (en) | Data processing system and data access method | |
CN102054000A (en) | Data querying method, device and system | |
CN105683941A (en) | Regulating enterprise database warehouse resource usage | |
CN111400301B (en) | Data query method, device and equipment | |
CN112597173A (en) | Distributed database cluster system peer-to-peer processing system and processing method | |
JPH06309284A (en) | Inquiry processing load distributing method | |
KR101512647B1 (en) | Method For Choosing Query Processing Engine | |
CN110247855B (en) | Data exchange method, client and server | |
CN110555080B (en) | Online analysis processing method, device and system |
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: 14907664 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2016563299 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 14907664 Country of ref document: EP Kind code of ref document: A1 |