WO2017056189A1 - 管理システム、データ処理方法、及び記憶媒体 - Google Patents

管理システム、データ処理方法、及び記憶媒体 Download PDF

Info

Publication number
WO2017056189A1
WO2017056189A1 PCT/JP2015/077505 JP2015077505W WO2017056189A1 WO 2017056189 A1 WO2017056189 A1 WO 2017056189A1 JP 2015077505 W JP2015077505 W JP 2015077505W WO 2017056189 A1 WO2017056189 A1 WO 2017056189A1
Authority
WO
WIPO (PCT)
Prior art keywords
processing
query
table function
input
execution plan
Prior art date
Application number
PCT/JP2015/077505
Other languages
English (en)
French (fr)
Inventor
信之 山下
紘平 礒松
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2015/077505 priority Critical patent/WO2017056189A1/ja
Publication of WO2017056189A1 publication Critical patent/WO2017056189A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to a management system, a data processing method, and a storage medium, and in particular, in a database, a management system for data handled by SQL, a data processing method for the data, and a program for realizing the data processing method are stored. It is suitable for application to a storage medium.
  • SQL Structured Query Language
  • DBMS Database Management System
  • Data handled by SQL is managed in the form of a table composed of a plurality of rows. Each row constituting the table is composed of a plurality of columns, and data of the same data type is stored in the same column of each row.
  • a row is a unit for manipulating a table.
  • SQL call function a function that can be explicitly called in an SQL statement is called an SQL call function (SQL-invoked function).
  • SQL a function definition means by a user is also provided.
  • the SQL call function an argument format that can be specified for each function is determined, and a data type is determined for each argument.
  • INTEGER INTEGER
  • CHARACTER 10
  • “table function” is defined in ISO / IEC9075: 2003.
  • the “table function” is an SQL call function that returns tabular data.
  • Patent Document 1 as a technique that contributes to a cross-search using a table function, the join method can be switched to an appropriate join method during the join process, so that the execution speed of the join query can be increased.
  • a method for performing a combination is disclosed.
  • Patent Document 2 a plurality of SQL statements are transferred together in an internal format that can be executed by a single activation request, and a plurality of SQL statements are activated by a single activation request.
  • a technique for reducing the number of communication and the number of communication between the database server and the client is disclosed.
  • each detection result from a plurality of sensors is In a case where a plurality of CSV format files divided by date are recorded and accumulated, the CSV file name specified as an argument in the table function is not a single file name but a collection of file names. It is preferable to pass.
  • Patent Document 1 or Patent Document 2 does not disclose an effective technique that can solve the above-described problem in executing a table function using table data as an argument.
  • the present invention has been made in consideration of the above points.
  • a table format data is specified as an argument of a table function
  • a database management system and data that enable high-speed processing of the execution of the table function are provided.
  • a processing method and a storage medium are proposed.
  • a definition processing unit that registers a definition of a table function that allows tabular data as an argument in a mode that includes attribute information relating to the feasibility of parallel processing by the table function;
  • a definition request for each table function registered by the definition processing unit and an information management unit that holds base table information related to base table data stored in a storage medium and a query request including the table function are input , Based on the attribute information included in the definition information of the table function included in the query request, and the base table information corresponding to the input table passed as an argument of the query request among the base table data.
  • a query execution plan creation unit that creates an execution plan of the query request by processing, and the query request reference based on the execution plan created by the query execution plan creation unit.
  • a query execution unit that performs parallel processing on the input table and the table function included in the query request, a result merge unit that merges and outputs the execution results of the processing by the query execution unit,
  • a management system comprising: is provided.
  • a definition processing step for registering a definition of a table function that allows tabular data as an argument in a form including attribute information relating to the feasibility of parallel processing by the table function
  • an information management step for holding definition information for each table function registered in the definition processing step, and base table information related to base table data stored in a storage medium, and a query request including the table function
  • a query execution plan creation step for creating an execution plan for the query request in parallel processing, and the execution plan created in the query execution plan creation step.
  • the input table passed in the argument of the query request and the table function included in the query request are respectively processed in parallel, and the execution results of the processing by the query execution step are merged into a set format And a result merging step for outputting the data.
  • a data processing method is provided.
  • a definition processing step for registering a definition of a table function that allows tabular data as an argument in a form including attribute information relating to the feasibility of parallel processing by the table function
  • an information management step for holding definition information for each table function registered in the definition processing step, and base table information related to base table data stored in a storage medium, and a query request including the table function
  • a query execution plan creation step for creating an execution plan for the query request in parallel processing, and the execution plan created in the query execution plan creation step.
  • the input table passed in the argument of the query request and the table function included in the query request are respectively processed in parallel, and the execution results of the processing by the query execution step are merged into a set format And a result merging step to be output, and a storage medium storing a program for executing a process is provided.
  • FIG. 1 It is a block diagram which shows the hardware constitutions of the management system which concerns on the 1st Embodiment of this invention. It is a block diagram which shows the logical structure in the management system shown in FIG. It is a figure for demonstrating the definition regarding base table information. It is a figure which shows the specific example of base table information. It is a figure which shows an example of a table function definition sentence. It is a figure which shows the specific example of table function information. It is a figure which shows an example of a query sentence. It is a figure for demonstrating the analysis of a query sentence. It is a flowchart which shows the example of a procedure of the process by a query execution plan creation control part.
  • FIG. 1 is a block diagram showing a hardware configuration of a management system according to the first embodiment of the present invention.
  • reference numeral 1 denotes a management system according to the first embodiment as a whole.
  • the management system 1 is configured such that clients 2 and 3 are connected to a DBMS server 5 via a network 4 and a secondary storage device 6 is connected to the DBMS server 5.
  • Each of the clients 2 and 3 is a computer device used by a user, and includes, for example, a personal computer, a workstation, a main frame, or the like.
  • the client 2 and the client 3 may be the same computer apparatus, but in FIG. 1, for the sake of brevity, they are shown separately according to their intended use.
  • the client 2 defines a table function in the DBMS server 5 via the network 4 according to the user's operation, and the client 3 makes an inquiry to the DBMS server 5 via the network 4 according to the user's operation.
  • the DBMS server 5 is a server device in which the DBMS 10 is mounted, and includes a processor 11, a main storage device 12, a communication interface (communication IF) 13, an input device 14, and an output device 15.
  • the processor 11 is a processor that controls the operation of the entire DBMS server 5, and is, for example, a CPU (Central Processing Unit).
  • a CPU Central Processing Unit
  • the main storage device 12 is composed of, for example, a volatile semiconductor memory, and mainly stores various types of software (for example, the DBMS 10 for realizing a database management system and the table function module 20 for realizing processing of table functions). To be used.
  • the processor 11 executes the software stored in the main storage device 12, various processes as described below are executed as the entire DBMS server 5.
  • the main storage device 12 stores DB management information 16 and a base table 17 as information used in the DBMS 10.
  • the DB management information 16 and the base table 17 are read from the DB management information 18 and the base table 19 stored in the secondary storage device 6 into the memory (main storage device 12) as necessary.
  • the communication IF 13 is an interface that performs protocol control at the time of communication with the clients 2 and 3 and the secondary storage device 6, and is composed of, for example, a NIC (Network Interface Card).
  • NIC Network Interface Card
  • the input device 14 is a device for a system administrator or the like to perform various operations, and includes, for example, a keyboard and a mouse.
  • the output device 15 is a device that presents various types of information to the system administrator, and includes, for example, a liquid crystal monitor, a speaker, and a printer.
  • the secondary storage device 6 is a large-capacity storage device that is used to store various data managed by the DBMS server 5, and includes, for example, a hard disk device, a RAID (Redundant Arrays of Independent Disks) system, or the like.
  • the secondary storage device 6 stores DB management information 18 based on an index of a database managed by the DBMS 10, a base table 19 based on table data managed by the DBMS 10, and the like.
  • a table function can be defined in response to a table function definition request made from the client 2.
  • This definable table function includes a table function that uses tabular data as an argument, and attribute information related to “input partition equivalence” of the table function can be defined together.
  • a table function is expressed as “a table function with a table as an argument”, and a table as an argument is expressed as an “input table”.
  • the management system 1 uses the input partition equivalence of the table function and the partition unit of the input table. Based on this, it is possible to create an efficient execution plan for parallel processing.
  • the “single method” is a sequential processing execution method, and in the execution of a query request including a table function, the entire processing is executed in one parallel processing unit.
  • the “direct connection method” is one of parallel processing execution methods, and in executing a query request including a table function, input table processing (details will be described later) is performed in a plurality of parallel processing units. This is a parallel processing method in which table function processing (details will be described later) is also performed in the same parallel processing unit.
  • the “pool method” is one of the parallel processing execution methods, and is common to the direct connection method in that parallel processing is performed in a plurality of parallel processing units when executing a query request including a table function.
  • the input division equivalence of a table function is one piece of attribute information regarding the feasibility of parallel processing by the table function.
  • the input division equivalence of a table function will be described with a more specific example.
  • a result R is a result obtained by giving an input table in the table function TF as an argument.
  • the input table is divided into several blocks (for example, a set of rows included in the input table) without duplication and omission by a certain division method PM, and each block is given as an argument to the table function TF.
  • the table function TF is input divided (for the division method PM). Equivalent ”.
  • the “table function TF is There is input division equivalence in units of lines.
  • the table function TF in order for the table function TF to satisfy the input partitioning equivalence, it is impossible to divide more than a specific set of rows (that is, a specific set of rows (specific row set) may be divided as a minimum unit of a block). It may be necessary). If such a minimum block (collection of specific rows) is called a partition, it is expressed that “the table function TF has input partition equivalence in units of partitions”.
  • An example of a typical partition is a collection of rows that can be expressed by “PARTION BY column name”. At this time, all rows having the same value as the column specified by “PARTION BY” in the input table are Included in the same partition.
  • a table function having a specific row set unit input partition equivalence can be defined as a user-defined function for a table argument, and the table function is
  • partition unit input partition equivalence partition unit input partition equivalence
  • FIG. 2 is a block diagram showing a logical configuration in the management system shown in FIG.
  • the DBMS 10 includes a definition processing unit 31, a query analysis unit 32, a query execution plan creation unit 33, and a query in addition to the DB management information 16 and the base table 17 shown in FIG.
  • An execution unit 37 is provided.
  • a table function definition statement 101 indicating the definition contents of the table function is input to the definition processing unit 31 of the DBMS 10.
  • the table function definition statement 101 includes partition equivalence information 102 indicating information related to input partition equivalence of the table function.
  • the definition processing unit 31 is a program for performing a process of defining a table function in response to a table function definition request made from the client 2, and can define a table function having a table as an argument.
  • the definition processing unit 31 may be able to define a table function or other function having a scalar value as an argument, but since these are known techniques, description thereof is omitted.
  • the definition processing unit 31 registers the processing result in the DB management information 16, specifically as the table function information 105.
  • the table function information 105 includes attribute information 106
  • the attribute information 106 includes split equivalence information 107.
  • the partition equivalence information 107 is registered based on the partition equivalence information 102 included in the table function definition statement 101 from the client 2, for example.
  • the table function information 105 registered in the DB management information 16 is not necessarily limited to the information registered as a result of the table function definition request from the client 2, and definition information regarding general or specific functions in advance. It may be registered. Details of the table function information 105 are shown in FIGS. FIG. 2 also shows that the base table information 108 indicating information related to the base table 17 is registered in the DB management information 16. Details of the base table information 108 are shown in FIGS.
  • the query analysis unit 32 is a program for performing processing for analyzing the query request in response to the query request made from the client 3, and outputs the analysis result to the query execution plan creation unit 33.
  • a query request in a format including a table function is performed.
  • the query execution plan creation unit 33 is a program for performing processing for creating an execution plan (query execution plan) on how to execute a query request based on the analysis result output from the query analysis unit 32.
  • an execution plan for a query execution plan creation control unit 34 for overall control of query execution plan creation processing and a table function (particularly a table function having a table (input table) as an argument) included in the query request.
  • the query execution plan creation unit 33 In creating a query execution plan in the query execution plan creation unit 33, various information registered in the DB management information 16 is referred to or read as appropriate. Then, the query execution plan 110 created by the query execution plan creation unit 33 is output to the query execution unit 37.
  • the query execution unit 37 is a program for performing a process of executing a query request according to the query execution plan 110 output from the query execution plan creation unit 33, and includes an execution control unit 38, a base table processing unit 39, a table function A calling unit 40 and a result merging unit 41 are provided.
  • the query request execution process in the query execution unit 37 is completed when the process by the table function module 20 is sandwiched in the middle.
  • parallel processing is determined in the query execution plan 110, each process can be executed by parallel processing as illustrated in FIG.
  • the execution control unit 38 controls each process in the query execution unit 37 based on the query execution plan 110 as a whole. Then, under the control of the execution control unit 38, the base table processing unit 39 reads and processes the input table from the base table 17 and calls the table function calling unit 40.
  • the table function calling unit 40 causes the table function processing unit 42 of the table function module 20 to call and process a table function included in the query request. At this time, the input table 111 (the divided input tables are the input tables 111a to 111c) is passed from the query execution unit 37 to the table function module 20.
  • the result merging unit 41 collects the table function result sets 112 (individually, 112a to 112c) received from the table function processing unit 42 and collects them into one result set 104, and the result set 104 as the execution result of the query request. Is output to the client 3.
  • the query analysis unit 32 analyzes the query statement 103, and the query execution plan creation unit 33. Creates a query execution plan, and the query execution unit 37 and the table function module 20 perform query execution processing.
  • the query execution processing includes processing for the input table (input table processing) and processing for the table function (table function processing). If the directly connected parallel execution method is selected in the query execution plan, input Table processing and table function processing can be executed by parallel processing of a direct connection method. Finally, the result set 104 can be returned (output) as the execution result of the query request.
  • the base table information 108 is information registered for managing the table under management of the DBMS 10 (base table 17), and the definition corresponding to the base table 17 (definition regarding base table information) is performed. be registered.
  • FIG. 3 is a diagram for explaining the definition regarding the base table information.
  • FIG. 3A shows an example of a table definition sentence
  • FIG. 3B shows an example of an index definition sentence.
  • the table “TBL1” has a VARCHAR (100) type column “CLM1” and an INT type column “CLM2”, and “AREA03” and “ “AREA07” is stored (details are omitted).
  • FIG. 4 is a diagram showing a specific example of base table information.
  • an example of the base table information 108 registered based on the table definition sentence shown in FIG. 3A is shown as definition information 121, column information 122, and storage location information 123.
  • the definition information 121 is information related to the definition of the table.
  • the table name is “TBL1” and the number of columns is “2”.
  • the column information 122 is information about each column of the table.
  • the first column has the column name “CLM1”, the type “VARCHAR (10)”, the second column
  • the column indicates that the column name is “CLM2” and the type is “INT”.
  • the storage location information 123 is information relating to the storage location of the table.
  • the table “TBL1” is stored in the storage area names “AREA03” and “AREA07”.
  • the information registered in the base table information 108 is not limited to the definition information 121, the column information 122, and the storage position information 123 described above.
  • Table information can be registered. For example, based on the index definition sentence illustrated in FIG. 3B, information regarding the index added to the table “TBL1” can be registered as “index information”.
  • table function definition statement 101 for defining a table function to be defined is transmitted to the definition processing unit 31 of the DBMS 10.
  • the in the present embodiment it is assumed that such table function definition statement 101 includes information (partition equivalence information 102) indicating the input partition equivalence of the target table function.
  • the definition processing unit 31 defines a table function in accordance with the definition of the input table function definition statement 101 and registers the definition information in the DB management information 16 as the table function information 105.
  • a table function having a table as an argument can be defined in the DBMS server 5 according to a request of a user (client) (a table function of a table function having a table as an argument).
  • Information 105 is registered), and the defined table function can be called in the subsequent execution of the query request.
  • FIG. 5 is a diagram showing an example of a table function definition sentence.
  • the table function “tfunc1” takes one argument “Files” in the table format (TABLE) (that is, one input table is defined). As an argument).
  • the return value is a table, and the column type is static (determined at the time of definition).
  • the argument “Files” has “divided equivalence of PER ONE ROW”, and the underlined portion in FIG. 5 corresponds to the divided equivalence information 102.
  • FIG. 6 is a diagram showing a specific example of the table function information.
  • the table function information 105 shown in FIG. 6 is an example of table function information registered based on the table function definition statement shown in FIG. Although detailed description is omitted, the definition information 131 includes table function name, number of arguments, implementation language, external name, return value column type, and return value column as definition information of the table function “tfunc1”. Numbers are shown.
  • the argument information 132 indicates information related to the argument of the table function “tfunc1”.
  • the return value column information 133 indicates information for each column of return values of the table function “tfunc1”.
  • the column information 134 of the input table shows column information in the input table that has the table function “tfunc1” as an argument.
  • the attribute information 135 indicates input split equivalence as attribute information of the table function “tfunc1”. Specifically, as with the split equivalence described in FIG. 5 (split equivalence information 102), It is shown that the input table as an argument has input division equivalence in units of rows. Note that the attribute information 135 corresponds to the attribute information 106 (more specifically, the split equivalence information 107) in FIG.
  • the table “TBL1” illustrated in FIGS. 3 and 4 is table data that can be divided in units of rows. For this reason, although details will be described later, in the first embodiment, when the table “TBL1” is an argument of the table function “tfunc1”, parallel processing based on input division equivalence in units of rows can be executed. It becomes. It should be noted that the unit (partition processing unit) that can be divided for the base table (input table as an argument of the table function) may be specified and registered in the base table information 108, or the base table information 108 may be registered. Information that can be determined from the information may be registered.
  • the definition processing unit 31 registers the table function information 105 in the DB management information 16 based on the table function definition statement 101, so that the table function requested by the user can be defined (user Definition function registration).
  • the table function can be defined even if it is a table function with a table as an argument.
  • the input partition equivalence to the input table with the argument (specifically, the partition included in the table function definition statement 101).
  • the equivalence information 102) is defined together.
  • the table function “tfunc1” illustrated in FIGS. 5 and 6 has “TABLE” type “Files” as an argument, and the table “TBL1” illustrating the base table information in FIGS. "Can be used as an argument (ie, the table function" tfunc1 "can have the table” TBL1 "as an input table).
  • the table function “tfunc1” has input division equivalence in units of rows with respect to the “Files” argument, and thus has input division equivalence in units of rows with respect to the input table “TBL1”.
  • the inquiry request in this embodiment is started when the inquiry sentence 103 is transmitted from the client 3 to the DBMS server 5.
  • the DBMS server 5 analyzes the query statement 103 (query analysis), creates a query execution plan (query execution plan creation), and executes an execution process in accordance with the query execution plan (query execution).
  • a result set 104 is returned to the client 3 as a result of the inquiry request.
  • FIG. 7 is a diagram illustrating an example of a query statement.
  • the query shown in FIG. 7 is an example of the query statement 103, and is a query including a table function “TFUNC1” having a table as an argument. Note that, as shown in FIG. 7, the type of inquiry is “SELECT”. Note that the query in FIG. 7 is not case sensitive.
  • FIG. 8 is a diagram for explaining the analysis of the query.
  • the result of syntax analysis of the query illustrated in FIG. 7 is represented by a syntax analysis tree.
  • the table function “TFUNC1” corresponds to the table function “tfunc1” illustrated in FIG. 5 and FIG. 6, and the real table “TBL1” is the table “example” illustrated in FIG. It corresponds to “TBL1”.
  • the query execution plan creation unit 33 generates a query execution plan based on the input of the query request analysis result (syntactic analysis tree) from the query analysis unit 32. create.
  • the query execution plan creation control unit 34 controls the query execution plan creation control unit 34 to create a query execution plan based on the input of the query request analysis result (syntactic analysis tree) from the query analysis unit 32. create.
  • the query execution plan creation control unit 34 controls the table function execution plan creation unit 35, and the input partition equivalence parallel execution method determination unit 36. Processing is performed in each part.
  • the processing flow of each of these units will be described using the analysis result shown in FIG. 8 as an input example.
  • FIG. 9 is a flowchart showing a procedure example of processing by the query execution plan creation control unit.
  • the query execution plan creation control unit 34 generally controls the query execution plan creation processing in the query execution plan creation unit 33.
  • the query execution plan creation control unit 34 determines the type of query (step S101).
  • the inquiry type can be determined by the instruction type of the inquiry request. For example, in the processing flow of FIG. 9, if the instruction is a table creation type instruction (specifically “SELECT”), the process proceeds to step S102. If it is another update command (specifically, “INSERT”, “UPDATE” or “DELETE”), the process proceeds to step S103. That is, in this example, the query execution plan creation unit 33 for the table function including the table argument is called only for a specific type of query request (“SELECT”).
  • SELECT is an SQL command for acquiring (extracting) data from one or a plurality of tables in the database, and a condition for acquisition can also be specified.
  • INERT is a SQL command for adding data
  • UPDATE is a SQL command for updating data
  • DELETE is a SQL command for deleting data. is there.
  • SELECT is used as a selection-type instruction, and other instructions are collectively used as an update-type instruction.
  • step S103 an execution plan (execution plan for an update processing request) for executing a query request is created in accordance with each command such as INSERT, DELETE, and UPDATE.
  • an execution plan creation process is a known technique, and a detailed description thereof will be omitted.
  • a processing unit dedicated to the creation process may be provided.
  • the query execution plan creation unit 33 outputs the query execution plan 110 created based on the processing so far to the query execution unit 37, and ends the processing.
  • step S102 the query execution plan creation control unit 34 determines whether or not the target (from) of the “SELECT” request is a table function. If the determination result in step S102 is a table function, the process proceeds to step S104. If not, the process proceeds to step S105.
  • step S105 an “SELECT” request execution plan that does not include a table function is created.
  • Such an execution plan creation process is a known technique, and a detailed description thereof will be omitted.
  • the query execution plan creation unit 33 outputs the query execution plan 110 created based on the processing so far to the query execution unit 37, and ends the processing.
  • step S104 the query execution plan creation control unit 34 determines whether a table is included in the arguments of the table function (whether there is a table argument). If it is determined in step S104 that there is a table argument, the process proceeds to step S106. If it is determined that there is no table argument, the process proceeds to step S107.
  • step S107 the execution plan of the table function having only the scalar value as an argument is determined.
  • Such an execution plan creation process is a known technique, and a detailed description thereof will be omitted.
  • a processing unit dedicated to the creation process may be provided.
  • the DBMS server 5 can also cope with table function processing using a scalar value as an argument.
  • the query execution plan creation unit 33 outputs the query execution plan 110 created based on the processing so far to the query execution unit 37, and ends the processing.
  • the query execution plan creation unit 33 is prepared in advance with a program for performing such a process. Assume that the program is called and executed.
  • step S106 the query execution plan creation control unit 34 calls the table function execution plan creation unit 35 to create a table function execution plan including a table argument.
  • the table function execution plan creation unit 35 Detailed processing by the table function execution plan creation unit 35 will be described later with reference to FIG.
  • the query execution plan 110 created based on the processing up to that time is output to the query execution unit 37, and the processing is terminated.
  • FIG. 10 is a flowchart showing an example of a processing procedure performed by the execution plan creation unit of the table function.
  • the table function execution plan creation unit 35 creates a table function execution plan including a table argument by performing processing in the procedure shown in FIG.
  • step S111 it is determined whether or not the table function has input division equivalence.
  • the determination in step S111 can be made by referring to the attribute information 106 (more specifically, the attribute information 135 shown in FIG. 6) in the table function information 105 registered in the DB management information 16.
  • step S111 If it is determined in step S111 that the table function has “row unit” input partition equivalence, it is determined whether there is a computer (DBMS server 5) resource necessary for executing parallel processing. Confirm (step S112).
  • step S111 if it is determined in step S111 that the table function has no input partitioning equivalence, or if it is determined in step S112 that there are not enough computer resources for parallel processing, the single method is selected as the query execution method ( Step S114).
  • the table function execution plan creation unit 35 selects the input processing in order to select the parallel processing execution method based on the input division equivalence in units of rows.
  • the equivalence parallel execution method determination unit 36 is called (step S113). Detailed processing by the parallel execution method determination unit 36 for input division equivalence will be described later with reference to FIG. 11.
  • the parallel execution method by the direct connection method is selected when the condition is satisfied.
  • a query execution plan based on the parallel execution method selected in step S113 or step S114 is created.
  • FIG. 11 is a flowchart showing an example of a processing procedure performed by the parallel execution method determination unit for input division equivalence.
  • the input partition equivalence parallel execution method determination unit 36 and the input division equivalence of the table function select the direct connection method as the parallel execution method based on the line unit.
  • the input partition equivalence parallel execution method determination unit 36 refers to the base table information 108 and determines whether or not the process (input table process) for the input table of the table function can be executed in parallel. (Steps S121 and S122). More precisely, it is determined whether or not the input table processing can be divided (parallel processing) in units of rows. The process of making such a determination is a known technique and will not be described in detail.
  • step S123 the direct connection method is selected as the parallel execution method.
  • the upper limit number that allows parallel execution upper limit number of parallel execution numbers
  • the determined upper limit number of parallel executions is described in the query execution plan.
  • step S124 if it is determined in step S122 that the input table processing cannot be executed in parallel, the single method is selected (step S124). This means that even if a table function has row-by-row input partition equivalence, if parallel processing cannot be performed on the input table that is the argument of the table function, parallel processing by the direct connection method is not executed. It is not possible.
  • step S123 or S124 when the table function has input division equivalence in units of rows, either the single method or the direct connection method is selected and notified to the table function execution plan creation unit 35.
  • the query execution plan creation unit 33 performs the processing shown in FIGS. 9 to 11 when the analysis result (for example, FIG. 8) of the query request including the table function having the table as an argument is input. Based on the input partition equivalence of the table function included in the query request (for example, attribute information 135) and the base table information 108 corresponding to the input table of the table function, the execution plan of the query request by parallel processing (direct connection method) (Query execution plan) can be created.
  • FIG. 12 is a diagram for explaining an example of a query execution plan. If the query execution plan of FIG. 12 is compared with the parse tree of FIG. 8, it can be seen that the process according to the query statement 103 (see FIG. 7) is planned and the parallel execution method is selected. Specifically, in FIG. 12, the execution plan is set so that the input table processing of the table function “TFUNC1” is performed in the direct execution parallel execution method. Thereafter, based on the query execution plan 110, query execution by the query execution unit 37 is performed.
  • FIG. 13 is a diagram showing the flow of the execution sequence in the query execution process.
  • the query execution processing (execution processing of the query execution plan 110) will be described in detail with reference to FIG.
  • the direct execution parallel execution method is selected in the query execution plan 110.
  • the number of executions of parallel processing (the number of parallel executions) performed between the base table processing unit 39, the table function calling unit 40, the table function processing unit 42, and the result merging unit 41 does not change.
  • the processing from the base table processing unit 39 to the result merging unit 41 is performed in the same parallel processing unit.
  • the parallel processing unit specifically corresponds to, for example, a thread or a process.
  • the execution control unit 38 starts a query execution process. At this time, an activation request is sent from the execution control unit 38 to the result merging unit 41 (step S151).
  • the execution control unit 38 sends a start request to the base table processing unit 39 (step S153) while performing loop processing for the number of executions of parallel processing (number of parallel executions) (step S152).
  • the “number of parallel executions” may be the upper limit of the number of parallel executions determined at the time of creating the query execution plan 110, but depending on the situation at the time of execution of the query execution process, the execution control unit 38. (Or the base table processing unit 39 and the table function calling unit 40) may determine the number of parallel executions anew.
  • the number of parallel executions that can be executed varies depending on the use status of resources in the DBMS server 5. Therefore, it is assumed that it is uncertain whether parallel processing can be executed with the upper limit number of parallel executions described in the query execution plan 110. Therefore, for example, the execution control unit 38 is realistically more suitable for the number of parallel executions within the range not exceeding the upper limit of the number of parallel executions described in the query execution plan 110 according to the status of the processor 11 and the main storage device 12. You may make it perform parallel processing by. By doing in this way, it can be expected that parallel processing with an excessive load is prevented and suitable parallel processing is executed. Even when the query execution unit 37 determines the actual number of parallel executions, an execution process that deviates from the query execution plan is performed so as not to exceed the upper limit of the number of parallel executions determined by the query execution plan. There is an effect to prevent it.
  • the base table processing unit 39 that has received the activation request from the execution control unit 38 generates the work table 113 (step S154).
  • the “work table” is a mechanism for temporarily holding tabular data (including table data and data processed by projection or combination).
  • the work table is mainly constructed in the main storage device 12, but may be constructed across the secondary storage device 6 when the amount of data handled is huge.
  • functions such as insertion and registration of table data in units of rows, data extraction and sorting are provided by generating the work table 113.
  • the real table processing unit 39 starts one parallel processing unit every time it receives a start request from the execution control unit 38. Then, for each activated parallel processing unit, the process of acquiring the data in charge (base table data) from the base table 17 is repeated (step S155), and each time one base table data is acquired, it is registered in the work table. (Step S156). As shown in FIG. 2, the acquisition of the base table data from the base table 17 by the base table processing unit 39 can be executed by parallel processing. Here, the acquisition of the base table data is performed in parallel by dividing the input table in units of rows or more. The assignment of the assigned range in the acquisition of the base table data is controlled by the execution control unit 38, for example.
  • the processing for the input table is performed in the query execution processing.
  • processing for the table argument (input table) of the table function included in the query request is executed in parallel processing of the direct connection method in accordance with the query execution plan.
  • processing for the table function (table function processing) is mainly performed in the query execution processing.
  • table function processing processing for the table function included in the query request is executed in parallel processing of the direct connection method according to the query execution plan.
  • the base table processing unit 39 calls the table function calling unit 40 when the acquisition of the base table data in the assigned range is completed or during the acquisition of the base table data (step S157). Then, the table function calling unit 40 notifies the table function processing unit 42 of the table function module 20 of the table function call so as to call and process the table function included in the query execution plan 110 (query request) (step S158). .
  • the argument of the table function is set. Specifically, if a table function argument is a scalar value, that value is set, and if it is a table argument, a work table handler is set. A handler for the return value table is also set.
  • the table function processing unit 42 Upon receipt of the table function call, the table function processing unit 42 executes table function execution processing for each parallel processing unit (step S159). Since it is a direct connection method, the parallel processing unit in the time processing of the table function is the same as the input table processing (for example, three).
  • step S159 in order to perform the execution process by the table function described in the query execution plan 110, the data of the table argument is necessary. Therefore, the table function processing unit 42 sends a request for acquiring the data of the input table one by one to the work table 113 as necessary (specifically, depending on the implementation contents of the table function) (Ste S160). In response to the request, the work table 113 returns one piece of input table data to the table function processing unit 42 (step S161).
  • the input table for transmitting data in this way corresponds to the divided input tables 111a to 111c shown in FIG.
  • the input table handled in the table function execution process in step S159 is divided based on the input division equivalence described in the query execution plan 110 by performing the input table process in step S155 and the like.
  • the table function processing unit 42 performs table function processing on these divided input tables 111a to 111c by direct connection parallel processing.
  • step S162 When the execution function of the table function in the table function processing unit 42 progresses to a predetermined degree, one result set of the table function is obtained as necessary (specifically, depending on the implementation contents of the table function). Each result is registered in the result merge unit 41 (step S162).
  • the result set registered in step S162 corresponds to the table function result sets 112a to 112c shown in FIG.
  • step S159 including steps S160 to S162 is performed until the processing of the table function is completed in all the started parallel processing units and all the table function result sets 112 are transmitted to the result merging unit 41.
  • the result merging unit 41 to which the table function result set 112 is sent from the table function processing unit 42 performs a process of combining (merging) a plurality of table function result sets 112 into one (step S163).
  • the merging process may be repeated every time the table function result set 112 is sent, or whenever the number of receptions of the table function result set 112 reaches a predetermined number or every predetermined time elapses. Also good.
  • step S164 when a certain number of table function result sets 112 are accumulated (step S164), the table function result sets 112 received up to this point are collected and output (returned) as a result set 104 to the client 3 ( Step S165). Thereafter, each time a certain number of table function result sets 112 are accumulated, the result set 104 is output to the client 3.
  • steps S164 and S165 are continued until all results (table function result set) of the table function execution processing in the table function processing unit 42 are received. Specifically, first, when the table function processing unit 42 executes all the table function execution processes started in step S159 and transmits all the table function result sets 112 to the result merge unit 41, the result set registration is completed. Notification is sent to the result merging unit 41 (step S166). When the result merging unit 41 receives the completion notification (step S167), the result merging unit 41 notifies the client 3 of the completion of the query execution (step S168), and ends the processing of the result merging unit 41.
  • step S158 When all the table function execution processes in the table function processing unit 42 are completed in this way, the table function call in step S158 by the table function calling unit 40 ends (step S169). The table function calling unit call in step S157 ends (step S170).
  • the base table processing unit 39 can recognize that the execution of the query plan has been completed, and the work table 113 is no longer necessary. Therefore, the base table processing unit 39 gives an instruction to discard the work table 113 (step S171), and sends all completion notifications to the execution control unit 38 (step S172).
  • steps S151 to S172 in FIG. 13 is performed, so that each unit of the query execution unit 37 and the table function processing unit 42 perform the input table processing and the table processing according to the plan contents described in the query execution plan 110. It is possible to perform table function processing, execute a query request, and return an execution result (result set 104) to the client 3. Furthermore, when executing this query request, parallel processing based on partition equivalence can be executed by a consistent direct connection method from input table processing to table function processing, so processing for query requests can be performed efficiently and at high speed. can do.
  • a table function (table function of a table argument) that uses tabular data as an argument can be defined in the DBMS server 5, thereby providing a user-defined function.
  • input partition equivalence can be defined together as attribute information regarding the possibility of parallel processing execution by the table function ( Split equivalence information 107).
  • the DBMS has a configuration that can handle the parallel processing by the “pool method”, so that when the parallel processing by the “pool method” is selected when the query execution plan is created, Query execution processing can be performed by parallel processing of “pool method”.
  • FIG. 14 is a block diagram showing a logical configuration related to query execution processing in the management system according to the second embodiment.
  • the components denoted by the same reference numerals as those in the management system 1 according to the first embodiment indicate the common configurations, and the detailed description thereof is omitted.
  • FIG. 14 shows the DBMS 50 and the table function module 52 that are configured in the DBMS server 5A of the management system 1A according to the second embodiment.
  • the configuration of the DBMS 50 shown in FIG. 14 is a partial configuration related to the query execution process, and the other configurations are the same as the configuration of the DBMS 10 shown in FIG.
  • the DBMS 50 includes a definition processing unit 31, DB management information 16, and the like (both not shown in FIG. 14).
  • a table is used as an argument according to a user's request.
  • the table function to be defined can be defined in the DBMS server 5A in a manner including the input division equivalence of the table function.
  • the query execution unit 51 in the second embodiment has the same configuration as the query execution unit 37 (see FIG. 2) in the first embodiment, and the execution control unit 53, the base table processing unit 54, A table function calling unit 55 and a result merging unit 57 are provided. Further, as a characteristic configuration of the second embodiment, a pool 58 is newly provided.
  • the pool 58 is a mechanism that provides substantially the same function as the work table 113 (see FIG. 13) described in the first embodiment, and is processed in tabular data (table data, projection data, or combination thereof). This is a mechanism for temporarily holding The difference between the pool 58 and the work table 113 will be described.
  • the work table 113 access is received only from one parallel processing unit (specifically, a thread or a process), so exclusive control is unnecessary.
  • the pool 58 preferably has an exclusive control function because it receives access from a plurality of parallel processing units (specifically, threads and processes).
  • the pool 58 is configured and shown in the query execution unit 51. However, as in the case of the work table 113, the pool 58 may be constructed in another location in the main storage device 12, Furthermore, it may be constructed across the secondary storage device 6.
  • the DBMS server 5A includes the pool 58, thereby enabling parallel processing by the “pool method”.
  • the difference between the parallel processing by the “direct connection method” and the parallel processing by the “pool method” will be described.
  • FIG. 15 is a diagram for explaining the difference in parallel processing units between the direct connection method and the pool method.
  • the direct connection method and the pool method are common in that parallel processing is performed in a plurality of parallel processing units.
  • a series of parallel processing is executed in the same parallel processing unit.
  • the pool method is different in that it can be executed in different parallel processing units across a pool in a series of parallel processing.
  • FIG. 15A shows a direct processing parallel processing model.
  • the input table processing mainly performed by the base table processing unit 39 and the table function processing performed by the table function calling unit 40 and the table function processing unit 42 are consistently performed in three parallel manners. It is shown that it is executed in parallel processing by processing units.
  • FIG. 15 (B) shows a pool type parallel processing model.
  • the input table processing mainly performed by the base table processing unit 54 is performed by three parallel processing units, and the input table as a result is temporarily stored in the pool 58.
  • the table function processing performed by the table function calling unit 55 and the table function processing unit 56 while reading the input table from the pool 58 is performed by four parallel processing units.
  • the parallel processing units do not have to be the same in the parallel processing (input table processing and table function processing) before and after the pool 58 is sandwiched.
  • the pool method that can be executed in the second embodiment is a parallel execution method in which data exchange between the input table processing and the table function processing is performed via the shared pool 58. Therefore, input table processing and table function processing can be executed in separate parallel processing units. As a result, efficient parallel processing can be realized by performing input table processing and table function processing in parallel in appropriate parallel processing units according to the resource status of the computer (DBMS server 5A). .
  • the query analysis unit 32 performs syntax analysis on the query sentence transmitted from the client 3 to the DBMS server 5 and transmits the analysis result to the query execution plan creation unit 33. This is the same as in the first embodiment.
  • FIG. 16 is a flowchart illustrating an example of a process procedure performed by the parallel execution method determination unit for input division equivalence in the second embodiment.
  • the parallel execution method determination unit 36 for input partitioning equivalence determines that the input table processing can be executed in parallel.
  • a pool method is selected as the parallel execution method (step S203).
  • a parallel execution method based on the pool method may be selected, and the upper limit number (the upper limit number of parallel execution numbers) that can be executed in parallel may be determined together.
  • the determined upper limit number of parallel executions is described in the query execution plan.
  • the query execution plan creation unit 33 displays the query execution plan in FIG. 9, FIG. 10, and FIG.
  • parallel processing is performed based on the input partition equivalence (for example, attribute information 135) of the table function included in the query request and the base table information 108 corresponding to the input table of the table function.
  • the execution plan (query execution plan) of the query request can be created.
  • FIG. 17 is a diagram showing a flow of processing of an execution sequence in the query execution processing of the second embodiment.
  • the query execution process (execution process of the query execution plan 110A) will be described in detail with reference to FIG.
  • the execution control unit 53 starts the query execution process. At this time, an activation request is sent from the execution control unit 53 to the result merging unit 57 (step S251). In addition, the execution control unit 53 generates a pool 58 (step S252). The generation of the pool 58 can be realized by securing a storage area of an appropriate size using a known technique.
  • execution control unit 53 sends an activation request to the table function calling unit 55 (step S254) while performing loop processing for the number of parallel executions (for example, four) in the table function processing (step S253).
  • different parallel processing units can be selected for input table processing and table function processing.
  • Such parallel processing units may be determined in advance when the query execution plan 110A is created, or when only the upper limit number is determined in the query execution plan 110A and the query execution process is actually started.
  • the execution control unit 53 may determine an appropriate parallel processing unit in view of the resource status and the like. In this example, as illustrated in FIG. 15B, three parallel processing units for input table processing are assumed, and four parallel processing units for table function processing are assumed.
  • the execution control unit 53 sends an activation request to the real table processing unit 54 while performing loop processing for the number of parallel executions (for example, three) in the input table processing (step S256).
  • the base table processing unit 54 When receiving the activation request from the execution control unit 53, the base table processing unit 54 that has received the activation request in step S257 activates one parallel processing unit. Then, for each activated parallel processing unit, the process of acquiring the data in charge (base table data) from the base table 17 is repeated (step S258), and each time one base table data is acquired, it is registered in the pool 58. (Step S259).
  • the assignment of the assigned range in acquiring the base table data is controlled by the execution control unit 53, for example.
  • the base table processing unit 54 When the base table processing unit 54 acquires the base table data from the base table 17 and registers it in the pool 58 based on the activation request from the execution control unit 53, the base table processing unit 54 notifies the execution control unit 53 of a completion notification (step S31). S260). When the execution control unit 53 receives the completion notification for the number of parallel executions (for example, three) in the input table processing, the execution control unit 53 ends the instruction to the base table processing unit 54 (step S261), and all of the input table processing is performed. The pool 58 is notified that the data registration has been completed (step S263).
  • the pool 58 temporarily holds the base table data registered by the base table processing unit 54 one by one after being generated by the execution control unit 53 (step S262). Such base table data for each case corresponds to a divided input table. If there is an acquisition request for the stored data (step S265), the data is provided in response to the acquisition request (step S266).
  • the table function calling unit 55 that has received the activation request in step S254 activates one parallel processing unit every time it receives an activation request from the execution control unit 53. Then, for each activated parallel processing unit, the table function processing unit 56 of the table function module 52 is notified of the table function call so as to call and process the table function included in the query execution plan 110A (query request) ( Step S255).
  • the argument of the table function is set. Specifically, if a table function argument is a scalar value, that value is set, and if it is a table argument, a pool handler is set. A handler for the return value table is also set.
  • the table function processing unit 56 Upon receipt of the table function call, the table function processing unit 56 performs table function execution processing for each activated parallel processing unit (step S264). In the process of step S264, table argument data is required to execute an execution process using the table function described in the query execution plan 110A. Therefore, the table function processing unit 56 sends a request for acquiring the data of the input table one by one to the pool 58 as necessary (specifically, depending on the implementation contents of the table function) (step S1). S265). In response to the request, one entry table data is returned from the pool 58 to the table function processing unit 42 (step S266).
  • the input table handled in the table function execution process in step S264 is divided based on the input division equivalence described in the query execution plan 110A by performing the input table process in step S258 and the like.
  • the table function processing unit 56 performs table function processing on these divided input tables by pool-type parallel processing.
  • step S267 corresponds to the table function result set shown in FIG.
  • step S264 including steps S265 to S266 is performed until the processing of the table function is completed in all the activated parallel processing units, and all the table function result sets are transmitted to the result merging unit 57.
  • the result merging unit 57 to which the table function result set is sent from the table function processing unit 56 performs a process of combining (merging) a plurality of table function result sets into one (step S268).
  • the merging process may be repeated every time a table function result set is sent, or may be performed every time the number of receptions of the table function result set reaches a predetermined number, or every time a predetermined time elapses. .
  • the table function result sets received up to this point are collected and output (returned) to the client 3 as the result set 104 (step S269). Thereafter, whenever a certain number of table function result sets are accumulated, the result set 104 is output to the client 3.
  • step S269 continues until all results (table function result set) of the table function execution processing in the table function processing unit 56 are received. Specifically, first, the table function processing unit 56 executes all the table function execution processing started in step S264, and when all the table function result sets have been transmitted to the result merge unit 57, the result set registration completion notification Is notified to the result merging unit 57 (step S270). When the result merging unit 57 receives the notification, the result merging unit 57 notifies the client 3 of the completion of the query execution (step S271), and ends the processing of the result merging unit 57.
  • the table function call unit 55 ends the table function call in step S255 (step S272), and the table function call unit 55 executes the execution control unit 53.
  • a completion notification is sent toward (step S273).
  • the execution control unit 53 completes the query execution process (step S274).
  • each part of the query execution unit 51 and the table function processing unit 56 perform input table processing and processing according to the plan contents described in the query execution plan 110A. It is possible to perform table function processing, execute a query request, and return an execution result (result set 104) to the client 3. Furthermore, in this query request execution, parallel processing based on input partitioning equivalence can be executed in a pool method using a pool 58 that is shared between input table processing and table function processing. More efficient parallel processing than the first embodiment can be realized for a query request including a function.
  • a table function of a table argument can be defined as a user-defined function, and the input partitioning equivalence of the table function can be defined together.
  • the table function input partition equivalence and the table argument partition processing unit are considered (more specifically, the input table partition processing unit and Query execution plans that take into account partition equivalence can be created (based on whether the input partition equivalence of the table function matches).
  • the management system 1A by allowing the pool method to be selected as the parallel processing execution method, it is possible to perform parallel processing that is more flexible than the direct connection method.
  • the parallel processing unit of input table processing and the parallel processing unit of table function processing can be separated in query execution processing.
  • a parallel processing unit can be set flexibly according to the situation or the like. Accordingly, high-speed query execution processing can be expected even by the direct connection method described in the first embodiment.
  • the process of each part of the query execution process can be executed in parallel by the pool type parallel process. Can be expected to be shortened.
  • the execution control unit 53 activates not only the base table processing unit 54 but also the table function calling unit 55 at the initial stage of processing. While the processing unit 54 processes the input table processing in parallel, the table function calling unit 55 and the table function processing unit 56 can perform the table function processing in parallel. By performing such parallel processing, the waiting time between the input table processing and the table function processing can be shortened, and the overall processing can be speeded up.
  • the effect of leveling the processing for each parallel processing unit can be realized by performing parallel processing of the pool method.
  • the row to be processed is determined for each parallel processing unit, so even if there is a difference in the processing amount of each parallel processing unit, the process allocation method cannot be changed.
  • the pool method even if there is a difference in the processing amount of each parallel processing unit, a thread that has been processed lightly and has finished processing can continue to process the rows that remain in the pool, so the processing leveling Is realized.
  • a table function having row-by-row input partition equivalence for a table argument can be defined as a user-defined function, and a query request including the table function is based on the input partition equivalence It is characterized by enabling execution by parallel processing.
  • a table function having a specific row set unit input partition equivalence (table partition unit input partition equivalence) for the table argument can be defined as a user-defined function, and It is possible to execute a query request including the table function by parallel processing based on the input partitioning equivalence.
  • FIG. 18 is a diagram showing a storage example of the base table.
  • the real table “BaseTbl” is data stored across different areas of AREA03, AREA07, and AREA12, and can be referred to as “a table in which boundary value division is stored”.
  • the storage boundary values (threshold values between the storage areas) of the base table “BaseTbl” are the boundary value “I” and the boundary value “R”.
  • Such a base table “BaseTbl” can be divided by a specific row set (partition) delimited by boundary values “I” and “R”.
  • FIG. 19 is a diagram illustrating an example of a table definition sentence.
  • the definition sentence shown in FIG. 19 is a table definition sentence that defines the base table “BaseTbl” shown in FIG. 18 as an example of the table stored in the boundary value division.
  • the storage area is distributed according to the value (character string) of the column “name” of the storage target row.
  • the storage area is “AREA03” if it is before “I” in the dictionary order, “AREA07” if it is before “R” after “I” in the dictionary order, and “R” in dictionary order. It is defined that “AREA 12” is set later.
  • the definition corresponding to the base table is performed by the definition using the table definition statement shown in FIG.
  • the table information 308 is registered in the DB management information 16.
  • FIG. 20 is a diagram showing a specific example of base table information. 20
  • one example of the base table information 308 registered based on the table definition sentence shown in FIG. 19 is shown as definition information 321, column information 322, and storage location information 323. A description of the detailed definition is omitted.
  • FIG. 21 is a diagram illustrating an example of a table function definition sentence.
  • the table function definition statement illustrated in FIG. 21 for the table function “PartitionedTableFunc” (hereinafter referred to as “PTF” for the sake of brevity), one argument “InputTbl” in the table format (TABLE) is provided. Is defined (ie, it takes one input table as an argument).
  • the return value is a table composed of a variable-length character string “name” and an integer value “val”. Further, the underlined portion of FIG. 21 indicates that “partition equivalence of a partition unit (PER PARTITIONED ROW SET)” is associated with the argument “InputTbl”.
  • a table function definition statement as illustrated in FIG. 21 is sent from the client 2 to the DBMS 10 and processed by the definition processing unit 31, whereby the table function “PTF” is converted into a table function. It can be defined as information.
  • the table “BaseTbl1” illustrated in FIG. 18 to FIG. 20 processes rows having the same value in the “name” column in the same parallel processing unit when data is acquired in storage area units and parallel processing is performed. (E.g., "Gray" value data can be executed in the same parallel processing unit). That is, the input table “BaseTbl1” can be divided and stored in a specific row set unit (partition unit) corresponding to the storage area using the “name” column as a key.
  • the table function “PTF” illustrated in FIG. 21 has partition equivalence in a specific row set unit with respect to the input table, as indicated by the underlined portion. Therefore, in the third embodiment, when a query request including the table function “PTF” is performed, the table “BaseTbl” is used as an argument of the table function “PTF”, and the “name” column is designated as the partition. In this case, the division units of the input table “BaseTbl” and the table function “PTF” are matched, and the parallel processing divided into the partitions can be executed (for details, refer to FIG. 25 described later).
  • FIG. 22 is a diagram illustrating an example of a query statement.
  • the query shown in FIG. 22 is an example of a query statement in the third embodiment, and a table function “PTF” having the table “BaseTbl” as an input table is called in the SELECT instruction.
  • the analysis of the inquiry request by the inquiry analysis unit 32 is the same as that in the first embodiment, and the description thereof will be omitted.
  • FIG. 23 is a diagram for explaining the logical configuration of the query execution plan determination unit in the third embodiment.
  • the query execution plan creation unit 61 creates a query execution plan based on the input of the query request analysis result (syntactic analysis tree) from the query analysis unit 32.
  • the query execution plan creation unit 61 includes a query execution plan creation control unit 62 for overall control of query execution plan creation processing, an execution plan creation unit 63 for table functions including table arguments, and input division equivalence in units of rows.
  • the query execution plan creation unit 61 in the third embodiment is the first except that a process for selecting a parallel processing execution method in the case of having input partition equivalence in a specific row set unit (partition unit) is added. It is not substantially different from the query execution plan creation unit 33 in the embodiment. Specifically, the configuration added is a parallel processing execution method determination unit 65 of input division equivalence in a specific row set unit.
  • an execution plan for an update processing request is created as a program for performing a known process, as in the case of the query execution plan creation unit 33 in the mobile phone of the first embodiment.
  • FIG. 24 is a flowchart showing an example of a processing procedure performed by the execution plan creation unit of the table function.
  • the branch destination by the determination of the input division equivalence of the table function in step S302 is different.
  • a single method is selected (step S303).
  • the parallel processing execution method determination unit 64 is called (step S304).
  • step S304 the processing in FIG. 11 exemplified in the first embodiment can be used.
  • step S305 the parallel processing execution method determination unit 65 of the input division equivalence of specific row set unit is called (step S305).
  • FIG. 25 is a flowchart illustrating an example of a processing procedure performed by the parallel execution method determination unit for input division equivalence in units of specific rowsets. According to FIG. 25, first, it is determined that the input table processing can be executed in parallel (step S311). If it is determined in step S311 that parallel execution is possible, it is determined whether the division unit in the input table processing matches the input division equivalence of the table function (step S312).
  • step S311 or step S312 If a negative result is obtained in step S311 or step S312, a single parallel execution method is selected. Only when a positive result is obtained in step S312, the direct connection parallel execution method is selected.
  • the parallel execution method can be selected according to the type of input division equivalence, and by creating a query execution plan through such processing, In the query execution process, efficient parallel processing can be executed based on the partition unit of the input table and the partition equivalence of the table function.
  • the “direct connection method” can be selected as the execution method of the parallel processing for the query request.
  • the “pool” is the same as the second embodiment. It may be possible to select “method”. However, in such a case, as described in the second embodiment, it is necessary to prepare a shared pool for input table processing and table function processing when performing query execution processing.
  • the first or second embodiment of the present invention is added with a correspondence to input division equivalence in a specific row set unit (partition unit), the first or second embodiment A characteristic effect according to the second embodiment can be realized.
  • a user can define a table function corresponding to not only row-by-row input partition equivalence but also specific row set-by-row input partition equivalence. When done, it is possible to create a query execution plan by parallel processing while supporting various partitioning characteristics of table functions and input tables.
  • step S302 of FIG. 24 according to the type of input partition equivalence (“none”, “row unit”, “specific row set unit”) included in the table function included in the query request, Calls the input plan equivalence execution plan creation section. Then, for example, in FIG. 25, when the input partition equivalence is in a specific row set unit, it is confirmed whether the input table partition processing unit is suitable (step S312). Is selected. As described above, in the third embodiment, when the input partition equivalence of the table function is “row unit” or “specific row set unit”, it is determined whether the input table partition processing unit is suitable. In addition, parallel processing based on the input division equivalence can be planned.
  • the definition processing unit 31 performs parallel processing using the table function to define a table function that allows tabular data as an argument. It is an example of the definition process part registered in the aspect containing the attribute information regarding the feasibility of.
  • “executability of parallel processing by a table function” is, for example, input partitioning equivalence
  • attribute information regarding the feasibility of parallel processing by a table function corresponds to the partitioning equivalence information 102 and 107.
  • the DB management information 16 is an example of an information management unit that holds definition information for each table function registered by the definition processing unit and base table information related to base table data stored in a storage medium.
  • the query execution plan creation unit 33 includes the attribute information included in the definition information of the table function included in the query request and the base table data. It is an example of the query execution plan creation part which creates the execution plan of the said query request by parallel processing based on the said base table information corresponding to the input table passed with the argument of the said query request.
  • query execution unit 37 and the table function module 20 corresponds to the query execution unit 37 and the table function module 20 (more specifically, the execution control unit 38, the real table processing unit 39, the table function calling unit 40, the table function processing unit 42, etc.) This is an example of a query execution unit that performs parallel processing on a process related to the input table passed as an argument of the query request and a process related to the table function included in the query request based on the execution plan created by the query unit.
  • the query execution unit 37 (more specifically, the result merge unit 41) is an example of a result merge unit that merges and outputs the execution results of the processing by the query execution unit into a set format. Note that the output by the result merge unit corresponds to the result set 104.
  • the management system of the present invention for managing the database has been described with reference to the first to third embodiments.
  • the above-described configurations, functions, processing units, processing means, etc. are part or all of them. May be realized by hardware, for example, by designing with an integrated circuit.
  • Each of the above-described configurations, functions, and the like may be realized by software by interpreting and executing a program that realizes each function by the processor.
  • Information such as programs, tables, and files for realizing each function can be stored in a storage device such as a memory, a hard disk, and SSD (Solid State Drive), or a storage medium such as an IC card, an SD card, and a DVD.
  • control lines and information lines indicate what is considered necessary for the explanation, and not all the control lines and information lines on the product are necessarily shown. In practice, it may be considered that almost all components are connected to each other.
  • the present invention is preferably applied to a management system equipped with a database management system (DBMS).
  • DBMS database management system
  • data processing for data under DBMS management is efficiently realized by parallel processing. To do.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

【課題】 表関数の引数に表形式のデータを指定した場合に、表関数の実行を高速に処理することを可能にする。 【解決手段】 管理システム1は、引数に表形式のデータを許容する表関数の定義を当該表関数による並列処理の実行可能性に関する属性情報106を含む態様で登録する定義処理部31と、登録された表関数ごとの定義情報(表関数情報105)及び記憶媒体に格納された実表データに関する実表情報108を保持するDB管理情報16とを備える。そして管理システム1は、上記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の属性情報106と当該問合せ要求の引数で渡される入力表に対応する実表情報108とに基づいて、並列処理による当該問合せ要求の実行プランを作成し、作成された実行プランに基づいて入力表に関する処理と表関数に関する処理とをそれぞれ並列処理して、その結果を集合形式にマージして出力するようにした。

Description

管理システム、データ処理方法、及び記憶媒体
 本発明は、管理システム、データ処理方法、及び記憶媒体に関し、特に、データベースにおいて、SQLで取り扱われるデータに対する管理システム、当該データのデータ処理方法、並びに当該データ処理方法を実現するプログラムが記憶された記憶媒体に適用して好適なものである。
 従来、データベース管理システム(DBMS(DataBase Management System))においてデータの操作や定義を行うための問合せ言語としてSQL(Structured Query Language)が広く知られている。SQLで取り扱うデータは、複数の行で構成される表の形式で管理される。表を構成する各行は複数の列で構成されていて、各行の同じ列には同じデータ型のデータが格納される。行は表を操作するときの単位となる。
 SQLには様々な関数が用意されており、SQL文中で明示的に呼び出すことができる関数をSQL呼出関数(SQL-invoked function)と呼ぶ。また、SQLでは、ユーザによる関数定義手段も提供されている。SQL呼出関数では、関数ごとに指定可能な引数の形式が定められており、それぞれの引数には、データ型が決められている。データ型には「INTEGER」や「CHARACTER(10)」といった基本的なデータ型以外に、集合や配列を扱うためのデータ型もある。例えば、ISO/IEC9075:2003においては、「表関数」が規定されている。「表関数」は表形式のデータを返すSQL呼出関数である。
 例えば、特許文献1には、表関数を用いた横断検索に寄与する技術として、結合処理中に結合方法を適切な結合方法に切替えられるようにすることで、結合問合せの実行速度を高速化し得る結合実行方法が開示されている。
 また、特許文献2には、複数のSQL文を1回の起動要求で実行可能な内部形式にまとめて転送し、1回の起動要求で複数のSQL文を起動することによって、起動要求の回数を減らし、データベースサーバとクライアント間の通信回数を抑制する技術が開示されている。
国際公開第2014/188553号 特許第3808941号明細書
 ここで、DBMSにおいて、表関数の一例としてCSV形式のファイル(表データ)を読み込んで、結果を表形式にして返すという表関数を考えた場合、複数のセンサからの各検出結果がセンサごとや日付ごとに分けられた複数のCSV形式のファイルで記録されて集積されているようなケースでは、表関数で引数に指定するCSVファイル名は、単一のファイル名ではなく、ファイル名の集まりで渡せることが好ましい。
 そして、このような現状において、表関数の引数に表形式のデータを指定した場合に、表関数の実行を逐次処理ではなく並列処理によってどのように実行するかが課題としてあった。しかし、特許文献1または特許文献2からは、このように表データを引数とする表関数の実行において、上記の課題を解決し得る有効な技術は開示されていなかった。
 本発明は以上の点を考慮してなされたもので、表関数の引数に表形式のデータを指定した場合に、表関数の実行を高速に処理することを可能にするデータベースの管理システム、データ処理方法、及び記憶媒体を提案しようとするものである。
 かかる課題を解決するため本発明においては、引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理部と、前記定義処理部によって登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持する情報管理部と、前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成部と、前記問合せ実行プラン作成部で作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表と当該問合せ要求に含まれる前記表関数とをそれぞれ並列処理する問合せ実行部と、前記問合せ実行部による処理の実行結果を集合形式にマージして出力する結果マージ部と、を備えることを特徴とする管理システムが提供される。
 また、かかる課題を解決するため本発明においては、引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理ステップと、前記定義処理ステップで登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持させる情報管理ステップと、前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成ステップと、前記問合せ実行プラン作成ステップで作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表と当該問合せ要求に含まれる前記表関数とをそれぞれ並列処理する問合せ実行ステップと、前記問合せ実行ステップによる処理の実行結果を集合形式にマージして出力する結果マージステップと、を備えることを特徴とするデータ処理方法が提供される。
 また、かかる課題を解決するため本発明においては、引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理ステップと、前記定義処理ステップで登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持させる情報管理ステップと、前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成ステップと、前記問合せ実行プラン作成ステップで作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表と当該問合せ要求に含まれる前記表関数とをそれぞれ並列処理する問合せ実行ステップと、前記問合せ実行ステップによる処理の実行結果を集合形式にマージして出力する結果マージステップと、を備える処理を実行させるプログラムが格納された記憶媒体が提供される。
 本発明によれば、表関数の引数に表形式のデータを指定した問合せ要求が行われた場合に、表関数の実行を並列処理できるようにすることで高速な処理を実現することができる。
本発明の第1の実施形態に係る管理システムのハードウェア構成を示すブロック図である。 図1に示した管理システムにおける論理構成を示すブロック図である。 実表情報に関する定義を説明するための図である。 実表情報の具体例を示す図である。 表関数定義文の一例を示す図である。 表関数情報の具体例を示す図である。 問合せ文の一例を示す図である。 問合せ文の解析を説明するための図である。 問合せ実行プラン作成制御部による処理の手順例を示すフローチャートである。 表関数の実行プラン作成部による処理の手順例を示すフローチャートである。 入力分割等価性の並列実行方式決定部による処理の手順例を示すフローチャートである。 問合せ実行プランの一例を説明するための図である。 問合せ実行処理における実行シーケンスの処理の流れを示す図である。 第2の実施形態による管理システムにおいて、問合せ実行処理に関する論理構成を示すブロック図である。 直結方式とプール方式との並列処理単位の違いを説明するための図である。 第2の実施形態における入力分割等価性の並列実行方式決定部による処理の手順例を示すフローチャートである。 第2の実施形態の問合せ実行処理における実行シーケンスの処理の流れを示す図である。 実表の格納例を示す図である。 表定義文の一例を示す図である。 実表情報の具体例を示す図である。 表関数定義文の一例を示す図である。 問合せ文の一例を示す図である。 第3の実施形態における問合せ実行プラン決定部の論理構成を説明するための図である。 表関数の実行プラン作成部による処理の手順例を示すフローチャートである。 特定の行セット単位の入力分割等価性の並列実行方式決定部による処理の手順例を示すフローチャートである。
 以下、図面を参照しながら本発明による実施形態を説明する。なお、各図において、共通な機能を有する構成要素には同一の番号を付与し、その重複する説明を省略する。
(1)第1の実施形態
(1-1)本実施形態による管理システムの構成
 図1は、本発明の第1の実施形態に係る管理システムのハードウェア構成を示すブロック図である。
 図1において、1は全体として第1の実施形態に係る管理システムを示す。この管理システム1は、クライアント2,3がネットワーク4を介してDBMSサーバ5に接続されるとともに、DBMSサーバ5に二次記憶装置6が接続されて構成されている。
 クライアント2,3は、それぞれユーザが使用するコンピュータ装置であり、例えば、パーソナルコンピュータ、ワークステーション又はメインフレーム等から構成される。クライアント2とクライアント3は同一のコンピュータ装置であってもよいが、図1では、説明を簡潔にするために、その使用目的に応じて分けて示されている。クライアント2は、ユーザの操作に応じてネットワーク4を介してDBMSサーバ5に表関数を定義し、クライアント3は、ユーザの操作に応じてネットワーク4を介してDBMSサーバ5に問合せを行う。
 DBMSサーバ5は、DBMS10が実装されたサーバ装置であり、プロセッサ11、主記憶装置12、通信インタフェース(通信IF)13、入力装置14及び出力装置15を備えて構成される。
 プロセッサ11は、DBMSサーバ5全体の動作制御を司るプロセッサであり、例えば、CPU(Central Processing Unit)である。
 主記憶装置12は、例えば揮発性の半導体メモリから構成され、主として各種ソフトウェア(例えば、データベース管理システムを実現するためのDBMS10や、表関数の処理を実現するための表関数モジュール20)を記憶保持するために利用される。主記憶装置12に格納されたソフトウェアをプロセッサ11が実行することにより、DBMSサーバ5全体として後述のような各種処理が実行される。また、主記憶装置12には、DBMS10で利用される情報として、DB管理情報16や実表17が格納される。DB管理情報16や実表17は、二次記憶装置6に格納されたDB管理情報18や実表19から必要に応じてメモリ(主記憶装置12)に読み込まれる。
 通信IF13は、クライアント2,3や二次記憶装置6との通信時におけるプロトコル制御を行うインタフェースであり、例えばNIC(Network Interface Card)から構成される。
 入力装置14は、システム管理者等が各種操作を行うためのデバイスであり、例えばキーボードやマウス等から構成される。また出力装置15は、システム管理者に対して各種情報を提示するデバイスであり、例えば液晶モニタやスピーカ、プリンタ等から構成される。
 二次記憶装置6は、DBMSサーバ5が管理する各種データを保存するために利用される大容量のストレージ装置であり、例えばハードディスク装置やRAID(Redundant Arrays of Independent Disks)システム等から構成される。二次記憶装置6には、DBMS10が管理するデータベースのインデックス等によるDB管理情報18や、DBMS10が管理する表データによる実表19等が格納される。
(1-2)本実施形態による管理システムの論理構成
 本発明では、引数に表形式のデータを含む表関数を主に扱う。なお、引数に表形式のデータを含む表関数では、引数に指定するデータと、表関数の結果として得られるデータとが、ともに表形式のデータであるが、両者の表形式のデータを区別するために、後者を入力表と呼ぶ場合がある。
 図1に示した管理システム1(主にDBMS10)では、クライアント2から行われる表関数の定義要求に応じて、表関数を定義することができる。この定義可能な表関数には、表形式のデータを引数とする表関数が含まれ、当該表関数の「入力分割等価性」に関する属性情報を合わせて定義することができる。以降の説明では、このような表関数を「表を引数とする表関数」と表現し、引数とされる表を「入力表」と表現する。そして、管理システム1(主にDBMS10)は、クライアント3から行われる問合せ要求に応じて、その問合せ要求が表関数を含む場合には、当該表関数の入力分割等価性及び入力表の分割単位に基づいて、効率的な並列処理の実行プランを作成可能にすることを特徴としている。
 なお、本発明による各実施形態(第1の実施形態~第3の実施形態)では、逐次処理による実行方式の一例として「シングル方式」を採用し、並列処理による実行方式の一例として「直結方式」又は「プール方式」を採用する。
 具体的には、「シングル方式」とは、逐次処理の実行方式であって、表関数を含む問合せ要求の実行において、処理の全体を1つの並列処理単位で実行する逐次処理方式である。また、「直結方式」とは、並列処理の実行方式の一つであって、表関数を含む問合せ要求の実行において、入力表処理(詳細は後述する)を複数の並列処理単位で行うとともに、同一の並列処理単位で合わせて表関数処理(詳細は後述する)も行う並列処理方式である。また、「プール方式」とは、並列処理の実行方式の一つであって、表関数を含む問合せ要求の実行において、複数の並列処理単位で並列処理を行う点では直結方式と共通しているものの、直結方式では一連の並列処理が同じ並列処理単位で実行されるのに対して、プール方式では一連の並列処理においてプールを挟んで異なる並列処理単位で実行可能な点で相違する並列処理方式である。なお、直結方式とプール方式との相違については、後に図15を参照しながら詳述する。
 また、上述したこれらの方式名は、本説明のために付けた便宜的な名称であって、他の名称が付された同様の実行方式に置き換えることができる。
(1-2-1)入力分割等価性
 ここで、本実施形態の説明で用いられる「入力分割等価性(Input Separate Equivalence)」について説明する。表関数の入力分割等価性は、当該表関数による並列処理の実行可能性に関する属性情報の1つである。以下では、より具体的な例で表関数の入力分割等価性を説明する。
 ある表関数TFを考えた場合に、表関数TFにある入力表を引数として与えて得られる結果が結果Rであるとする。ここで、当該入力表をある分割方法PMによって重複なく、かつ漏れなく、いくつかのブロック(例えば、入力表に含まれる行の集まり)に分割し、表関数TFに各ブロックを引数として与えて結果を得る、という操作を全ブロックに対して実施したときに、得られた表関数結果をすべて集めたものが結果Rと等しい場合に、「表関数TFは、(分割方法PMについて)入力分割等価性がある」と表現される。
 さらに、特に入力表を最小単位にまで分割する分割方法(すなわち、1ブロックを1行にするという分割方法)についても表関数TFが入力分割等価性を有する場合には、「表関数TFは、行単位の入力分割等価性がある」と表現される。第1の実施形態では、表引数について行単位の入力分割等価性を有する表関数をユーザ定義関数として定義可能にし、かつ、当該表関数を含む問合せ要求において入力表が行単位で分割処理可能な場合に、当該入力分割等価性に基づいた並列処理による実行を可能にすることを特徴とする。
 一方、表関数TFが入力分割等価性を満たすためには、特定の行の集まり以上には分割できない(すなわち、特定の行の集まり(特定の行セット)をブロックの最小単位として分割することが必要とされる)場合も考えられる。このような分割の最小ブロック(特定の行の集まり)をパーティションと呼ぶとすれば、「表関数TFは、パーティション単位の入力分割等価性がある」と表現される。典型的なパーティションの例は、「PARTITION BY 列名」で表現可能な行の集まりであり、このとき、入力表において「PARTITION BY」で指定した列の値と同じ値を有するすべての行が、同一のパーティションに含まれる。後述する第3の実施形態では、表引数について特定の行セット単位の入力分割等価性(パーティション単位の入力分割等価性)を有する表関数をユーザ定義関数として定義可能にし、かつ、当該表関数を含む問合せ要求において入力表がパーティション単位で分割処理可能な場合に、当該入力分割等価性に基づいた並列処理による実行を可能にすることを特徴とする。
(1-2-2)DBMSの論理構成
 次に、DBMSサーバ5に実装されたDBMS10を中心とする管理システム1の論理構成について説明する。
 図2は、図1に示した管理システムにおける論理構成を示すブロック図である。図2に示すように、本実施形態のDBMS10は、図1に示したDB管理情報16及び実表17の他に、定義処理部31、問合せ解析部32、問合せ実行プラン作成部33、及び問合せ実行部37を備えて構成される。
 まず、表関数の定義に関する処理を行う論理構成について説明する。クライアント2からDBMSサーバ5に対して表関数の定義要求が行われる場合、当該表関数の定義内容を示す表関数定義文101がDBMS10の定義処理部31に入力される。なお、表関数定義文101には、表関数の入力分割等価性に関する情報が示された分割等価性情報102が含まれている。
 定義処理部31は、クライアント2から行われる表関数の定義要求に応じて、表関数を定義する処理を行うためのプログラムであって、表を引数とする表関数を定義することができる。なお、この他にも、定義処理部31は、スカラ値を引数とする表関数やその他の関数を定義可能としてもよいが、これらは公知の技術であるため、説明を省略する。
 定義処理部31は、クライアント2からの表関数の定義要求に応じた処理を行った後は、その処理結果をDB管理情報16に、詳細には表関数情報105として登録する。図2では、一例として表関数情報105に属性情報106が含まれ、さらに属性情報106に分割等価性情報107が含まれている。この分割等価性情報107は、例えば、クライアント2からの表関数定義文101に含まれる分割等価性情報102に基づいて登録される。
 なお、DB管理情報16に登録される表関数情報105は、必ずしもクライアント2からの表関数の定義要求の結果として登録された情報に限るものではなく、予め一般的または特有の関数に関する定義情報が登録されていてもよい。表関数情報105の詳細は、後述する図5,図6で示される。また、図2では、DB管理情報16に、実表17に関する情報を示す実表情報108が登録されていることも示されている。実表情報108の詳細は、後述する図3,図4で示される。
 次に、問合せに関する処理を行う論理構成について説明する。クライアント3からDBMSサーバ5に対して問合せ要求が行われる場合、問合せ要求の内容を示す問合せ文103がDBMS10の問合せ解析部32に入力される。
 問合せ解析部32は、クライアント3から行われる問合せ要求に応じて、当該問合せ要求を解析する処理を行うためのプログラムであって、解析結果を問合せ実行プラン作成部33に出力する。以下では、本実施形態における特徴を示すために、表関数を含む形式の問合せ要求が行われるとして説明する。
 問合せ実行プラン作成部33は、問合せ解析部32から出力された解析結果に基づいて、問合せ要求をどのように実行するかという実行プラン(問合せ実行プラン)を作成する処理を行うためのプログラムであって、例えば、問合せ実行プランの作成処理を全体的に制御する問合せ実行プラン作成制御部34と、問合せ要求に含まれる表関数(特に表(入力表)を引数とする表関数)についての実行プランを作成する表関数の実行プラン作成部35と、問合せ要求に含まれる表関数の入力分割等価性に基づいて問合せ実行プランの並列処理の実行方式を決定する入力分割等価性の並列実行方式決定部36と、を備えて構成される。
 問合せ実行プラン作成部33における問合せ実行プランの作成では、DB管理情報16に登録された各種情報が適宜参照または読み込まれる。そして、問合せ実行プラン作成部33で作成された問合せ実行プラン110は、問合せ実行部37に出力される。
 問合せ実行部37は、問合せ実行プラン作成部33から出力された問合せ実行プラン110に従って、問合せ要求を実行する処理を行うためのプログラムであって、実行制御部38、実表処理部39、表関数呼出部40、及び結果マージ部41を備えて構成される。なお、問合せ実行部37における問合せ要求の実行処理は、その途中に表関数モジュール20による処理が挟まれることによって完結する。なお、問合せ実行プラン110において並列処理が決定されている場合には、図2に例示したように各処理を並列処理で実行することができる。
 問合せ実行部37の各部を簡単に説明すると、実行制御部38は、問合せ実行プラン110に基づいて、問合せ実行部37における各処理を全体的に制御する。そして、実表処理部39は、実行制御部38の制御にしたがって、実表17から入力表を読み出して処理し、表関数呼出部40を呼び出す。表関数呼出部40は、表関数モジュール20の表関数処理部42に対して、問合せ要求に含まれる表関数を呼び出して処理させる。このとき、問合せ実行部37から表関数モジュール20に向けて、入力表111(分割された各入力表は入力表111a~111c)が渡される。そして、表関数処理部42において当該表関数による実行処理が行われ、その処理結果として表関数結果集合112が結果マージ部41に渡される。結果マージ部41は、表関数処理部42から受け取った表関数結果集合112(個別には112a~112c)を集めて1つの結果集合104に纏める処理を行い、問合せ要求の実行結果として結果集合104をクライアント3に出力する。
 このようにして、DBMSサーバ5では、クライアント3から「表を引数とする表関数を含む問合せ要求」が行われたとき、問合せ解析部32が問合せ文103を解析し、問合せ実行プラン作成部33が問合せ実行プランを作成し、問合せ実行部37及び表関数モジュール20が問合せ実行処理を行う。問合せ実行処理には、入力表に対する処理(入力表処理)と表関数に対する処理(表関数処理)とが含まれ、問合せ実行プランで直結方式の並列実行方式が選定されていた場合には、入力表処理及び表関数処理を直結方式の並列処理で実行することができる。そして最後に、問合せ要求の実行結果として結果集合104を返す(出力する)ことができる。
(1-3)表関数の定義処理の詳細
 第1の実施形態に係る管理システム1において、表を引数とする表関数を定義する処理について詳しく説明する。
(1-3-1)実表情報
 表関数の定義処理を説明する前に、まず、DB管理情報16に登録される実表情報108について説明する。実表情報108は、DBMS10の管理下にある表(実表17)を管理するために登録された情報であって、実表17に対応した定義(実表情報に関する定義)が行われることによって登録される。
 図3は、実表情報に関する定義を説明するための図である。図3(A)は表定義文の一例を示し、図3(B)はインデクス定義文の一例を示している。例えば、図3(A)の定義文によれば、表「TBL1」は、「CLM1」というVARCHAR(100)型の列と、「CLM2」というINT型の列とを持ち、「AREA03」及び「AREA07」に格納されることが示される(詳細は省略する)。
 図4は、実表情報の具体例を示す図である。図4では、図3(A)に示した表定義文に基づいて登録された実表情報108の一例が、定義情報121、列情報122、格納位置情報123として示されている。
 ここで、定義情報121は表の定義に関する情報であって、図4の場合、表名が「TBL1」で、その列数が「2」であることが示される。列情報122は表の各列に関する情報であって、図4の場合、表「TBL1」において、第1列は、列名が「CLM1」で型が「VARCHAR(10)」であり、第2列は、列名が「CLM2」で型が「INT」であることが示される。また、格納位置情報123は表の格納位置に関する情報であって、図4の場合、表「TBL1」が格納領域名「AREA03」及び「AREA07」に格納されていることが示される。
 なお、実表情報108に登録される情報は、上記した定義情報121、列情報122、及び格納位置情報123に限定されるものではなく、実表17に関する定義のバリエーションに応じて、様々な実表情報を登録することができる。例えば、図3(B)に例示したインデクス定義文に基づいて、表「TBL1」に付したインデクスに関する情報を「索引情報」として登録することができる。
(1-3-2)表関数定義(表関数情報)
 次に、表関数の定義処理について説明する。図2に例示したように、クライアント2から表関数の定義要求が行われる場合には、定義の対象となる表関数を定義するための表関数定義文101がDBMS10の定義処理部31に送信される。なお、本実施形態では、このような表関数定義文101に、対象となる表関数の入力分割等価性を示す情報(分割等価性情報102)が含まれるとする。
 そして、定義処理部31は、入力された表関数定義文101の定義に従って表関数を定義し、その定義情報を表関数情報105としてDB管理情報16に登録する。このような一連の処理が行われることによって、ユーザ(クライアント)の要望に応じて、表を引数とする表関数をDBMSサーバ5に定義することができる(表を引数とする表関数の表関数情報105が登録される)ことになり、その後の問合せ要求の実行において、当該定義された表関数を呼び出すことが可能となる。
 図5は、表関数定義文の一例を示す図である。図5に例示された表関数定義文によれば、「tfunc1」という表関数について、表形式(TABLE)の引数「Files」を1つ取ることが定義されている(すなわち、1つの入力表を引数とする)。また、戻り値は表であり、列の型は静的(定義時に決定)であることが示されている。さらに、引数「Files」に関して「行単位(PER ONE ROW)の分割等価性」を有することが示されており、図5内の下線部が分割等価性情報102に相当する。
 図6は、表関数情報の具体例を示す図である。図6に示す表関数情報105は、図5に示した表関数定義文に基づいて登録される表関数情報の一例である。詳細な説明は省略するが、定義情報131には、表関数「tfunc1」の定義情報として、表関数名、引数の数、実装言語、外部名、戻り値の列の型、及び戻り値の列数が示されている。また、引数情報132には、表関数「tfunc1」の引数に関する情報が示されている。戻り値列情報133には、表関数「tfunc1」の戻り値の列ごとの情報が示されている。入力表の列情報134には、表関数「tfunc1」が引数とする入力表における列の情報が示されている。
 さらに、属性情報135には、表関数「tfunc1」の属性情報として入力分割等価性が示されており、具体的には、図5で説明した分割等価性(分割等価性情報102)と同じく、引数とする入力表について行単位の入力分割等価性を有することが示されている。なお、属性情報135は、図2では属性情報106(より限定的には分割等価性情報107)に対応している。
 図3,図4で例示した表「TBL1」は、行単位で分割処理することが可能な表データである。このため、詳細は後述するが、第1の実施形態において、表「TBL1」が表関数「tfunc1」の引数とされる場合には、行単位の入力分割等価性に基づいた並列処理が実行可能となる。なお、実表(表関数の引数としての入力表)についての分割処理が可能な単位(分割処理単位)は、実表情報108に明記されて登録されてもよいし、実表情報108の登録情報から判定可能な程度の情報が登録されていてもよい。
 以上のように、DBMS10では、定義処理部31が表関数定義文101に基づいて表関数情報105をDB管理情報16に登録することによって、ユーザが要求する表関数を定義することができる(ユーザ定義関数の登録)。この表関数の定義は、表を引数とする表関数であっても可能であり、このとき、引数とする入力表に対する入力分割等価性(具体的には、表関数定義文101に含まれる分割等価性情報102)が合わせて定義される。
 具体例を挙げると、図5,図6で例示された表関数「tfunc1」は、「TABLE」型の「Files」を引数としており、図3,図4で実表情報を例示した表「TBL1」を引数とすることができる(すなわち、表関数「tfunc1」は、表「TBL1」を入力表とすることができる)。そして、表関数「tfunc1」は、「Files」引数に関して行単位の入力分割等価性を有することから、入力表「TBL1」について行単位の入力分割等価性を有する。
(1-4)問合せ要求の処理の詳細
 第1の実施形態に係る管理システム1において、表を引数とする表関数を含む問合せ要求が行われた場合の処理について詳しく説明する。なお、以下の説明では、クライアント3からDBMSサーバ5に対して表を引数とする表関数を含む問合せ要求が行われる前に、クライアント2からDBMSサーバ5に対して当該表関数の定義が行われて定義済であるものとする。具体的には例えば、図3~図6に示したような表関数「tfunc1」が定義された状態であるとする。
 図2等を参照して(1-2-2)で前述したように、本実施形態における問合せ要求は、クライアント3からDBMSサーバ5に対して問合せ文103が送信されることで開始される。そして、DBMSサーバ5において、問合せ文103を解析し(問合せ解析)、問合せの実行プランを作成し(問合せ実行プラン作成)、問合せ実行プランに沿った実行処理を行う(問合せの実行)ことによって、問合せ要求の結果として、結果集合104がクライアント3に返される。このような一連の処理について、段階ごとに詳しく説明する。
(1-4-1)問合せ解析
 問合せ要求の開始時、クライアント3からDBMSサーバ5に対して送信された問合せ文103は、DBMS10の問合せ解析部32に入力される。そして、問合せ解析部32は、以降の各部による処理を可能にするために、入力された問合せ文103を構文解析し、解析結果を問合せ実行プラン作成部33に入力する。
 図7は、問合せ文の一例を示す図である。図7に示されたクエリは、問合せ文103の一例であり、表を引数とする表関数「TFUNC1」を含む問合せになっている。なお、図7に示したように、問合せの種別は「SELECT」とする。なお、図7のクエリでは、大文字と小文字とを区別しない。
 図8は、問合せ文の解析を説明するための図である。図8には、問合せ解析部32による問合せ文103の解析結果の一例として、図7で例示したクエリを構文解析した結果が構文解析木で表されている。図8に示す構文解析例において、表関数「TFUNC1」は、図5,図6で例示した表関数「tfunc1」に相当し、実表「TBL1」は、図3,図4で例示した表「TBL1」に相当する。
(1-4-2)問合せ実行プラン作成
 次に、問合せ実行プラン作成部33は、問合せ解析部32から問合せ要求の解析結果(構文解析木)が入力されたことに基づいて、問合せ実行プランを作成する。前述したように、問合せ実行プラン作成部33における問合せ実行プランの作成処理では、問合せ実行プラン作成制御部34、表関数の実行プラン作成部35、及び入力分割等価性の並列実行方式決定部36の各部で処理が行われる。以下では、図8に示した解析結果を入力例として、これら各部の処理フローを説明する。
 図9は、問合せ実行プラン作成制御部による処理の手順例を示すフローチャートである。問合せ実行プラン作成制御部34は、問合せ実行プラン作成部33における問合せ実行プランの作成処理を全体的に制御する。
 具体的にはまず、問合せ実行プラン作成制御部34は、問合せの種別を判定する(ステップS101)。問合せの種別は、問合せ要求の命令種別によって判定することができ、例えば図9の処理フローでは、テーブル作成系の命令(具体的には「SELECT」)である場合にはステップS102の処理に進み、その他の更新系の命令(具体的には「INSERT」、「UPDATE」または「DELETE」)である場合にはステップS103の処理に進む。すなわち、本例では、特定種別の問合せ要求(「SELECT」)の場合のみ、表引数を含む表関数の問合せ実行プラン作成部33を呼び出すようにしている。
 ここで、「SELECT」は、データベースの1つ若しくは複数のテーブルからデータを取得(抽出)するためのSQL命令であって、取得に条件を指定することもできる。また、「INSERT」は、データの追加を行うためのSQL命令であり、「UPDATE」は、データの更新を行うためのSQL命令であり、「DELETE」はデータの削除を行うためのSQL命令である。本例では、上記した各命令について、簡便のために、「SELECT」を選択系の命令とし、それ以外をまとめて更新系の命令としている。
 ステップS103では、INSERT,DELETE,UPDATE等、それぞれの命令に応じて、問合せ要求を実行するための実行プラン(更新系処理要求の実行プラン)を作成する。このような実行プランの作成処理は公知技術であり、詳細な説明は省略する。なお、当該作成処理専用の処理部を備えるようにしてもよい。そして、ステップS103の処理が行われた後は、問合せ実行プラン作成部33は、それまでの処理に基づいて作成した問合せ実行プラン110を問合せ実行部37に出力し、処理を終了する。
 一方、ステップS102では、問合せ実行プラン作成制御部34は、「SELECT」要求の対象(from)が表関数であるか否かを判定する。ステップS102の判定結果が表関数である場合はステップS104の処理に進み、表関数ではない場合はステップS105の処理に進む。
 ステップS105では、表関数を含まない「SELECT」要求の実行プランを作成する。このような実行プランの作成処理は公知技術であり、詳細な説明は省略する。なお、当該作成処理専用の処理部を備えるようにしてもよく、このような場合に、DBMSサーバ5は、表関数以外の関数の処理にも対応可能となる。そして、ステップS105の処理が行われた後は、問合せ実行プラン作成部33は、それまでの処理に基づいて作成した問合せ実行プラン110を問合せ実行部37に出力し、処理を終了する。
 一方、ステップS104では、問合せ実行プラン作成制御部34は、表関数の引数に表が含まれるか否か(表引数があるか否か)を判定する。ステップS104で表引数があると判定された場合にはステップS106の処理に進み、表引数がないと判定された場合にはステップS107の処理に進む。
 ステップS107では、スカラ値のみを引数とする表関数の実行プランを決定する。このような実行プランの作成処理は公知技術であり、詳細な説明は省略する。なお、当該作成処理専用の処理部を備えるようにしてもよく、このような場合に、DBMSサーバ5は、スカラ値を引数とする表関数処理にも対応が可能となる。そして、ステップS107の処理が行われた後は、問合せ実行プラン作成部33は、それまでの処理に基づいて作成した問合せ実行プラン110を問合せ実行部37に出力し、処理を終了する。
 なお、上記したステップS103,S105,S107では、公知の処理が行われることを説明したが、問合せ実行プラン作成部33には、このような処理を行うためのプログラムが予め用意され、適宜これらのプログラムが呼び出されて実行されるものとする。
 一方、ステップS106では、問合せ実行プラン作成制御部34は、表引数を含む表関数の実行プランを作成するために、表関数の実行プラン作成部35を呼び出す。表関数の実行プラン作成部35による詳細な処理は、図10で後述する。ステップS106の処理が行われて表引数を含む表関数の実行プランが作成されると、それまでの処理に基づいて作成した問合せ実行プラン110を問合せ実行部37に出力し、処理を終了する。
 図10は、表関数の実行プラン作成部による処理の手順例を示すフローチャートである。表関数の実行プラン作成部35は、図10に示した手順で処理を行うことによって、表引数を含む表関数の実行プランを作成する。
 具体的には、まず、表関数に入力分割等価性があるか否かを判定する(ステップS111)。ステップS111の判定は、DB管理情報16に登録された表関数情報105のうち、属性情報106(より具体的には図6に示した属性情報135)を参照することで判定できる。
 そして、ステップS111で当該表関数に「行単位」の入力分割等価性があると判定した場合には、並列処理を実行するために必要な計算機(DBMSサーバ5)のリソースがあるか否かを確認する(ステップS112)。
 一方、ステップS111で表関数に入力分割等価性がないと判定した場合、または、ステップS112で並列処理に十分な計算機リソースがないと判定した場合には、問合せ実行方式としてシングル方式を選定する(ステップS114)。
 ステップS112で並列処理に十分な計算機リソースがあった場合には、表関数の実行プラン作成部35は、行単位の入力分割等価性に基づいた並列処理の実行方式を選定するために、入力分割等価性の並列実行方式決定部36を呼び出す(ステップS113)。入力分割等価性の並列実行方式決定部36による詳細な処理は、図11で後述するが、ステップS113の処理が行われることによって、条件を満たした場合に直結方式による並列実行方式が選定される。そして、ステップS115では、ステップS113またはステップS114で選定された並列実行方式による問合せ実行プランが作成される。
 図11は、入力分割等価性の並列実行方式決定部による処理の手順例を示すフローチャートである。入力分割等価性の並列実行方式決定部36は、問合せ要求に含まれる表関数が行単位の入力分割等価性を有しているとき、入力表の分割処理の処理単位と表関数の入力分割等価性とが適合する場合に、行単位に基づいた並行実行方式として直結方式を選定する。
 具体的には、入力分割等価性の並列実行方式決定部36は、実表情報108を参照して、表関数の入力表に対する処理(入力表処理)が並列実行可能であるか否かを判断する(ステップS121,S122)。より厳密には、入力表処理が行単位で分割処理(並列処理)することが可能か否かを判断する。このような判断を行う処理は公知技術であり、詳細な説明は省略する。
 そして、ステップS122において入力表処理が並列実行可能であると判断された場合は、並列実行方式として直結方式を選定する(ステップS123)。なお、ステップS123において並列実行方式を選定した場合に、並列実行が可能な上限数(並列実行数の上限数)を合わせて決定するようにしてもよい。決定された並列実行数の上限数は、問合せ実行プランに記載される。
 一方、ステップS122において入力表処理が並列実行できなないと判断された場合には、シングル方式を選定する(ステップS124)。これは、表関数に行単位の入力分割等価性があったとしても、当該表関数の引数とされた入力表に対して並列処理が実行できなければ、直結方式による並列処理を実行することはできないからである。
 こうして、ステップS123またはS124を経て、表関数に行単位の入力分割等価性がある場合に、シングル方式または直結方式の何れかの実行方式が選定され、表関数の実行プラン作成部35に通知される。
 以上、問合せ実行プラン作成部33は、表を引数とする表関数を含む問合せ要求の解析結果(例えば図8)が入力された場合に、図9~図11に示した処理を行うことによって、当該問合せ要求に含まれる表関数の入力分割等価性(例えば属性情報135)と表関数の入力表に対応する実表情報108とに基づいて、並列処理(直結方式)による当該問合せ要求の実行プラン(問合せ実行プラン)を作成することができる。
 図12は、問合せ実行プランの一例を説明するための図である。図12の問合せ実行プランを図8の構文解析木と比較すれば、問合せ文103(図7参照)に沿った処理が計画されるとともに、並列実行方式が選定されていることが分かる。具体的には、図12では、表関数「TFUNC1」の入力表処理が直結方式の並列実行方式で行われるように実行プランが立てられている。この後は、問合せ実行プラン110に基づいて、問合せ実行部37による問合せ実行が行われる。
(1-4-3)問合せ実行(問合せ実行プランの実行)
 図13は、問合せ実行処理における実行シーケンスの処理の流れを示す図である。図13を参照しながら、問合せ実行処理(問合せ実行プラン110の実行処理)について詳しく説明する。
 なお、本章では、表引数の表関数を含む問合せ要求に対して、問合せ実行プラン110で直結方式の並列実行方式が選定されたとして説明を行う。直結方式の場合、実表処理部39、表関数呼出部40、表関数処理部42、そして結果マージ部41の各部間で行われる並列処理の実行数(並列実行数)は変わらない。言い換えれば、同一の並列処理単位によって実表処理部39から結果マージ部41までの処理が行われる。なお、並列処理単位とは、具体的には例えば、スレッドやプロセス等に相当する。
 まず、問合せ実行プラン110が問合せ実行部37に入力されると、実行制御部38が、問合せ実行処理を開始する。このとき、実行制御部38から結果マージ部41に起動要求が送られる(ステップS151)。
 次いで、実行制御部38は、並列処理を実行させる数(並列実行数)の分だけループ処理を行いながら(ステップS152)、実表処理部39に対して起動要求を送る(ステップS153)。
 ここで、「並列実行数」とは、問合せ実行プラン110の作成時に決定された並列実行数の上限数であってもよいが、問合せ実行処理の実行時の状況に応じて、実行制御部38(または、実表処理部39や表関数呼出部40)が改めて並列実行数を決定するようにしてもよい。
 詳しく説明すると、一般に、DBMSサーバ5における資源(リソース)の利用状況に応じて、実行可能な並列実行数は変動する。したがって、問合せ実行プラン110に記載された並列実行数の上限数で並列処理を実行できるか不確定な場合も想定される。そこで例えば、実行制御部38が、プロセッサ11や主記憶装置12の状況に応じて、問合せ実行プラン110に記載された並列実行数の上限数を超えない範囲で、現実的により好適な並列実行数で並列処理を実行させるようにしてもよい。このようにすることで、過剰な負荷を掛けた並列処理が行われることを防止し、好適な並列処理を実行させることに期待できる。なお、問合せ実行部37が実際の並列実行数を決定する場合でも、問合せ実行プランで決定された並列実行数の上限数は超えないようにすることは、問合せ実行プランを逸脱した実行処理が行われることを防止する効果がある。
 次に、実行制御部38からの起動要求を受けた実表処理部39は、作業表113を生成する(ステップS154)。ここで、「作業表」とは、表形式のデータ(表のデータや、それらを射影または結合等によって加工したものを含む)を一時的に保持する機構である。作業表は、主に主記憶装置12内に構築されるが、取り扱うデータ量が巨大な場合には、二次記憶装置6にも跨って構築されてもよい。本実施形態の管理システム1では、作業表113が生成されることによって、行単位での表データの挿入や登録、データの取出やソート等の機能が提供される。
 実表処理部39は、実行制御部38からの起動要求を受けるごとに並列処理単位を1つ起動させる。そして、起動された並列処理単位ごとに、実表17から担当範囲のデータ(実表データ)を取得する処理を繰り返し(ステップS155)、1件の実表データを取得するごとに作業表に登録する(ステップS156)。図2に示したように、実表処理部39による実表17からの実表データの取得は並列処理で実行することができる。ここで、実表データの取得は、行単位以上で入力表が分割されて並列的に処理される。なお、実表データの取得における担当範囲の割当は、例えば実行制御部38によって制御される。
 以上、ステップS152~S156までの処理では、問合せ実行処理のうち、入力表に対する処理(入力表処理)が行われる。このような入力表処理が行われることによって、問合せ実行プランに沿って、問合せ要求に含まれる表関数の表引数(入力表)に対する処理が直結方式の並列処理で実行される。
 そして、ステップS157以降の処理では、問合せ実行処理のうち、表関数に対する処理(表関数処理)が主に行われる。この表関数処理が行われることによって、問合せ実行プランに沿って、問合せ要求に含まれる表関数に対する処理が直結方式の並列処理で実行される。
 具体的には、実表処理部39は、担当範囲の実表データの取得が完了すると、または実表データの取得の途中で、表関数呼出部40を呼び出す(ステップS157)。そして表関数呼出部40は、問合せ実行プラン110(問合せ要求)に含まれる表関数を呼び出して処理するよう、表関数モジュール20の表関数処理部42に表関数の呼出を通知する(ステップS158)。
 ステップS158の表関数呼出では、表関数の引数がセットされる。具体的には、表関数の引数がスカラ値であればその値がセットされ、表引数であれば作業表のハンドラがセットされる。また、戻り値の表のためのハンドラもセットされる。
 表関数呼出を受けた表関数処理部42では、並列処理単位ごとに表関数の実行処理が行われる(ステップS159)。直結方式であるから、表関数の時刻処理における並列処理単位は入力表処理と同様(例えば3つ)となる。
 ステップS159の処理では、問合せ実行プラン110に記載された表関数による実行処理を行うために、表引数のデータが必要になる。そこで、表関数処理部42は、必要に応じて(具体的には、表関数の実装内容に依存して)、入力表のデータを1件ずつ取得する要求を作業表113に向けて送る(ステップS160)。作業表113からは当該要求に応えて入力表のデータ1件が表関数処理部42に返される(ステップS161)。このようにしてデータ送信される入力表は、図2に示した分割された入力表111a~111cに相当する。
 なお、ステップS159の表関数の実行処理で取り扱われる入力表は、ステップS155等で入力表処理が行われたことによって、問合せ実行プラン110に記載された入力分割等価性に基づいて分割されている(入力表111a~111c)。表関数処理部42は、これらの分割された入力表111a~111cに対して直結方式の並列処理で表関数処理を実行する。
 そして、表関数処理部42における表関数の実行処理が所定の程度だけ進行すると、必要に応じて(具体的には、表関数の実装内容に依存して)、表関数の結果集合が1件ずつ結果マージ部41に登録される(ステップS162)。ステップS162で登録される結果集合は、図2に示した表関数結果集合112a~112cに相当する。
 ステップS160~S162を含むステップS159の処理は、起動した全ての並列処理単位において表関数の処理が完了して、全ての表関数結果集合112が結果マージ部41に送信されるまで行われる。
 表関数処理部42から表関数結果集合112が送られた結果マージ部41では、複数の表関数結果集合112を1つにまとめる(マージする)処理が行われる(ステップS163)。マージ処理は、表関数結果集合112が送られてくるごとに繰り返し行ってもよいし、表関数結果集合112の受信数が所定数に達するごとや、所定時間が経過するごとに行うようにしてもよい。
 そして例えば、一定件数分の表関数結果集合112が溜まった場合には(ステップS164)、当時点までに受け取った表関数結果集合112をまとめ、結果集合104としてクライアント3に出力(返却)する(ステップS165)。その後も、一定件数分の表関数結果集合112が溜まるたびに、クライアント3に結果集合104を出力する。
 ステップS164及びS165の処理は、表関数処理部42における表関数の実行処理の全ての結果(表関数結果集合)を受け取るまで継続する。具体的にはまず、表関数処理部42が、ステップS159で開始した表関数の実行処理を全て実行し、全ての表関数結果集合112を結果マージ部41に送信し終わると、結果集合登録完了通知を結果マージ部41に通知する(ステップS166)。結果マージ部41は、完了通知を受け取ると(ステップS167)、クライアント3に問合せ実行の完了を通知し(ステップS168)、結果マージ部41の処理を終了する。
 このようにして表関数処理部42における表関数の実行処理が全て完了すると、表関数呼出部40によるステップS158の表関数呼出が終了し(ステップS169)、それに伴って、実表処理部39によるステップS157の表関数呼出部コールが終了する(ステップS170)。
 ステップS170の段階に至ると、実表処理部39は問合せプランの実行が完了したことを認識でき、作業表113はこれ以上必要ではなくなる。このため、実表処理部39は作業表113を廃棄する指示を出し(ステップS171)、実行制御部38に全ての完了通知を送る(ステップS172)。
 このように、図13のステップS151~S172の処理が行われることによって、問合せ実行部37の各部と表関数処理部42は、問合せ実行プラン110に記載されたプラン内容に沿って入力表処理及び表関数処理を行い、問合せ要求を実行して実行結果(結果集合104)をクライアント3に返すことができる。さらに、この問合せ要求の実行では、分割等価性に基づいた並列処理を、入力表処理から表関数処理まで一貫した直結方式によって実行することができるため、問合せ要求に対する処理を効率的に高速で実現することができる。
(1-5)第1の実施形態による効果
 以上に説明してきた本発明の第1の実施形態に係る管理システム1によれば、以下のような特徴的な効果が実現される。
 まず、クライアント2から送信される表関数定義文101に基づいて、表形式のデータを引数とする表関数(表引数の表関数)をDBMSサーバ5に定義可能にすることで、ユーザ定義関数として表引数の表関数を定義することができる。さらにこのとき、表関数定義文101に分割等価性情報102が含まれる場合には、当該表関数による並列処理実行の可能性に関する属性情報として、入力分割等価性を合わせて定義することができる(分割等価性情報107)。
 さらに、上記のように入力分割等価性を有する表関数が登録されたDBMSサーバ5において、当該表関数を含む問合せ要求が行われた場合には、表関数の入力分割等価性と表引数の分割処理単位とを考慮して(より具体的には、当該表関数の表引数の分割処理単位と当該表関数の入力分割等価性とが適合するか否かに基づいて)、問合せ要求の実行処理における直結方式による並列実行の可否を計画することができる(分割等価性を考慮した問合せ実行プランの作成)。
 そして、上記のように分割等価性を考慮した問合せ実行プランが作成された場合には、当該問合せ実行プランに応じた実行処理が行われることによって、直結方式の並列実行方式で入力表処理及び表関数処理をそれぞれ並列処理することができるため、本実施形態のDBMSサーバ5は、高速な処理を実現することができる。
(2)第2の実施形態
 本発明の第2の実施形態に係る管理システムについて説明する。
 第1の実施形態では、問合せ要求の問合せ実行プランを作成するときに、並列実行可能な場合には「直結方式」による並列処理を選定したが、第2の実施形態では、並列実行可能な場合に「プール方式」による並列処理を選定できるようにする。そして、第2の実施形態では、DBMSが「プール方式」による並列処理に対応可能な構成を備えるようにすることで、問合せ実行プランの作成時に「プール方式」による並列処理が選定されたときには、「プール方式」の並列処理で問合せ実行処理を行うことができる。
(2-1)本実施形態による管理システムの構成
 図14は、第2の実施形態による管理システムにおいて、問合せ実行処理に関する論理構成を示すブロック図である。なお、第2の実施形態に係る管理システム1Aにおいて、第1の実施形態に係る管理システム1と共通する番号が付された構成は共通する構成を示すものとし、その詳細な説明を省略する。
 図14では、第2の実施形態による管理システム1AのDBMSサーバ5Aに構成されるDBMS50及び表関数モジュール52が示されている。但し、図14に示されたDBMS50の構成は、問合せ実行処理に関する一部の構成であり、その他の構成は、図2に示したDBMS10の構成と同様とする。具体的には例えば、DBMS50は定義処理部31やDB管理情報16等(ともに図14では不図示)を備えており、第1の実施形態と同様に、ユーザの要望に応じて表を引数とする表関数を当該表関数の入力分割等価性を含む態様でDBMSサーバ5Aに定義することができる。
 図14によれば、第2の実施形態における問合せ実行部51は、第1の実施形態における問合せ実行部37(図2参照)と同様の構成として、実行制御部53、実表処理部54、表関数呼出部55、及び結果マージ部57を備えている。そしてさらに、第2の実施形態の特徴的構成として、プール58が新たに備えられる。
 プール58は、第1の実施形態で説明した作業表113(図13参照)とほぼ同じ機能を提供する機構であって、表形式のデータ(表のデータや、それらを射影または結合等によって加工したものを含む)を一時的に保持する機構である。プール58と作業表113との相違点を説明すると、作業表113の場合は、1つの並列処理単位(具体的にはスレッドやプロセス)からしかアクセスを受けないため、排他制御が不要である。一方、プール58の場合は、複数の並列処理単位(具体的にはスレッドやプロセス)からアクセスを受けるため、排他制御の機能を有することが好ましい。
 なお、プール58は、図14の場合は問合せ実行部51内に構成されて示されるが、作業表113の場合と同様に、主記憶装置12内の他の場所に構築されてもよいし、さらには二次記憶装置6に跨って構築されてもよい。
 そして、第2の実施形態では、DBMSサーバ5Aがプール58を備えることによって、「プール方式」による並列処理を実行可能にする。ここで、「直結方式」による並列処理と「プール方式」による並列処理との違いを説明する。
 図15は、直結方式とプール方式との並列処理単位の違いを説明するための図である。前述したように、直結方式及びプール方式は、何れも複数の並列処理単位で並列処理を行う点では共通しているが、直結方式では一連の並列処理が同じ並列処理単位で実行されるのに対して、プール方式では一連の並列処理においてプールを挟んで異なる並列処理単位で実行可能な点で相違する。
 図15(A)は直結方式の並列処理のモデルを示している。図15(A)によれば、主に実表処理部39によって行われる入力表処理と、表関数呼出部40及び表関数処理部42によって行われる表関数処理とが、一貫して3つの並列処理単位による並列処理で実行されることが示されている。
 一方、図15(B)はプール方式の並列処理のモデルを示している。図15(B)によれば、主に実表処理部54によって行われる入力表処理は3つの並列処理単位によって行われ、その結果である入力表は一旦プール58に格納される。そして、入力表をプール58から読み出しながら表関数呼出部55及び表関数処理部56によって行われる表関数処理は、4つの並列処理単位によって行われている。すなわち、第2の実施形態におけるプール方式の並列処理では、プール58を挟んだ前後のそれぞれの並列処理(入力表処理と表関数処理)において、並列処理単位が一致している必要はない。
 このように、第2の実施形態で実行可能なプール方式は、入力表処理と表関数処理とのデータのやり取りを共有のプール58を介して行う並列実行方式である。したがって、入力表処理と表関数処理とを別の並列処理単位で実行させることができる。その結果、計算機(DBMSサーバ5A)のリソース状況等に応じて、入力表処理と表関数処理とをそれぞれ適切な並列処理単位で並列処理させることで、効率的な並列処理を実現することができる。
(2-2)問合せ要求の処理の詳細
 第2の実施形態に係る管理システム1Aにおいて、表を引数とする表関数を含む問合せ要求が行われた場合の処理について詳しく説明する。なお、以下の説明では、クライアント3からDBMSサーバ5に対して表を引数とする表関数を含む問合せ要求が行われる前に、クライアント2からDBMSサーバ5に対して当該表関数の定義が行われて定義済であるものとする。また、以下の説明では、前述の第1の実施形態において説明との相違点を中心に説明を行うとし、共通する処理は説明を適宜省略する。
 例えば、問合せ要求の開始時、クライアント3からDBMSサーバ5に対して送信された問合せ文に対して問合せ解析部32が構文解析を行い、その解析結果を問合せ実行プラン作成部33に送信する点は第1の実施形態と同様である。
(2-2-1)問合せ実行プラン作成
 第2の実施形態による問合せ実行プランの作成において、問合せ実行プラン作成制御部34及び表関数の実行プラン作成部35による処理は、第1の実施形態における処理と同様であり、具体的にはそれぞれ図9,図10に対応する。そして、第2の実施形態では、入力分割等価性の並列実行方式決定部36における処理が第1の実施形態とは異なっている。
 図16は、第2の実施形態における入力分割等価性の並列実行方式決定部による処理の手順例を示すフローチャートである。図16を図11と比較すると、その相違点はステップS203にあり、具体的には、入力分割等価性の並列実行方式決定部36は、入力表処理が並列実行可能と判断された場合に、並列実行方式としてプール方式を選定する(ステップS203)。なお、このとき、プール方式による並列実行方式を選定するとともに、並列実行が可能な上限数(並列実行数の上限数)を合わせて決定するようにしてもよい。決定された並列実行数の上限数は、問合せ実行プランに記載される。
 第2の実施形態において、問合せ実行プラン作成部33は、表を引数とする表関数を含む問合せ要求の解析結果(例えば図8)が入力された場合に、図9,図10,図16に示した処理を行うことによって、当該問合せ要求に含まれる表関数の入力分割等価性(例えば属性情報135)と表関数の入力表に対応する実表情報108とに基づいて、並列処理(プール方式)による当該問合せ要求の実行プラン(問合せ実行プラン)を作成することができる。
(2-2-2)問合せ実行(問合せ実行プランの実行)
 次に、第2の実施形態の管理システム1Aにおいて、DBMS50によって実行される問合せ実行処理について説明する。なお、以下の説明では、表引数の表関数を含む問合せ要求に対して、問合せ実行プラン110A(不図示)でプール方式の並列実行方式が選定されたとして説明を行う。
 図17は、第2の実施形態の問合せ実行処理における実行シーケンスの処理の流れを示す図である。図17を参照しながら、問合せ実行処理(問合せ実行プラン110Aの実行処理)について詳しく説明する。
 まず、問合せ実行プラン110Aが問合せ実行部51に入力されると、実行制御部53が、問合せ実行処理を開始する。このとき、実行制御部53から結果マージ部57に起動要求が送られる(ステップS251)。また、実行制御部53は、プール58を生成させる(ステップS252)。プール58の生成は、公知の技術を用いて適当なサイズの記憶領域を確保することで実現できる。
 さらに、実行制御部53は、表関数処理における並列実行数(例えば4つ)分のループ処理を行いながら(ステップS253)、表関数呼出部55に対して起動要求を送る(ステップS254)。
 なお、前述したように第2の実施形態では、プール方式の並列処理を行う場合に、入力表処理と表関数処理とで異なる並列処理単位を選ぶことができる。このような並列処理単位は、問合せ実行プラン110Aの作成時予め定められていてもよいし、または、問合せ実行プラン110Aではその上限数だけが定められて、実際に問合せ実行処理を開始するときに、リソース状況等を鑑みて実行制御部53が適当な並列処理単位を決定するようにしてもよい。本例では、図15(B)に例示したように、入力表処理の並列処理単位を3つとし、表関数処理の並列処理単位を4つとする。
 次いで、実行制御部53は、入力表処理における並列実行数(例えば3つ)分のループ処理を行いながら(ステップS256)、実表処理部54に対して起動要求を送る(ステップS257)。
 ステップS257の起動要求を受けた実表処理部54は、実行制御部53からの起動要求を受けるごとに並列処理単位を1つ起動させる。そして、起動された並列処理単位ごとに、実表17から担当範囲のデータ(実表データ)を取得する処理を繰り返し(ステップS258)、1件の実表データを取得するごとにプール58に登録する(ステップS259)。実表データの取得における担当範囲の割当は、例えば実行制御部53によって制御される。
 実表処理部54は、実行制御部53からの起動要求に基づいて、実表17から実表データを取得してプール58に登録し終わると、完了通知を実行制御部53に通知する(ステップS260)。そして、実行制御部53は、入力表処理における並列実行数(例えば3つ)の分だけ完了通知を受けると、実表処理部54に対する指示を終了し(ステップS261)、入力表処理による全てのデータ登録が完了した旨をプール58に通知する(ステップS263)。
 プール58は、実行制御部53によって生成された後、実表処理部54から1件ずつ登録される実表データを一時的に保持する(ステップS262)。このような1件ごとの実表データは、分割された入力表に相当する。そして、保持したデータに対する取得要求が有った場合には(ステップS265)、当該取得要求に応えてデータを提供する(ステップS266)。
 ところで、ステップS254で起動要求を受けた表関数呼出部55は、実行制御部53からの起動要求を受けるごとに並列処理単位を1つ起動させる。そして、起動された並列処理単位ごとに、問合せ実行プラン110A(問合せ要求)に含まれる表関数を呼び出して処理するよう、表関数モジュール52の表関数処理部56に表関数の呼出を通知する(ステップS255)。
 ステップS255の表関数呼出では、表関数の引数がセットされる。具体的には、表関数の引数がスカラ値であればその値がセットされ、表引数であればプールのハンドラがセットされる。また、戻り値の表のためのハンドラもセットされる。
 表関数呼出を受けた表関数処理部56では、起動された並列処理単位ごとに表関数の実行処理が行われる(ステップS264)。ステップS264の処理では、問合せ実行プラン110Aに記載された表関数による実行処理を行うために、表引数のデータが必要になる。そこで、表関数処理部56は、必要に応じて(具体的には、表関数の実装内容に依存して)、入力表のデータを1件ずつ取得する要求をプール58に向けて送る(ステップS265)。プール58からは当該要求に応えて入力表のデータ1件が表関数処理部42に返される(ステップS266)。
 なお、表関数処理部56からプール58に対する入力表のデータ取得要求が繰り返されると、最終的にはプール58に保持された入力表のデータが全て取得される(EOD:End Of Data)。このような場合には、プール58から表関数処理部56にEOD検知が通知される。
 なお、ステップS264の表関数の実行処理で取り扱われる入力表は、ステップS258等で入力表処理が行われたことによって、問合せ実行プラン110Aに記載された入力分割等価性に基づいて分割されている。表関数処理部56は、これらの分割された入力表に対してプール方式の並列処理で表関数処理を実行する。
 そして、表関数処理部56における表関数の実行処理が所定の程度だけ進行すると、必要に応じて(具体的には、表関数の実装内容に依存して)、表関数の結果集合が1件ずつ結果マージ部57に登録される(ステップS267)。ステップS267で登録される結果集合は、図14に示した表関数結果集合に相当する。
 ステップS265~S266を含むステップS264の処理は、起動した全ての並列処理単位において表関数の処理が完了して、全ての表関数結果集合が結果マージ部57に送信されるまで行われる。
 表関数処理部56から表関数結果集合が送られる結果マージ部57では、複数の表関数結果集合を1つにまとめる(マージする)処理が行われる(ステップS268)。マージ処理は、表関数結果集合が送られてくるごとに繰り返し行ってもよいし、表関数結果集合の受信数が所定数に達するごとや、所定時間が経過するごとに行うようにしてもよい。
 そして例えば、一定件数分の表関数結果集合が溜まった場合には、当時点までに受け取った表関数結果集合をまとめ、結果集合104としてクライアント3に出力(返却)する(ステップS269)。その後も、一定件数分の表関数結果集合が溜まるたびに、クライアント3に結果集合104を出力する。
 ステップS269の処理は、表関数処理部56における表関数の実行処理の全ての結果(表関数結果集合)を受け取るまで継続する。具体的にはまず、表関数処理部56が、ステップS264で開始した表関数の実行処理を全て実行し、全ての表関数結果集合を結果マージ部57に送信し終わると、結果集合登録完了通知を結果マージ部57に通知する(ステップS270)。結果マージ部57は、当該通知を受け取ると、クライアント3に問合せ実行の完了を通知し(ステップS271)、結果マージ部57の処理を終了する。
 このようにして表関数処理部56における表関数の実行処理が全て完了すると、表関数呼出部55によるステップS255の表関数呼出が終了し(ステップS272)、表関数呼出部55は実行制御部53に向けて完了通知を送る(ステップS273)。そして、完了通知を受けた実行制御部53は、問合せ実行処理を完了させる(ステップS274)。
 このように、図17のステップS251~S274の処理が行われることによって、問合せ実行部51の各部と表関数処理部56は、問合せ実行プラン110Aに記載されたプラン内容に沿って入力表処理及び表関数処理を行い、問合せ要求を実行して実行結果(結果集合104)をクライアント3に返すことができる。さらに、この問合せ要求の実行では、入力分割等価性に基づいた並列処理を、入力表処理と表関数処理とで共有するプール58を利用したプール方式で実行することができるため、表引数の表関数を含む問合せ要求に対して、第1の実施形態よりもさらに効率的な並列処理を実現することができる。
(2-3)第2の実施形態による効果
 以上に説明してきた本発明の第2の実施形態に係る管理システム1Aによれば、以下のような特徴的な効果が実現される。
 第1の実施形態に係る管理システム1Aと同様に、ユーザ定義関数として表引数の表関数を定義することができ、当該表関数の入力分割等価性を合わせて定義することができる。また、このような表関数を含む問合せ要求がなされた場合に、表関数の入力分割等価性と表引数の分割処理単位とを考慮して(より具体的には、入力表の分割処理単位と表関数の入力分割等価性とが適合するか否かに基づいて)、分割等価性を考慮した問合せ実行プランを作成することができる。
 ここで、第2の実施形態に係る管理システム1Aでは、並列処理の実行方式としてプール方式を選定できるようにすることで、直結方式よりも柔軟な並列処理を可能にすることができる。詳しく説明すると、プール方式の並列処理では、問合せ実行処理において、入力表処理の並列処理単位と表関数処理の並列処理単位とを別にすることができるため、入力表の分割処理性能や計算機のリソース状況等に応じて、柔軟に並列処理単位を設定することができる。したがって、第1の実施形態で説明した直結方式によりも高速な問合せ実行処理の実現に期待できる。
 また、第2の実施形態における問合せ実行処理では、プール方式の並列処理によって、問合せ実行処理における各部の処理を並行して実行させることができるため、問合せ実行処理全体の処理時間が直結方式の場合よりも短縮されることに期待できる。具体的には、図17の実行シーケンスで示したように、処理の初期段階で実行制御部53が、実表処理部54だけでなく、表関数呼出部55も起動させているため、実表処理部54が入力表処理を並列処理する傍らで、表関数呼出部55及び表関数処理部56が表関数処理を並列処理することができる。このような並行処理が行われることによって、入力表処理と表関数処理との間の待ち時間を短縮することができ、全体的な処理を高速化することができる。
 また、第2の実施形態における問合せ実行処理では、プール方式の並列処理を行うことによって、並列処理単位ごとの処理の平準化という効果を実現することができる。具体的には、直結方式では、並列処理単位ごとに処理対象とする行が確定してしまうため、各並列処理単位の処理量に差があっても処理の割振方を変えることができないが、プール方式では、各並列処理単位の処理量に差があったとしても、処理が軽く早期に処理が終わったスレッドが引き続きプールに残っている行の処理を行うことができるため、処理の平準化が実現される。
(3)第3の実施形態
 本発明の第3の実施形態に係る管理システムについて、第1の実施形態に係る管理システム1との相違点を中心に説明する。
 第1の実施形態では、表引数について行単位の入力分割等価性を有する表関数をユーザ定義関数として定義可能にし、かつ、当該表関数を含む問合せ要求に対して、当該入力分割等価性に基づいた並列処理による実行を可能にすることを特徴としていた。これに対して、第3の実施形態では、表引数について特定の行セット単位の入力分割等価性(パーティション単位の入力分割等価性)を有する表関数も、ユーザ定義関数として定義可能にし、かつ、当該表関数を含む問合せ要求に対して当該入力分割等価性に基づいた並列処理による実行を可能にすることを特徴とする。
(3-1)表関数の定義処理の詳細
 特定の行セット単位(パーティション単位)を分割単位として有する実表、及び特定の行セット単位(パーティション単位)の入力分割等価性を有する表関数について説明する。
(3-1-1)実表情報
 図18は、実表の格納例を示す図である。図18に示すように、実表「BaseTbl」は、AREA03、AREA07、AREA12という異なる領域に跨って格納されたデータであり、「境界値分割格納された表」と呼ぶことができる。また、実表「BaseTbl」の格納境界値(格納領域間の閾値)は、境界値「I」及び境界値「R」である。このような実表「BaseTbl」は、境界値「I」,「R」で区切られた特定の行セット(パーティション)によって分割処理することができる。
 図19は、表定義文の一例を示す図である。図19に示した定義文は、境界値分割格納された表の一例として図18に示した実表「BaseTbl」を定義する表定義文である。図19の表定義文によれば、格納対象行の列「name」の値(文字列)によって格納領域が振分けられることが定義されている。そして、その格納領域は、辞書順で「I」以前であれば「AREA03」に、辞書順で「I」よりも後で「R」以前であれば「AREA07」に、辞書順で「R」よりも後であれば「AREA12」にされることが定義されている。
 第3の実施形態の管理システムでは、図18に示した実表がDBMS10の管理下にある場合に、図19に示した表定義文による定義が行われることで、当該実表に対応する実表情報308がDB管理情報16に登録される。
 図20は、実表情報の具体例を示す図である。図20では、図19に示した表定義文に基づいて登録された実表情報308の一例が、定義情報321、列情報322、格納位置情報323として示されている。詳細な定義内容については説明を省略する。
(3-1-2)表関数定義(表関数情報)
 図21は、表関数定義文の一例を示す図である。図21に例示された表関数定義文によれば、「PartitionedTableFunc」という表関数(以後は、簡略のために「PTF」と記載する)について、表形式(TABLE)の引数「InputTbl」を1つ取ることが定義されている(すなわち、1つの入力表を引数とする)。また、戻り値は、可変長文字列「name」及び整数値「val」から構成される表である。さらに、図21の下線部には、引数「InputTbl」に関して「パーティション単位(PER PARTITIONED ROW SET)の分割等価性」を有することが示されている。
 第3の実施形態の管理システムでは、図21に例示したような表関数定義文がクライアント2からDBMS10に送られて定義処理部31で処理が行われることによって、表関数「PTF」を表関数情報として定義することができる。
 なお、図18~図20で例示した表「BaseTbl1」は、格納領域単位でデータを取得して並列処理を行った場合に、「name」列の値が同じ行を同じ並列処理単位で処理することができる(例えば、「Gray」値のデータを同じ並列処理単位で実行できる)。すなわち、入力表「BaseTbl1」は、「name」列をキーとして、格納領域に相当する特定の行セット単位(パーティション単位)で分割格納することが可能である。
 また、図21で例示した表関数「PTF」は、下線部に示したように、入力表に関して特定の行セット単位の分割等価性を有している。したがって、第3の実施形態において、表関数「PTF」を含む問合せ要求が行われるとき、表「BaseTbl」が表関数「PTF」の引数とされ、かつ、「name」列がパーティションに指定された場合には、入力表「BaseTbl」と表関数「PTF」との分割単位が適合し、当該パーティションに分割した並列処理が実行可能となる(詳細は、後述する図25参照)。
(3-2)問合せ要求の処理の詳細
 問合せ要求の処理のうち、第3の実施形態における特徴的な処理を説明する。
 図22は、問合せ文の一例を示す図である。図22に示されたクエリは、第3の実施形態における問合せ文の一例であり、SELECT命令のなかで、表「BaseTbl」を入力表とした表関数「PTF」が呼び出される。
 図22に示した問合せ文がDBMS10に入力されたとして、問合せ解析部32による問合せ要求の解析は第1の実施形態と同様のため説明を省略する。
(3-2-1)問合せ実行プラン作成
 図23は、第3の実施形態における問合せ実行プラン決定部の論理構成を説明するための図である。問合せ実行プラン作成部61は、問合せ解析部32から問合せ要求の解析結果(構文解析木)が入力されたことに基づいて、問合せ実行プランを作成する。
 問合せ実行プラン作成部61は、問合せ実行プランの作成処理を全体的に制御する問合せ実行プラン作成制御部62と、表引数を含む表関数の実行プラン作成部63と、行単位の入力分割等価性の並列処理実行方式決定部64と、特定の行セット単位(パーティション単位)の入力分割等価性の並列処理実行方式決定部65とを備えて構成される。
 第3の実施形態における問合せ実行プラン作成部61は、特定の行セット単位(パーティション単位)の入力分割等価性を有する場合の並列処理実行方式を選定する処理が追加される以外は、第1の実施形態における問合せ実行プラン作成部33と実質的には変わらない。具体的に追加された構成は、特定の行セット単位の入力分割等価性の並列処理実行方式決定部65である。
 したがって、図23には不図示であるが、第1の実施の携帯における問合せ実行プラン作成部33のときと同様に、公知の処理を行うためのプログラムとして、更新系処理要求の実行プランを作成するための処理部であったり、表関数を含まないSELECT要求の実行プランを作成する処理部であったり、スカラ引数の表関数の実行プランを作成する処理部であったりを備えることができる。
 図24は、表関数の実行プラン作成部による処理の手順例を示すフローチャートである。図24を図10と比較すると、ステップS302における表関数の入力分割等価性の判定による分岐先が異なる。ステップS302で入力分割等価性がないと判定された場合には、シングル方式が選定され(ステップS303)、「行単位」の入力分割等価性を有する場合には、行単位の入力分割等価性の並列処理実行方式決定部64が呼び出される(ステップS304)。ステップS304の詳細な処理は、第1の実施形態で例示した図11の処理を流用することができる。
 また、ステップS302で「特定の行セット単位」の入力分割等価性を有する場合には、特定の行セット単位の入力分割等価性の並列処理実行方式決定部65が呼び出される(ステップS305)。
 図25は、特定の行セット単位の入力分割等価性の並列実行方式決定部による処理の手順例を示すフローチャートである。図25によれば、まず、入力表処理が並列実行可能である判定される(ステップS311)。ステップS311の判定で並列実行可能であると判定された場合には、入力表の処理における分割単位と、表関数の入力分割等価性とが適合するか否かが判定される(ステップS312)。
 ステップS311またはステップS312において否定結果が得られた場合には、シングル方式の並列実行方式が選定される。そして、ステップS312において肯定結果が得られた場合にのみ、直結方式の並列実行方式が選定される。
 このように、第3の実施形態では、入力分割等価性の種別によってそれぞれ並列実行方式を選定することができるようにしており、このような処理を経て問合せ実行プランを作成することによって、その後の問合せ実行処理において、入力表の分割単位と表関数の分割等価性とに基づいて効率的な並列処理を実行可能にする。
 なお、上記の説明では、問合せ要求に対する並列処理の実行方式として「直結方式」を選定できるようにしたが、第3の実施形態に係る管理システムにおいては、第2の実施形態と同様に「プール方式」を選定できるようにしてもよい。ただしこのような場合には、第2の実施形態で説明したように、問合せ実行処理を行うときに、入力表処理と表関数処理とで共用のプールを用意することが必要となる。
(3-3)第3の実施形態による効果
 以上に説明してきた本発明の第3の実施形態に係る管理システムによれば、以下のような特徴的な効果が実現される。
 第3の実施形態は、本発明の第1または第2の実施形態に対して、特定の行セット単位(パーティション単位)の入力分割等価性への対応を追加したものであるため、第1または第2の実施形態による特徴的な効果を実現することができる。
 そのうえで、第3の実施形態によれば、行単位の入力分割等価性だけでなく特定の行セット単位の入力分割等価性にも対応して表関数のユーザ定義が可能であるため、問合せ要求が行われたときに、表関数や入力表の多様な分割特性に対応しながら、並列処理による問合せ実行プランを作成することができる。
 具体的には例えば、図24のステップS302において、問合せ要求に含まれる表関数が有する入力分割等価性の種類(「なし」、「行単位」、「特定の行セット単位」)に応じて、それぞれの入力分割等価性の実行プラン作成部を呼び出す。そして、例えば図25では、特定の行セット単位の入力分割等価性を有する場合に、入力表の分割処理単位が適合するかを確認し(ステップS312)、適合した場合に直結方式の並列実行方式を選定している。このように、第3の実施形態では、表関数の入力分割等価性が「行単位」または「特定の行セット単位」であるときに、入力表の分割処理単位が適合しているかを判定したうえで、当該入力分割等価性に基づいた並列処理を計画することができる。
 なお、本発明に係る管理システム(例えば、第1の実施形態の管理システム1)において、定義処理部31は、引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理部の一例である。ここで、「表関数による並列処理の実行可能性」とは例えば入力分割等価性であり、「表関数による並列処理の実行可能性に関する属性情報」は分割等価性情報102,107に相当する。また、DB管理情報16は、前記定義処理部によって登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持する情報管理部の一例である。ここで、「表関数ごとの定義情報」は表関数情報105に相当し、「記憶媒体に格納された実表データ」は二次記憶装置6に格納された実表19に相当し、「実表データに関する実表情報」は実表情報108に相当する。また、問合せ実行プラン作成部33は、前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成部の一例である。ここで、「表関数を含む問合せ要求」は問合せ文103に相当し、「問合せ要求の実行プラン」は問合せ実行プラン110に相当する。また、問合せ実行部37及び表関数モジュール20(より具体的には、実行制御部38、実表処理部39、表関数呼出部40、及び表関数処理部42等)は、前記問合せ実行プラン作成部で作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表に関する処理と当該問合せ要求に含まれる前記表関数に関する処理とをそれぞれ並列処理する問合せ実行部の一例である。また、問合せ実行部37(より具体的には結果マージ部41)は、前記問合せ実行部による処理の実行結果を集合形式にマージして出力する結果マージ部の一例である。なお、結果マージ部による出力物は、結果集合104に相当する。
 以上、データベースを管理する本発明の管理システムについて、第1~第3の実施形態を挙げて説明してきたが、上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記憶装置、または、ICカード、SDカード、DVD等の記憶媒体に置くことができる。
 また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実施には殆ど全ての構成が相互に接続されていると考えてもよい。
 本発明は、データベース管理システム(DBMS)が搭載された管理システムに適用されて好適なものであって、このような場合に、DBMS管理下にあるデータに対するデータ処理を並列処理で効率的に実現する。
 1,1A   管理システム
 2,3 クライアント
 4   ネットワーク
 5,5A   DBMSサーバ
 6   二次記憶装置
 10,50  DBMS
 11  プロセッサ
 12  主記憶装置
 13  通信IF
 14  入力装置
 15  出力装置
 16,18 DB管理情報
 17,19 実表
 20,52  表関数モジュール
 31  定義処理部
 32  問合せ解析部
 33,61  問合せ実行プラン作成部
 34,62  問合せ実行プラン作成制御部
 35,63  表関数の実行プラン作成部
 36,64  入力分割等価性の並列実行方式決定部(行単位)
 37,51  問合せ実行部
 38,53  実行制御部
 39,54  実表処理部
 40,55  表関数呼出部
 41,57  結果マージ部
 42,56  表関数処理部
 58  プール
 65  入力分割等価性の並列実行方式決定部(特定の行セット単位)
 101 表関数定義文
 102 分割等価性情報
 103 問合せ文
 104 結果集合
 105 表関数情報
 106 属性情報
 107 分割等価性情報
 108,308 実表情報
 110,110A 問合せ実行プラン
 111 入力表
 112 表関数結果集合
 113 作業表
 121,131,321 定義情報
 122,322 列情報
 123,323 格納位置情報
 132 引数情報
 133 戻り値列情報
 134 入力表の列情報
 135 属性情報
 

Claims (15)

  1.  引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理部と、
     前記定義処理部によって登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持する情報管理部と、
     前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成部と、
     前記問合せ実行プラン作成部で作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表に関する処理と当該問合せ要求に含まれる前記表関数に関する処理とをそれぞれ並列処理する問合せ実行部と、
     前記問合せ実行部による処理の実行結果を集合形式にマージして出力する結果マージ部と、
     を備えることを特徴とする管理システム。
  2.  前記情報管理部に保持される前記表関数ごとの前記定義情報には、前記属性情報として当該表関数が並列処理を実行可能な分割単位が示され、前記入力表に対応する前記実表情報には、当該入力表を並列処理することができる分割単位が示され、
     前記問合せ実行プラン作成部は、前記表関数を含む問合せ要求が入力されたとき、当該表関数に対応する前記定義情報の前記属性情報に示された分割単位と、当該問合せ要求の引数で渡される入力表に対応する前記実表情報に示された分割単位とが適合する場合に、当該分割単位に基づいた並列処理による当該問合せ要求の実行プランを作成する
     ことを特徴とする請求項1に記載の管理システム。
  3.  前記問合せ実行プラン作成部は、前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求の実行プランとして並列処理を採用するか否かを判定し、前記並列処理を採用すると判定した場合には所定の並列処理方式による実行プランを作成し、前記並列処理を採用しないと判定した場合には逐次処理方式による実行プランを作成する
     ことを特徴とする請求項1に記載の管理システム。
  4.  前記問合せ実行プラン作成部は、並列処理による問合せ要求の実行プランとして、前記入力表に関する処理と前記表関数に関する処理とを複数の同一の並列処理単位で実行する並列処理方式による実行プランを作成する
     ことを特徴とする請求項1に記載の管理システム。
  5.  前記問合せ実行部における前記問合せ要求の実行処理において表形式のデータを一時的に保持するためのプールをさらに備え、
     前記問合せ実行プラン作成部は、並列処理による問合せ要求の実行プランとして、前記入力表に関する処理と前記表関数に関する処理との間で前記プールによる処理結果の受け渡しを挟むようにし、前記入力表に関する処理と前記表関数に関する処理とをそれぞれ別個の複数の並列処理単位で行う並列処理方式による実行プランを作成する
     ことを特徴とする請求項1に記載の管理システム。
  6.  前記属性情報に示される分割単位及び前記実表情報に示される分割単位には、行単位で指定された分割単位が含まれる
     ことを特徴とする請求項2に記載の管理システム。
  7.  前記属性情報に示される分割単位及び前記実表情報に示される分割単位には、特定の行セットが単位として指定された分割単位が含まれる
     ことを特徴とする請求項2に記載の管理システム。
  8.  前記問合せ実行部は、前記問合せ実行プラン作成部で作成された実行プランと前記管理システムにおける計算資源の現状とに基づいて、当該実行プランに基づいた並列処理の実行時に用いる並列処理単位の実行数を決定する
     ことを特徴とする請求項1に記載の管理システム。
  9.  前記問合せ実行プラン作成部は、前記並列処理による問合せ要求の実行プランを作成するときに、前記問合せ実行部で当該実行プランに基づいた処理が実行されるときに利用可能な並列処理単位の上限数を決定する
     ことを特徴とする請求項1に記載の管理システム。
  10.  引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理ステップと、
     前記定義処理ステップで登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持させる情報管理ステップと、
     前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成ステップと、
     前記問合せ実行プラン作成ステップで作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表に関する処理と当該問合せ要求に含まれる前記表関数に関する処理とをそれぞれ並列処理する問合せ実行ステップと、
     前記問合せ実行ステップによる処理の実行結果を集合形式にマージして出力する結果マージステップと、
     を備えることを特徴とするデータ処理方法。
  11.  前記情報管理ステップで保持される前記表関数ごとの前記定義情報には、前記属性情報として当該表関数が並列処理を実行可能な分割単位が示され、前記入力表に対応する前記実表情報には、当該入力表を並列処理することができる分割単位が示され、
     前記問合せ実行プラン作成ステップでは、前記表関数を含む問合せ要求が入力されたとき、当該表関数に対応する前記定義情報の前記属性情報に示された分割単位と、当該問合せ要求の引数で渡される入力表に対応する前記実表情報に示された分割単位とが適合する場合に、当該分割単位に基づいた並列処理による当該問合せ要求の実行プランを作成する
     ことを特徴とする請求項10に記載のデータ処理方法。
  12.  前記問合せ実行プラン作成ステップでは、並列処理による問合せ要求の実行プランとして、前記入力表に関する処理と前記表関数に関する処理との間で、表形式のデータを一時的に保持するためのプールによる処理結果の受け渡しを挟むようにし、前記入力表に関する処理と前記表関数に関する処理とをそれぞれ別個の複数の並列処理単位で行う並列処理方式による実行プランを作成し、
     前記問合せ実行ステップは、前記入力表に関する処理の結果としてのデータを前記プールに一時的に保持するプール保持ステップと、当該プール保持ステップで一時的に保持されたデータを読み出して前記表関数に関する処理に用いるプール読出ステップと、をさらに有する
     ことを特徴とする請求項10に記載のデータ処理方法。
  13.  引数に表形式のデータを許容する表関数の定義を、当該表関数による並列処理の実行可能性に関する属性情報を含む態様で登録する定義処理ステップと、
     前記定義処理ステップで登録された表関数ごとの定義情報、及び記憶媒体に格納された実表データに関する実表情報を保持させる情報管理ステップと、
     前記表関数を含む問合せ要求が入力された場合に、当該問合せ要求に含まれる表関数の前記定義情報に含まれる前記属性情報と、前記実表データのうち当該問合せ要求の引数で渡される入力表に対応する前記実表情報とに基づいて、並列処理による当該問合せ要求の実行プランを作成する問合せ実行プラン作成ステップと、
     前記問合せ実行プラン作成ステップで作成された実行プランに基づいて、前記問合せ要求の引数で渡される前記入力表に関する処理と当該問合せ要求に含まれる前記表関数に関する処理とをそれぞれ並列処理する問合せ実行ステップと、
     前記問合せ実行ステップによる処理の実行結果を集合形式にマージして出力する結果マージステップと、
     を備える処理を実行させるプログラムが格納された記憶媒体。
  14.  前記情報管理ステップで保持される前記表関数ごとの前記定義情報には、前記属性情報として当該表関数が並列処理を実行可能な分割単位が示され、前記入力表に対応する前記実表情報には、当該入力表を並列処理することができる分割単位が示され、
     前記問合せ実行プラン作成ステップでは、前記表関数を含む問合せ要求が入力されたとき、当該表関数に対応する前記定義情報の前記属性情報に示された分割単位と、当該問合せ要求の引数で渡される入力表に対応する前記実表情報に示された分割単位とが適合する場合に、当該分割単位に基づいた並列処理による当該問合せ要求の実行プランを作成する処理を実行させる
     ことを特徴とする請求項13に記載の記憶媒体。
  15.  前記問合せ実行プラン作成ステップにおいて、並列処理による問合せ要求の実行プランとして、前記入力表に関する処理と前記表関数に関する処理との間で、表形式のデータを一時的に保持するためのプールによる処理結果の受け渡しを挟むようにし、前記入力表に関する処理と前記表関数に関する処理とをそれぞれ別個の複数の並列処理単位で行う並列処理方式による実行プランを作成する処理を実行させ、
     前記問合せ実行ステップにおいて、前記入力表に関する処理の結果としてのデータを前記プールに一時的に保持する処理と、当該プールに一時的に保持されたデータを読み出して前記表関数に関する処理に用いる処理と、を実行させる
     ことを特徴とする請求項13に記載の記憶媒体。
     
     
PCT/JP2015/077505 2015-09-29 2015-09-29 管理システム、データ処理方法、及び記憶媒体 WO2017056189A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2015/077505 WO2017056189A1 (ja) 2015-09-29 2015-09-29 管理システム、データ処理方法、及び記憶媒体

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2015/077505 WO2017056189A1 (ja) 2015-09-29 2015-09-29 管理システム、データ処理方法、及び記憶媒体

Publications (1)

Publication Number Publication Date
WO2017056189A1 true WO2017056189A1 (ja) 2017-04-06

Family

ID=58423139

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2015/077505 WO2017056189A1 (ja) 2015-09-29 2015-09-29 管理システム、データ処理方法、及び記憶媒体

Country Status (1)

Country Link
WO (1) WO2017056189A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007513426A (ja) * 2003-12-02 2007-05-24 オラクル・インターナショナル・コーポレイション 異種コンピュータシステムにわたる複雑計算
WO2014188553A1 (ja) * 2013-05-23 2014-11-27 株式会社日立製作所 結合問合わせ実行方法及び装置並びに記憶媒体

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007513426A (ja) * 2003-12-02 2007-05-24 オラクル・インターナショナル・コーポレイション 異種コンピュータシステムにわたる複雑計算
WO2014188553A1 (ja) * 2013-05-23 2014-11-27 株式会社日立製作所 結合問合わせ実行方法及び装置並びに記憶媒体

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HIDEYA SHIBATA: "RDBMS e Add-on Kano na Ko CPU Fuka Enzan no Bunsan Heiretsu Shori Shuho", DAI 5 KAI FORUM ON DATA ENGINEERING AND INFORMATION MANAGEMENT (DAI 11 KAI THE DATABASE SOCIETY OF JAPAN NENJI TAIKAI, 31 May 2013 (2013-05-31), pages 1 - 6 *
YUKI FUJII: "Hyochigata User Teigi Kansu o Mochiita Toiawase ni Okeru Kansu Shutsuryoku Overhead Sakugen Shuho", IPSJ SIG NOTES DATABASE SYSTEM (DBS, 15 July 2013 (2013-07-15), pages 1 - 6 *

Similar Documents

Publication Publication Date Title
US10521427B2 (en) Managing data queries
US10769147B2 (en) Batch data query method and apparatus
US8478790B2 (en) Mechanism for co-located data placement in a parallel elastic database management system
JP6581727B2 (ja) 動的なパーティショニングを使用してデータを処理すること
US10095699B2 (en) Computer-readable recording medium, execution control method, and information processing apparatus
US20210096981A1 (en) Identifying differences in resource usage across different versions of a software application
US20160132542A1 (en) Online index rebuilding method and apparatus
CN110941741A (zh) 图数据的路径检索处理方法、装置、服务器及存储介质
CN111143470A (zh) 跨平台数据库数据同步比对方法及装置
WO2018143441A1 (ja) 情報処理システム及び情報処理方法
KR101989074B1 (ko) 데이터베이스 샤딩 환경에서의 복제 로그 기반의 마이그레이션
JP7259973B2 (ja) データ分析処理装置、データ分析処理方法及びデータ分析処理プログラム
US8606744B1 (en) Parallel transfer of data from one or more external sources into a database system
KR101772333B1 (ko) 이종 NoSQL 데이터베이스들간의 지능적 조인 전략 제공 방법 및 시스템
WO2017056189A1 (ja) 管理システム、データ処理方法、及び記憶媒体
JP2008225686A (ja) 分散型データ処理プラットフォームにおけるデータ配置管理装置と方法、システム及びプログラム
JP2001265726A (ja) コンピュータ作業負荷の高速リカバリおよび再配置を可能にする自動化アプリケーションおよび手順
CN111723249A (zh) 一种实现数据处理的方法、装置、计算机存储介质及终端
KR101919816B1 (ko) 데이터베이스 샤딩 환경에서의 정합성 검사
CN110222105A (zh) 数据汇总处理方法及装置
US11734291B2 (en) Parallel execution of API calls using local memory of distributed computing devices
US20100228723A1 (en) Method and apparatus for unstructured data mining and distributed processing
US8996911B2 (en) Core file limiter for abnormally terminating processes
WO2020259020A1 (zh) 指令块的处理方法及装置、存储介质、电子装置
KR20240067392A (ko) Dbms 태스크의 연산 스토리지 오프로드 기반 자원 절감 효과 분석 모델 적용 방법

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: 15905344

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15905344

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP