Database control device, database control method, and program
The database control device automates the addition of new tables in a hierarchical database by using parent table and attribute information to maintain structural integrity and reduce user effort.
Patent Information
- Application Number
- JP2022137923
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-10-15
- Estimated Expiration
- 2042-08-31
AI Technical Summary
Existing database technologies, such as those described in Patent Document 1, do not provide a method for adding a new table to a database with a hierarchical structure while maintaining the integrity of the hierarchical organization.
A database control device that acquires parent table identification information and new attribute information to generate a new table with unique attributes from the parent table and additional attributes, ensuring the new table adheres to the hierarchical structure rules.
Ensures that the hierarchical rules of the database are maintained, reducing user effort and minimizing errors in adding new tables by automating the identification and inclusion of unique attributes.
Smart Images

Figure 0007754026000001 
Figure 0007754026000002 
Figure 0007754026000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a database control device, a database control method, and a program. [Background technology]
[0002] Various database-related technologies have been developed. For example, Patent Document 1 discloses a hierarchical structure of tables in a relational database. Specifically, when multiple tables have a common attribute, a table with the common attribute is defined above those multiple tables. Each lower-level table defines its own unique attribute. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2009-146045 Summary of the Invention [Problem to be solved by the invention]
[0004] Patent Document 1 does not mention a specific method for adding a new table to a database in which tables are organized hierarchically. The present disclosure provides a new technology related to database control. [Means for solving the problem]
[0005] The database control device of the present disclosure includes an acquisition unit that acquires, for a newly generated new table, parent table identification information that is identification information of the parent table of the new table in the hierarchical structure of tables included in the database, and new attribute information that indicates identification information of new attributes that are attributes to be included in the new table but are not included in the parent table of the new table; an identification unit that uses the parent table identification information to identify unique attributes that are attributes for which a unique constraint is set in the parent table of the new table; and a generation unit that uses the identification result by the identification unit and the new attribute information to generate the new table having all of the unique attributes included in the parent table of the new table and all of the new attributes indicated in the new attribute information.
[0006] A database control method according to the present disclosure is executed by a computer and includes the steps of: acquiring, for a newly generated new table, parent table identification information that identifies a parent table of the new table in a hierarchical structure of tables included in a database, and new attribute information that indicates identification information of new attributes that are attributes to be included in the new table but are not included in the parent table of the new table; identifying, using the parent table identification information, unique attributes that are attributes for which a unique constraint is set in the parent table of the new table; and generating, using the identification result by the identifying unit and the new attribute information, the new table having all the unique attributes included in the parent table of the new table and all the new attributes indicated in the new attribute information.
[0007] The program of the present disclosure causes a computer to execute the database control method of the present disclosure. [Effects of the Invention]
[0008] According to the present disclosure, a new technique for controlling a database is provided. [Brief explanation of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram illustrating an example of an overview of a database control device according to a first embodiment. [Figure 2] FIG. 2 is a diagram illustrating an example of a hierarchical structure of tables in a database. [Figure 3] 2 is a block diagram illustrating an example of the functional configuration of the database control device of the first embodiment. FIG. [Figure 4] FIG. 2 is a block diagram illustrating an example of the hardware configuration of a computer that realizes the database control device of the first embodiment. [Figure 5] FIG. 2 is a diagram illustrating an example of the relationship between a database control device and a management system. [Figure 6] 4 is a flowchart illustrating the flow of processing executed by the database control device of the first embodiment. [Figure 7] 10 is a diagram illustrating an example of an input screen that accepts designation of a parent table and a new attribute from a user. FIG. [Figure 8] FIG. 10 is a diagram illustrating an example of an overview of a database control device according to a second embodiment. [Figure 9] FIG. 10 is a diagram illustrating an example of a reference relationship between attributes in a database. [Figure 10] FIG. 10 is a diagram illustrating an example of reference information. [Figure 11] FIG. 10 is a block diagram illustrating an example of the functional configuration of a database control device according to a second embodiment. [Figure 12] 10 is a flowchart illustrating the flow of processing executed by the database control device of the second embodiment. [Figure 13] 10 is a flowchart illustrating the flow of processing executed by a second generation unit. [Figure 14] FIG. 10 is a block diagram illustrating an example of the functional configuration of a database control device according to a third embodiment. [Figure 15] 11 is a flowchart illustrating the flow of processing executed by the database control device of the third embodiment. [Figure 16] 10 is a flowchart illustrating an example of the flow of a process for determining a table to be searched. [Figure 17] 10 is a flowchart illustrating an example of a process flow for determining a joining method for tables to be searched. [Figure 18] FIG. 18 is a diagram illustrating a specific situation used to explain the flowcharts of FIGS. 16 and 17. [Figure 19] FIG. 2 is a block diagram illustrating a functional configuration of a search device. DETAILED DESCRIPTION OF THE INVENTION
[0010] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. In each drawing, the same or corresponding elements are designated by the same reference numerals, and duplicate explanations will be omitted as necessary for clarity. Furthermore, unless otherwise specified, predetermined values such as predetermined values and threshold values are stored in advance in a storage unit accessible from a device that uses the values. Furthermore, unless otherwise specified, the storage unit is composed of one or any number of storage devices.
[0011] [Embodiment 1] <Summary> Fig. 1 is a diagram illustrating an example of an overview of a database control device 2000 according to embodiment 1. Fig. 1 is a diagram for facilitating understanding of the overview of the database control device 2000, and the operation of the database control device 2000 is not limited to that shown in Fig. 1.
[0012] The database control device 2000 has at least the function of controlling the addition of tables to the database 10. In the database 10, a plurality of tables 20 are managed in a hierarchical structure.
[0013] FIG. 2 is a diagram illustrating an example of a hierarchical structure of tables in a database 10. The database 10 has one or more table trees 30. The table tree 30 is made up of multiple hierarchically arranged tables 20. A table 20 is a table made up of one or more attributes 22. Note that an "attribute" can also be expressed as a "column." One or more of the attributes 22 included in the table 20 are attributes with a unique constraint set (attributes treated as unique keys). Hereinafter, an attribute with a unique constraint set is referred to as a "unique attribute." The table 20 may or may not have attributes 22 other than the unique attribute. Note that in FIGS. 1 and 2, unique attributes are represented by diagonal lines.
[0014] In the table tree 30, a table 20 includes all unique attributes included in the other table 20 directly above it. Hereinafter, when a table Ty exists directly above a certain table Tx, the table Ty is referred to as the parent table of the table Tx, and the table Tx is referred to as the child table of the table Ty. In addition to all unique attributes included in the parent table, the table 20 further includes one or more unique attributes not included in the parent table.
[0015] For example, in Figure 2, table T2 has a unique attribute C1 that is included in its parent table, table T1. Furthermore, table T2 has a unique attribute C2 that is not included in table T1. Table T3 has unique attributes C1 and C2 that are included in its parent table, table T2. Furthermore, table T3 has unique attributes C3 and C4 that are not included in table T2. Furthermore, table T3 has an attribute C5 that is not a unique attribute.
[0016] The database control device 2000 controls the addition of a table 20 to the database 10 configured as described above. Here, the attributes 22 included in a table newly added to the database 10 (hereinafter referred to as a new table 60) can be classified into unique attributes included in its parent table and attributes not included in its parent table.
[0017] The database control device 2000 acquires parent table identification information 40 and new attribute information 50 in order to add a new table 60 to the database 10. The parent table identification information 40 is identification information of the parent table of the new table 60. The table identification information is, for example, the name of the table. The new table 60 is generated as a new table 20 located immediately below the table 20 identified by the parent table identification information 40. The new attribute information 50 indicates identification information of a new attribute, which is an attribute other than the unique attribute of the parent table, among the attributes to be included in the new table 60. The attribute identification information is, for example, the name of the attribute.
[0018] The database control device 2000 uses the parent table identification information 40 to identify all unique attributes included in the parent table. Then, using the result of the above identification and the new attribute information 50, the database control device 2000 generates a new table 60 that includes all of the unique attributes included in the parent table as unique attributes and also includes new attributes indicated in the new attribute information 50. Note that "new table 60 includes, as unique attributes, unique attributes included in the parent table" means "new table 60 includes, as unique attributes, attributes that have identification information that is the same as the identification information of unique attributes included in the parent table."
[0019] At least one of the new attributes indicated in the new attribute information 50 is a unique attribute. Therefore, the new attribute information 50 further includes information that can identify new attributes that are treated as unique attributes. For example, the new attribute information 50 has a flag for each new attribute that indicates whether the new attribute is a unique attribute. The database control device 2000 generates the new table 60 so that attributes indicated as unique attributes in the new attribute information 50 are treated as unique attributes. Furthermore, the database control device 2000 generates the new table 60 so that attributes indicated as non-unique attributes in the new attribute information 50 are treated as non-unique attributes.
[0020] For example, suppose a new table T6 is added immediately below table T5 in database 10 shown in Figure 2. The new table T6 includes, as new attributes, attribute C9, which is a unique attribute, and attribute C10, which is not a unique attribute.
[0021] In this case, parent table identification information 40 indicates the identification information of table T5, "T5." Furthermore, new attribute information 50 indicates attribute C9 as a new attribute with a unique constraint, and attribute C10 as a new attribute without a unique constraint.
[0022] The database control device 2000 uses the parent table identification information 40 to identify that the unique attributes of table T5 are attributes C6 and C7. The database control device 2000 generates a new table T6 using this identification result and the information indicated in the new attribute information 50. The new table T6 includes attributes C6, C7, and C9 as unique attributes, and also includes attribute C10 as a non-unique attribute.
[0023] <Example of effects> As described above, in the database 10 handled by the database control device 2000 of this embodiment, multiple tables 20 are hierarchically organized based on a specific rule. This rule states that "each table 20 has all the unique attributes contained in its parent table."
[0024] The database control device 2000 adds a new table 60 to the database 10 so as to observe these rules. Specifically, the database control device 2000 acquires parent table identification information 40, which is identification information for the parent table of the new table 60, and uses this parent table identification information 40 to identify all unique attributes included in the parent table. The database control device 2000 then includes all unique attributes included in the parent table in the new table 60. This ensures that all unique attributes included in the parent table are included in the new table 60. Therefore, the new table 60 is generated in accordance with the above-mentioned rules.
[0025] Furthermore, the database control device 2000 acquires new attribute information 50 indicating new attributes, which are attributes not included in the parent table, among the attributes to be included in the new table 60, and includes the new attributes indicated in the new attribute information 50 in the new table 60. Therefore, the user of the database control device 2000 can arbitrarily include attributes other than the unique attributes included in the parent table in the new table 60.
[0026] Here, one possible method for adding the new table 60 to the database 10 is for the user to specify all of the attributes to be included in the new table 60. However, with this method, there is a risk that the hierarchical rules of the database 10 will not be observed due to a user error in specification, etc. In this regard, if the database control device 2000 is used, the unique attributes included in the parent table can be automatically identified by the database control device 2000. Therefore, it is possible to ensure that the hierarchical rules of the database 10 are observed.
[0027] Furthermore, if the user has to specify the attributes to be included in the new table 60, the effort required to add the new table 60 increases. In this regard, when using the database control device 2000, the user does not need to specify the unique attributes included in the parent table. This reduces the effort required to add the new table 60.
[0028] The database control device 2000 of this embodiment will be described in more detail below.
[0029] <Example of functional configuration> 3 is a block diagram illustrating an example of the functional configuration of the database control device 2000 according to the first embodiment. The database control device 2000 includes an acquisition unit 2020, an identification unit 2040, and a generation unit 2060. The acquisition unit 2020 acquires parent table identification information 40 and new attribute information 50. The identification unit 2040 uses the parent table identification information 40 to identify all unique attributes included in the parent table. The generation unit 2060 uses the results of the identification and the new attribute information 50 to generate a new table 60. The new table 60 includes all unique attributes of the parent table as unique attributes, and also has all attributes indicated in the new attribute information 50.
[0030] <Example of hardware configuration> Each functional component of the database control device 2000 may be realized by hardware that realizes the functional component (e.g., a hardwired electronic circuit, etc.), or by a combination of hardware and software (e.g., a combination of an electronic circuit and a program that controls it). Below, a further explanation will be given of the case where each functional component of the database control device 2000 is realized by a combination of hardware and software.
[0031] FIG. 4 is a block diagram illustrating an example of the hardware configuration of a computer 500 that realizes the database control device 2000 of the first embodiment. The computer 500 is any computer. For example, the computer 500 is a stationary computer such as a desktop PC (Personal Computer) or a server machine. Alternatively, the computer 500 may be a portable computer such as a laptop PC, a smartphone, or a tablet terminal. The computer 500 may be a dedicated computer designed to realize the database control device 2000, or may be a general-purpose computer.
[0032] For example, by installing a predetermined application on the computer 500, each function of the database control device 2000 is realized on the computer 500. The application is configured as a program for realizing each functional component of the database control device 2000. The method for acquiring the program is arbitrary. For example, the program can be acquired from a storage medium (such as a DVD disk or USB memory) on which the program is stored. Alternatively, the program can be acquired by downloading the program from a server device that manages the storage device on which the program is stored.
[0033] The computer 500 includes a bus 502, a processor 504, a memory 506, a storage device 508, an input / output interface 510, and a network interface 512. The bus 502 is a data transmission path for the processor 504, the memory 506, the storage device 508, the input / output interface 510, and the network interface 512 to transmit and receive data to and from each other. However, the method for connecting the processor 504 and other components to each other is not limited to a bus connection.
[0034] The processor 504 is one of various processors, such as a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA). The memory 506 is a main storage device realized using a random access memory (RAM) or the like. The storage device 508 is an auxiliary storage device realized using a hard disk, a solid state drive (SSD), a memory card, or a read only memory (ROM) or the like.
[0035] The input / output interface 510 is an interface for connecting the computer 500 to an input / output device. For example, the input / output interface 510 is connected to an input device such as a keyboard and an output device such as a display device.
[0036] The network interface 512 is an interface for connecting the computer 500 to a network. The computer 500 is connected to the network 100 via the network interface 512. The network 100 may be a LAN (Local Area Network) or a WAN (Wide Area Network).
[0037] The storage device 508 stores programs (programs that realize the above-mentioned applications) that realize the various functional components of the database control device 2000. The processor 504 reads these programs into the memory 506 and executes them, thereby realizing the various functional components of the database control device 2000.
[0038] The database control device 2000 may be realized by one computer 500, or may be realized by multiple computers 500. In the latter case, the configuration of each computer 500 does not need to be the same, and can be different from each other.
[0039] <Example of usage environment of database control device 2000> Here, to facilitate understanding of the database control device 2000, a specific example of the environment in which the database control device 2000 is used will be given. However, the environment in which the database control device 2000 is used is not limited to the example given below.
[0040] In the example described here, the database 10 is managed by a management system such as an RDBMS (Relational Database Management System). The database control device 2000 adds a new table 60 to the database 10 using functions provided by the management system.
[0041] FIG. 5 is a diagram illustrating the relationship between the database control device 2000 and the management system. The database control device 2000 receives a creation request 80 from a user, which requests the creation of a new table 60. Based on the creation request 80, the database control device 2000 generates a creation command 90 for causing the management system 70 to create the new table 60. For example, the creation command 90 is implemented by a create statement in the SQL language. The management system 70 adds the new table 60 to the database 10 by executing the creation command 90. Here, in FIG. 5, the database 10 is stored in the storage unit 120. Therefore, the new table 60 is stored in the storage unit 120.
[0042] The management system 70 may be provided externally or internally to the database control device 2000. In the former case, for example, the management system 70 is implemented on a server machine that is communicatively connected to the database control device 2000. The server machine receives a creation command 90 from the database control device 2000 and executes the creation command 90 to add a new table 60 to the database 10.
[0043] When the management system 70 is provided inside the database control device 2000, for example, an application that realizes the functions of the database control device 2000 and an application that realizes the functions of the management system 70 both run on a computer 500 that realizes the database control device 2000. In this case, the application that realizes the database control device 2000 receives a creation request 80 and generates a creation command 90 based on the creation request 80. The application that realizes the functions of the management system 70 adds a new table 60 to the database 10 by obtaining and executing this creation command 90.
[0044] <Processing flow> 6 is a flowchart illustrating the flow of processing executed by the database control device 2000 of embodiment 1. The acquisition unit 2020 acquires parent table identification information 40 and new attribute information 50 (S102). The identification unit 2040 uses the parent table identification information 40 to identify all unique attributes included in the parent table of the new table 60 (S104). The generation unit 2060 uses the result of the above identification and the new attribute information 50 to generate the new table 60 (S106).
[0045] <Obtaining parent table identification information 40 and new attribute information 50: S102> The acquisition unit 2020 acquires the parent table identification information 40 and the new attribute information 50 (S102). To do this, for example, the acquisition unit 2020 receives input from the user of the database control device 2000 specifying the new attribute and the parent table of the new table 60. By receiving the specification of the new attribute from the user, the database control device 2000 can obtain the new attribute information 50 indicating the new attribute. Furthermore, the database control device 2000 can obtain the parent table identification information 40 based on the specification from the user.
[0046] 7 is a diagram illustrating an example of an input screen that accepts designation of a parent table and a new attribute from a user. Input screen 110 has input area 112, which is an input area for designating a parent table, and input area 114, which is an input area for designating a new attribute. For example, input area 112 is configured to allow selection of one of tables 20 included in database 10. This selection can be realized using a user interface such as a drop-down list, for example.
[0047] The input area 114 is configured to allow input of identification information (here, attribute names) for each of one or more new attributes. Input of the identification information for the new attributes can be realized, for example, by using a user interface such as a text area. The input area 114 is also configured to allow setting of a unique constraint for each new attribute to be specified. Specification of the unique constraint can be realized, for example, by using a user interface such as a check box. Furthermore, the number of attributes can be increased by pressing a button with a + mark.
[0048] The input area 114 is preferably configured to allow for setting information other than the identification information or the presence or absence of a unique constraint for each new attribute. For example, the input area 114 is configured to allow for input of the type or size limit of data to be stored in the new attribute, or constraints other than the unique constraint to be set for the attribute. The new attribute information 50 is preferably generated to include this information.
[0049] When the specification of the parent table and new attribute is complete, the user presses the register button 116. In response to the pressing of the register button 116, parent table identification information 40 and new attribute information 50 are generated based on the information entered on the input screen 110. The parent table identification information 40 is generated so as to indicate the identification information of the parent table specified using the input area 112. The new attribute information 50 is generated so as to indicate the information specified using the input area 114.
[0050] The acquisition unit 2020 acquires parent table identification information 40 and new attribute information 50 generated based on the results of input on the input screen 110. For example, the input screen 110 is provided to a terminal operated by a user (hereinafter referred to as a user terminal). For example, the database control device 2000 provides the input screen 110 to the user terminal and acquires the results of input on the input screen 110 as a generation request representing a request for new table generation. Furthermore, the database control device 2000 generates the parent table identification information 40 and new attribute information 50 based on the contents of this generation request. The acquisition unit 2020 acquires the parent table identification information 40 and new attribute information 50 generated in this manner.
[0051] The provision of the input screen 110 to the user terminal and the generation of the parent table identification information 40 and the new attribute information 50 may be performed by a device other than the database control device 2000. In this case, the acquisition unit 2020 acquires the parent table identification information 40 and the new attribute information 50 generated by the other device. For example, the acquisition unit 2020 acquires the parent table identification information 40 and the new attribute information 50 by receiving the parent table identification information 40 and the new attribute information 50 transmitted to the database control device 2000 from the other device.
[0052] <Identifying unique attributes of the parent table: S104> The identification unit 2040 uses the parent table identification information 40 to identify all unique attributes included in the parent table (S104). For example, the identification unit 2040 acquires definition information for the table 20 (i.e., the parent table of the new table) having identification information represented by the parent table identification information 40. The definition information for each table 20 included in the database 10 is managed, for example, by a management system (management system 70 in the example of FIG. 5) that manages the database 10. Therefore, for example, the identification unit 2040 acquires the definition information for the parent table of the new table by sending a request to the management system 70 to provide definition information for the table 20 having identification information represented by the parent table identification information 40. The identification unit 2040 then identifies identification information for each attribute 22 for which a unique constraint is set in the definition information, thereby identifying all unique attributes in the parent table of the new table.
[0053] Instead of requesting the management system 70 to provide definition information of the parent table of the new table, the identification unit 2040 may request the management system 70 to provide identification information of each unique attribute included in the parent table of the new table. In this case, the response obtained from the management system 70 indicates identification information of each unique attribute included in the parent table of the new table. Therefore, the identification unit 2040 can identify all unique attributes included in the parent table of the new table by obtaining and referring to the response from the management system 70.
[0054] The identification unit 2040 may be configured to be able to refer to the definition information of the parent table of the new table without using the management system 70. For example, the definition information of each table 20 included in the database 10 is stored in a storage unit accessible from the database control device 2000. For example, when adding a new table to the database 10, the database control device 2000 stores the definition information of the new table in the storage unit. The identification unit 2040 obtains the definition information of the table 20 having the identification information indicated in the parent table identification information 40 from the storage unit.
[0055] Instead of the definition information of each table 20, identification information of the unique attributes included in each table 20 may be stored in a storage unit accessible from the database control device 2000. In this case, for example, when adding a new table to the database 10, the database control device 2000 stores the identification information of each unique attribute included in the new table in the storage unit in association with the identification information of the new table. The identification unit 2040 identifies each unique attribute of the parent table of the new table by acquiring the identification information of each unique attribute stored in the storage unit in association with the identification information indicated in the parent table identification information 40.
[0056] <Create a new table: S106> The generation unit 2060 generates a new table using the results of the identification by the identification unit 2040 and the new attribute information 50 (S104). The new table 1) includes all unique attributes included in the parent table of the new table identified by the identification unit 2040 as unique attributes, and 2) includes each new attribute indicated in the new attribute information 50.
[0057] To generate such a new table, for example, the generation unit 2060 generates a command (generation command 90 in the example of FIG. 5) for adding the new table 20 to the database 10. Then, the generation unit 2060 adds the new table to the database 10 by having the management system 70 execute the generation command 90. As mentioned above, a specific example of the generation command 90 is a create statement in the SQL language.
[0058] More specifically, the generation unit 2060 generates a generation command 90 that specifies the identification information of each attribute 22 to be included in the new table and the constraints to be set for each attribute 22. In the generation command 90, the identification information of each unique attribute of the parent table of the new table and the identification information of each new attribute indicated in the new attribute information 50 are specified as the identification information of the attributes 22 to be included in the new table. The generation command 90 also specifies that a unique constraint be set for attributes 22 that are to have the same identification information as each unique attribute included in the parent table of the new table and for attributes 22 that are specified as unique attributes in the new attribute information 50. Furthermore, if the new attribute information 50 indicates the data type and size of the new attribute, the generation command 90 specifies the type and size indicated in the new attribute information 50 for the new attribute. Furthermore, if the new attribute information 50 specifies various constraints to be set for the new attribute, the generation command 90 specifies the constraints indicated in the new attribute information 50 for the new attribute.
[0059] [Embodiment 2] <Summary> Fig. 8 is a diagram illustrating an example of an overview of the database control device 2000 of embodiment 2. Here, Fig. 8 is a diagram for facilitating understanding of the overview of the database control device 2000, and the operation of the database control device 2000 is not limited to that shown in Fig. 8. Unless otherwise specified, the database control device 2000 of embodiment 2 has the same functions as the database control device 2000 of embodiment 1.
[0060] The database control device 2000 of the second embodiment generates reference information representing a reference from an attribute of another table 20 to an attribute of the new table. Here, "referencing attribute Y of another table Tj from attribute X of table Ti" means that the attribute values of attribute Y that can be registered in table Tj are limited to the attribute values of attribute X registered in table Ti. Note that attributes that can be specified as reference source attributes may be limited to unique attributes.
[0061] In the database 10 of the second embodiment, any attribute is referenced by another attribute having the same identification information as the attribute. FIG. 9 is a diagram illustrating an example of the reference relationship between attributes in the database 10. In FIG. 9, tables T3 and T5 have an attribute C5 with the same identification information, "C5." The attribute C5 in table T3 references the attribute C5 in table T5. Therefore, the attribute values of the attribute C5 that can be registered in table T5 are limited to the attribute values of the attribute C5 registered in table T3.
[0062] Here, information indicating a reference relationship between attributes in the database 10 is called reference information. For example, for each table 20, reference information indicating a reference from another table 20 to that table 20 is generated. FIG. 10 is a diagram illustrating an example of reference information. Reference information 130 is associated with referenced table identification information 132. Referenced table identification information 132 is identification information of the table 20 that the reference information 130 targets. In other words, it is identification information of the table 20 that is the reference destination in the reference relationship represented by the reference information 130. Reference information 130 associates attribute identification information 134 with referencing table identification information 136. Attribute identification information 134 indicates identification information of the attribute 22 for which a reference relationship is set. Referencing table identification information 136 is identification information of the table 20 to which the referencing attribute 22 belongs.
[0063] For example, the reference information 130 illustrated in FIG. 10 is associated with the identification information "T10" of table T10. That is, the reference information 130 in FIG. 10 indicates a reference from an attribute 22 included in another table 20 to an attribute 22 included in table T10. In FIG. 10, the record in the first row of the reference information 130 indicates "attribute identification information 134=C9, referencing table identification information 136=T8." This indicates a reference relationship in which "attribute C9 included in table T8 references attribute C9 included in table T10." Therefore, the attribute values of attribute C9 that can be registered in table T10 are limited to the attribute values of attribute C9 registered in table T8.
[0064] When a new table is added to the database 10, there is a possibility that for one or more new attributes, other attributes having the same identification information as the new attribute may exist in the database 10. Therefore, when adding a new table to the database 10, the database control device 2000 generates reference information 130 for the new table. Specifically, for each new attribute indicated in the new attribute information 50, the database control device 2000 determines whether an attribute 22 that should reference the new attribute (hereinafter referred to as a reference attribute) exists in the database 10. Here, the reference attribute of a certain new attribute is an attribute 22 existing in the database 10 that has the same identification information as the new attribute.
[0065] If a reference attribute exists for a certain new attribute, the database control device 2000 generates reference information 130 that indicates a reference from the reference attribute to the new attribute. If the reference information 130 has the configuration shown in Fig. 10, the database control device 2000 generates reference information 130 that indicates, for a new attribute having a reference attribute, the identification information of the new attribute (=identification information of the reference attribute) in attribute identification information 134, and also indicates the identification information of the table 20 to which the reference attribute belongs in referencing table identification information 136.
[0066] <Example of effects> The database 10 handled by the database control device 2000 of this embodiment is configured in accordance with the hierarchical rule that "each table 20 has all unique attributes contained in its parent table," as well as the reference rule that "a new attribute contained in a new table is referenced by other attributes 22 having the same identification information as the new attribute." Therefore, for each new attribute contained in a new table, if another attribute 22 having the same identification information as the new attribute is contained in the database 10, the database control device 2000 generates reference information 130 indicating a reference from the other attribute 22 to the new attribute. In this way, a new table can be generated so that the above-mentioned reference rule is observed.
[0067] One possible method is for the user to specify the above-mentioned reference relationships themselves. However, this method may result in the user making a mistake in specifying the relationship, which could result in the reference rules in the database 10 not being observed. In this regard, by using the database control device 2000, the reference information 130 is automatically generated by the database control device 2000, ensuring that the reference rules in the database 10 are observed.
[0068] Furthermore, if the user had to specify the above-described reference relationships, adding a new table would require a lot of effort on the part of the user. In contrast, when using the database control device 2000, the user does not need to specify references by the new table. This reduces the effort required by the user to add a new table.
[0069] The database control device 2000 of this embodiment will be described in more detail below.
[0070] <Example of functional configuration> 11 is a block diagram illustrating an example of the functional configuration of a database control device 2000 according to the second embodiment. The database control device 2000 according to the second embodiment includes a second generation unit 2080 in addition to an acquisition unit 2020, an identification unit 2040, and a generation unit 2060. The second generation unit 2080 determines, for each new attribute indicated in the new attribute information 50, whether or not there is an attribute 22 (reference attribute) having the same identification information as the new attribute. Then, for each new attribute for which a reference attribute exists, the second generation unit 2080 generates reference information 130 representing a reference from the reference attribute to the new attribute.
[0071] <Example of hardware configuration> The database control device 2000 of the second embodiment has the same hardware configuration as the database control device 2000 of the first embodiment. Therefore, for example, the hardware configuration of the database control device 2000 of the second embodiment is expressed in Fig. 4, similar to the hardware configuration of the database control device 2000 of the first embodiment. However, the storage device 508 of the second embodiment stores a program for realizing the functional components of the database control device 2000 of the second embodiment.
[0072] <Processing flow> 12 is a flowchart illustrating the flow of processing executed by the database control device 2000 of embodiment 2. S202 to S206 correspond to S102 to S106 in Fig. 6, respectively. In S208, the second generation unit 2080 generates reference information 130 using the new attribute information 50.
[0073] Here, the flow of processing executed by the database control device 2000 of the second embodiment is not limited to the flow shown in Fig. 12. For example, the generation of the reference information 130 (S208) may be performed before the generation of the new table (S206), or may be performed in parallel with the generation of the new table. Furthermore, as will be described later, the reference information 130 may be included in the definition information of the new table. In this case, the reference information 130 may be generated by generating the new table.
[0074] <Generation of reference information 130: S208> The second generating unit 2080 generates reference information 130 using the new attribute information 50 (S208). To do this, for example, the second generating unit 2080 determines, for each new attribute indicated in the new attribute information 50, whether or not an attribute 22 (reference attribute) having the same identification information as the new attribute exists in the database 10. Then, for a new attribute for which a reference attribute exists, the second generating unit 2080 generates reference information 130 that represents a reference from the reference attribute to the new attribute.
[0075] The following describes an example of a process flow for generating reference information 130 using a flowchart. Fig. 13 is a flowchart illustrating an example of a process flow executed by second generating unit 2080. The flowchart in Fig. 13 can also be said to be an example of details of S208 in the flowchart in Fig. 12.
[0076] Steps S302 to S308 constitute a loop process L1 that is executed for each new attribute indicated in the new attribute information 50. In step S302, the second generation unit 2080 determines whether or not the loop process L1 has already been executed for all new attributes. If the loop process L1 has already been executed for all new attributes, the second generation unit 2080 ends the execution of the loop process L1. Therefore, the processing of FIG. 13 ends. On the other hand, if there are new attributes that have not yet been the target of the loop process L1, the second generation unit 2080 selects one of the new attributes that have not yet been the target of the loop process L1. The new attribute selected here is referred to as "new attribute i." The processing of FIG. 13 then proceeds to step S304.
[0077] The second generation unit 2080 determines whether a reference attribute corresponding to the new attribute i (another attribute 22 having the same identification information as the new attribute i) exists in the database 10 (S304). Note that various existing techniques can be used to search for an attribute having specific identification information in a database. If a reference attribute corresponding to the new attribute i does not exist (S304: NO), the processing in FIG. 13 proceeds to S308. S308 is the end of the loop processing L1. Therefore, the processing in FIG. 13 proceeds to S302.
[0078] If a reference attribute corresponding to the new attribute i exists (S304: YES), the second generation unit 2080 generates reference information 130 for the new table, which indicates the correspondence between the new attribute i and the reference attribute corresponding to the new attribute i (S306). For example, if the reference information 130 has the configuration illustrated in FIG. 10, the second generation unit 2080 generates reference information 130 indicating the correspondence of "attribute identification information 134 = identification information of the new attribute i, referencing source table identification information 136 = identification information of the table 20 to which the reference attribute corresponding to the new attribute i belongs." Note that if the reference information 130 for the new table has already been generated, for example, the second generation unit 2080 generates reference information 130 for the new attribute i by adding information indicating the correspondence between the new attribute i and the reference attribute corresponding to the new attribute i to the reference information 130 for the new table.
[0079] S308 is the end of the loop process L1, so the process in FIG.
[0080] Reference information 130 corresponding to table 20 may be included in the definition information of that table 20, or may be generated separately from that table 20. In the former case, for example, the second generation unit 2080 specifies, in a command for generating a new table, a foreign key constraint indicating a reference from the referencing attribute to new attribute i (a foreign key constraint indicating that only attribute values registered in the referencing attribute can be registered). By generating a new table using this command, definition information for the new table is generated so as to include information indicating a reference from the referencing attribute to new attribute i. Therefore, reference information 130 for the new table is generated together with the definition information for the new table.
[0081] When the reference information 130 is generated separately from the definition information of the new table, for example, the second generating unit 2080 generates the reference information 130 having the structure illustrated in Fig. 10 and stores it in a storage unit accessible from the database control device 2000. In this case, the reference information 130 is managed by the database control device 2000 separately from the information related to the database 10 managed by the management system 70.
[0082] <<About the case where multiple attributes 22 have the same identification information as the new attribute>> Here, it is conceivable that multiple other attributes 22 having the same identification information as the new attribute i exist in the database 10. For example, suppose that tables T1 to T5 shown in FIG. 9 exist in the database 10. Also, suppose that new attribute information 50 indicates attribute C5, whose identification information is C5, as one of the new attributes. Attribute C5 is already included in two tables, tables T3 and T5. Therefore, an attribute 22 having the same identification information as attribute C5 to be included in the new table exists in both table T3 and table T5.
[0083] In this way, if there are multiple other attributes 22 in the database 10 that have the same identification information as the new attribute i, in S304 the second generation unit 2080 identifies one of the multiple attributes 22 that have the same identification information as the new attribute i as the reference attribute of the new attribute i. Hereinafter, each of the multiple attributes 22 that have the same identification information as the new attribute i will be referred to as a "candidate reference attribute for the new attribute i."
[0084] The second generating unit 2080 identifies the reference attribute of the new attribute i from among the reference attribute candidates of the new attribute i based on the reference relationship between the reference attribute candidates of the new attribute i. For example, the second generating unit 2080 determines, as the reference attribute of the new attribute i, the attribute 22 that is set as the reference source in the reference relationship between the candidates of the reference attribute of the new attribute i.
[0085] 9, a reference is set from attribute C5 of table T3 to attribute C5 of table T5. Therefore, the attribute C5 set as the reference source is attribute C5 of table T3. Therefore, in the above-mentioned example in which a new table including attribute C5 is added to database 10 shown in FIG. 9, the second generation unit 2080 identifies attribute C5 of table T3 as the reference attribute of new attribute i.
[0086] Here, among the multiple candidates for the reference attribute, the attribute 22 that is set as the reference source in the reference relationship can also be said to be the attribute 22 among these candidates that is not referenced by other attributes 22. Therefore, the second generating unit 2080 may specify, as the reference attribute of the new attribute i, the attribute 22 that is not referenced by other attributes 22 among the multiple candidates for the reference attribute of the new attribute i.
[0087] Furthermore, among multiple candidates for the reference attribute, the attribute 22 set as the reference source in the reference relationship can also be said to be the attribute 22 that was generated earliest among these multiple candidates. Therefore, the second generating unit 2080 may specify the attribute 22 that was generated earliest among multiple candidates for the reference attribute of the new attribute i as the reference attribute of the new attribute i.
[0088] [Embodiment 3] The database control device 2000 of the third embodiment has a function of searching for data contained in the database 10. Unless otherwise specified below, the database control device 2000 of the third embodiment has the same functions as the database control device 2000 of the first or second embodiment.
[0089] Fig. 14 is a block diagram illustrating the functional configuration of a database control device 2000 according to embodiment 3. Note that parent table identification information 40, new attribute information 50, and new tables are omitted from Fig. 14.
[0090] 14, the database control device 2000 of embodiment 3 further includes a second acquisition unit 2100 and a search unit 2120 in addition to the functional components of the database control device 2000 of embodiment 1. The second acquisition unit 2100 acquires a search request 140 that requests a search. The search unit 2120 extracts data from the database 10 based on the search request 140, and generates search result information 150 that indicates the extracted data. If the database control device 2000 of embodiment 3 has the same functions as the database control device 2000 of embodiment 2, the database control device 2000 of embodiment 3 further includes a second generation unit 2080.
[0091] <Examples of effects> As explained in the first and second embodiments, in the database 10 handled by the database control device 2000, tables 20 are hierarchically organized, and child tables have all of the unique attributes of their parent tables. In addition, in the database 10, a reference relationship is established between attributes 22 that have the same identification information. According to the database control device 2000 of this embodiment, it is possible to search for data in the database 10 having such a structure and obtain desired data.
[0092] <Example of hardware configuration> The database control device 2000 of the third embodiment has the same hardware configuration as the database control device 2000 of the first embodiment. Therefore, for example, the hardware configuration of the database control device 2000 of the third embodiment is expressed in Fig. 4, similar to the hardware configuration of the database control device 2000 of the first embodiment. However, the storage device 508 of the third embodiment stores a program for realizing the functional components of the database control device 2000 of the third embodiment.
[0093] <Processing flow> 15 is a flowchart illustrating the flow of processing executed by the database control device 2000 of embodiment 3. The second acquisition unit 2100 acquires the search request 140 (S402). The search unit 2120 executes a search of the database 10 using the search request 140, thereby generating search result information 150 (S404).
[0094] <Retrieving search request 140: S402> The second acquisition unit 2100 acquires the search request 140 (S402). Here, various existing technologies can be used to acquire a request for searching a database. For example, the second acquisition unit 2100 provides the user with a search screen, which is a screen for requesting a search of the database 10. On the search screen, the user specifies at least one or more attributes that the user wants to acquire. Furthermore, on the search screen, the user may further specify search conditions, a sorting method for search results, etc. The second acquisition unit 2100 acquires information representing the results of input on such a search screen as the search request 140.
[0095] In the following description, the attributes specified by the user to be acquired by a search are referred to as "extracted attributes," and the attributes used in the search conditions are referred to as "condition attributes."
[0096] <Search execution: S404> The search unit 2120 generates search result information 150 by executing a search of the database 10 using the search request 140 (S404). For example, the search unit 2120 generates a command (hereinafter referred to as a search command) for causing the management system 70 to execute a search of the database 10 based on the search request 140. The search command can be realized, for example, by a select statement in the SQL language. The search unit 2120 then causes the management system 70 to execute the generated search command, and obtains information representing the results of the search from the management system 70.
[0097] The search result information 150 may be the search result information itself acquired from the management system 70, or may be information acquired from the management system 70 that has been processed in some way. In the latter case, for example, the search unit 2120 generates the search result information 150 by processing the information acquired from the management system 70 so that it conforms to a specific format. The database control device 2000 outputs the search result information 150 in any manner. For example, the search result information 150 is output by being stored in a storage unit, displayed on a display device, or transmitted to another device.
[0098] When a search command is generated by the database control device 2000 in this way, the user of the database control device 2000 does not need to generate the search command himself / herself. Therefore, by having the database control device 2000 generate the search command, the effort required by the user to search for data can be reduced.
[0099] The following describes a method for generating a search request from search request 140. First, search unit 2120 sets extraction attributes, table 20 to be searched, and search conditions for the search command based on the extraction attributes and search conditions indicated in search request 140. Specifically, search unit 2120 sets the extraction attributes indicated in search request 140 as the extraction attributes of the search command. Furthermore, search unit 2120 sets the search conditions indicated in search request 140 as the search conditions of the search command.
[0100] Furthermore, the search unit 2120 determines the table 20 to be searched based on the table 20 containing the extracted attribute and the table 20 containing the attribute used in the search condition. Then, the search unit 2120 sets the determined table 20 to be searched in the search command.
[0101] Here, if there are multiple tables 20 to be searched, it is necessary to set in the search command a join method between the tables 20. Therefore, the search unit 2120 determines a join method between the tables 20, and sets the determined join method in the search command.
[0102] As described above, a search command is generated from the search request 140 by setting the extraction attributes, search conditions, table 20 to be searched, and the joining method between tables 20 for the search command based on the search request 140. Note that if the search request 140 further includes other information such as sorting conditions, the search unit 2120 also sets the information such as the sorting conditions included in the search request 140 in the search command.
[0103] Below, a method for determining the table 20 to be searched and a method for determining a join method for the table 20 to be searched will be described. FIG. 16 is a flowchart illustrating an example of the process flow for determining the table 20 to be searched. FIG. 17 is a flowchart illustrating an example of the process flow for determining a join method for the table 20 to be searched. FIG. 18 is a diagram illustrating a specific situation used to explain the flowcharts of FIGS. 16 and 17.
[0104] In Fig. 18, among the unique attributes included in each child table, the unique attributes that are also included in the parent table are omitted. For example, table T2 has unique attributes U1 and U2, but only attribute U2 is shown in Fig. 18. Also, in Fig. 18, among the attributes 22 other than the unique attributes included in each table 20, the attributes 22 that are neither extraction attributes nor condition attributes are omitted.
[0105] 18, attribute U1 included in table T1, attribute C3 included in table T3, and attribute U10 included in table T10 are specified as extracted attributes in search request 140. Also, attribute C8 included in table T8 is used as a search condition in search request 140. In other words, attribute C8 of table T8 is the condition attribute.
[0106] 16, the search unit 2120 adds each table 20 including the extracted attribute and each table 20 including the condition attribute to a group of tables to be searched. The group of tables to be searched is a collection of tables 20 to be searched. In the example shown in FIG. 18, tables T1, T3, T8, and T10 are added to the group of tables to be searched.
[0107] For each table 20 identified in S502, the search unit 2120 adds each table 20 located above that table 20 in the table tree 30 to which that table 20 belongs to the group of tables to be searched (S504). In the example of FIG. 18, the tables 20 located above the table 20 identified in S502 are tables T1 and T2 located above table T3, table T7 located above table T8, and tables T7 to T9 located above table T10. Of these, tables T2, T7, and T9, which are not yet included in the group of tables to be searched, are added to the group of tables to be searched. At this stage, tables T1, T2, T3, T7, T8, T9, and T10 are included in the group of tables to be searched.
[0108] Here, there are various methods for identifying other tables 20 that are positioned higher than a certain table 20. For example, the search unit 2120 identifies other tables 20 that are positioned higher than a desired table 20 by referring to the definition information of each table 20 included in the database 10 and identifying the hierarchical structure of the tables 20 in the database 10.
[0109] Alternatively, for example, information representing the hierarchical structure of the table 20 (hereinafter referred to as hierarchical information) may be stored in a storage unit accessible from the database control device 2000, separate from the definition information of the table 20. For example, the hierarchical information may have a list (hereinafter referred to as hierarchical list) indicating, for each table tree 30 included in the database 10, the identification information of the tables 20 included in that table tree 30 in order from parent to child. In this case, the search unit 2120 can identify other tables 20 that exist above any table 20 by referring to the hierarchical information.
[0110] The hierarchical information is generated, for example, by the generation unit 2060. Specifically, when adding a new table to the database 10, the generation unit 2060 adds identification information of the new table to the end of the hierarchical list corresponding to the table tree 30 to which the new table is to be added.
[0111] For each table 20 included in the group of tables to be searched, the search unit 2120 identifies other tables 20 that reference that table 20, and adds the identified tables 20 to the group of tables to be searched (S506). In the example of FIG. 18, table T8 is referenced by table T4, so table T4 is added to the group of tables to be searched. Similarly, table T9 is referenced by table T5, so table T5 is added to the group of tables to be searched. Here, although table T7 is referenced by table T1, table T1 is already included in the group of tables to be searched, so there is no need to add table T1 to the group of tables to be searched.
[0112] 16, all tables 20 to be searched are included in the group of tables to be searched. Therefore, the search unit 2120 sets each table 20 included in the group of tables to be searched as a table 20 to be searched in the search command. In the example of FIG. 18, tables T1 to T5 and T7 to T10 are each set as a table 20 to be searched in the search command.
[0113] If the table group to be searched includes multiple tables 20, the process shown in Fig. 17 is further executed to determine a join method between the tables 20 and set it in the search command. In the process shown in Fig. 17, a join method is determined for each pair of tables 20 in a referential relationship and each pair of tables 20 in a parent-child relationship among the tables 20 included in the table group to be searched, and the determined join method is set in the search command.
[0114] First, in S602, the search unit 2120 determines a join method between the tables 20 of each pair of tables 20 that are in a referential relationship among the tables 20 included in the table group to be searched. Specifically, for each pair, a join method that expresses an outer join of the referencing table 20 to the referenced table 20 is determined as the join method between the referencing table 20 and the referenced table 20. As a result, the referencing table 20 is outer joined to the referenced table 20. Here, the attributes 22 that are joined to each other in these tables 20 are attributes 22 that are in a referential relationship to each other.
[0115] For example, in the example in Figure 18, table T7 is referenced by table T1. Therefore, table T1 is outer joined to table T7. Similarly, table T4 is outer joined to table T8, and table T5 is outer joined to table T9. When using SQL, for example, "table T1 is outer joined to table T7" can be expressed as ""T1" left outer join "T7"".
[0116] S604 to S610 constitute loop processing L2. Loop processing L2 is executed for each pair of tables 20 that are included in the table group to be searched and that have a parent-child relationship with each other.
[0117] In S604, the search unit 2120 determines whether or not loop process L2 has already been executed for all pairs of tables 20 that are included in the table group to be searched and that have a parent-child relationship with each other. If loop process L2 has already been executed for all pairs of tables 20 that have a parent-child relationship, the processing in FIG. 17 ends. On the other hand, if there are pairs of tables 20 that have a parent-child relationship but have not yet been the target of loop process L2, the search unit 2120 selects one of those pairs. Hereinafter, the pair selected here will be referred to as Pi.
[0118] The search unit 2120 determines whether the child table in the pair Pi is referenced by another table 20 (S606). If the child table is referenced by another table 20 (S606: YES), the processing in FIG. 17 proceeds to S610. Since S610 is the end of loop processing L2, the processing in FIG. 17 proceeds to S604. With this processing flow, if the child table in the pair Pi is referenced by another table 20, the parent table and child table in the pair Pi will not be joined.
[0119] For example, in the example in Figure 18, tables T7 and T8 are in a parent-child relationship. However, the child table T8 is referenced by table T4. Therefore, tables T7 and T8 are not joined. Similarly, tables T8 and T9 are not joined.
[0120] On the other hand, if in S606 the child table in the pair Pi is not referenced by another table 20 (S606: NO), the search unit 2120 determines, for the pair Pi, the join method that represents the outer join of the parent table to the child table as the join method for these tables 20 (S608). As a result, the parent table is outer joined to the child table. Here, the child table and parent table are joined by all common attributes 22. Note that the child table includes all unique attributes of the parent table, and therefore the common attributes 22 between them are the unique attributes of the parent table.
[0121] For example, in the example of Figure 18, tables T1 and T2 are in a parent-child relationship. Furthermore, child table T2 is not referenced by other tables 20. Therefore, parent table T1 is outer joined to child table T2. Similarly, parent table T2 is outer joined to child table T3, parent table T3 to child table T4, parent table T4 to child table T5, and parent table T9 to child table T10.
[0122] Since S610 is the end of the loop processing L2, the processing in FIG. 17 proceeds to S604.
[0123] 17, a join method between the tables 20 is determined for each pair of tables 20 that need to be joined together. The search unit 2120 then sets each of the determined join methods in the search command.
[0124] <Modification> The function of searching for data contained in the database 10 may be provided outside the database control device 2000. Hereinafter, a device that is provided outside the database control device 2000 and has the function of searching for data contained in the database 10 will be referred to as a "search device."
[0125] 19 is a block diagram illustrating an example of the functional configuration of a search device 3000. The search device 3000 has an acquisition unit 3020 and a search unit 3040. The functions of the acquisition unit 3020 and the search unit 3040 are the same as the functions of the second acquisition unit 2100 and the search unit 2120 described above, respectively.
[0126] The search device 3000 has the same hardware configuration as the database control device 2000. Therefore, for example, the hardware configuration of the search device 3000 is expressed in Fig. 4, similar to the hardware configuration of the database control device 2000. However, the storage device 508 of the search device 3000 stores a program for realizing the functional components of the search device 3000.
[0127] The flow of the process executed by the search device 3000 is shown in FIG. 15, similar to the flow of the process executed by the database control device 2000 of the third embodiment.
[0128] Although the present invention has been described above with reference to the embodiments, the present invention is not limited to the above embodiments. Various modifications that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.
[0129] In the above examples, the program includes instructions (or software code) that, when loaded into a computer, cause the computer to perform one or more functions described in the embodiments. The program may be stored in a non-transitory computer-readable medium or a tangible storage medium. By way of example and not limitation, computer-readable media or tangible storage media include random-access memory (RAM), read-only memory (ROM), flash memory, solid-state drive (SSD) or other memory technology, CD-ROM, digital versatile disc (DVD), Blu-ray (registered trademark) disc or other optical disk storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device. The program may also be transmitted on a transitory computer-readable medium or communication medium. By way of example and not limitation, transitory computer-readable media or communication media include electrical, optical, acoustic, or other forms of propagated signals. [Explanation of symbols]
[0130] 10 Databases 20 tables 22 attributes 30 Table Tree 40 Parent table identification information 50 New attribute information 60 New Tables 70 Management Systems 80 Generated Requests 90 Generate Command 100 Network 110 Input Screen 112 Input Area 114 Input Area 116 Registration button 120 Storage section 130 References 132 Referenced table identification information 134 Attribute Identification Information 136 Referenced table identification information 140 search requests 150 Search result information 500 computers 502 Bus 504 processor 506 memory 508 Storage Devices 510 Input / Output Interface 512 network interface 2000 Database Control Unit 2020 Acquisition Department 2040 Specific section 2060 Generation part 2080 Second generation part 2100 2nd Acquisition Department 2120 Search Department 3000 Search Device 3020 Acquisition Department 3040 Search Department
Claims
1. an acquisition unit that acquires, for a newly generated new table, parent table identification information that is identification information of a parent table of the new table in a hierarchical structure of tables included in a database, and new attribute information that indicates identification information of new attributes that are attributes to be included in the new table but are not included in the parent table of the new table; an identification unit that identifies a unique attribute, which is an attribute for which a unique constraint is set in the parent table of the new table, using the parent table identification information; a generating unit that generates the new table having all the unique attributes included in the parent table of the new table and all the new attributes indicated in the new attribute information, using the result of the identification by the identifying unit and the new attribute information; and a second generation unit that, for each new attribute, identifies an attribute from the database that has identification information identical to the identification information of the new attribute, and generates reference information representing a reference to the new attribute from the identified attribute.
2. The generation unit 2. The database control device according to claim 1, wherein a generation command for generating the new table is generated using the result of the identification by the identification unit and the new attribute information, and the new table is added to the database by having a management system that manages the database execute the generation command.
3. The acquisition unit providing a screen on which identification information of a parent table of the new table and identification information of the new attribute can be input; 2. A database control device as described in claim 1, wherein identification information of a parent table of the new table input on the screen is acquired as the parent table identification information, and the new attribute information indicating identification information of the new attribute input on the screen is acquired.
4. a second acquisition unit that acquires a request for searching data from the database; a search unit that identifies a table to be searched based on the request and searches the database for data using the table to be searched, The search unit Identifying, as tables to be searched, a table including an attribute specified as an extraction target in the request and a table including an attribute used as a search condition in the request; further identifying, as the table to be searched, any one or more tables located higher than the table to be searched in the hierarchical structure of tables in the database; The database control device according to claim 1 , further specifying a table that references the table to be searched as the table to be searched.
5. The search unit For each pair of tables in a referential relationship among the tables to be searched, outer-join the referencing table to the referenced table; 5. The database control device according to claim 4, wherein for each pair of tables in a parent-child relationship among the tables to be searched, if the child table is not referenced by another table, the parent table is outer-joined to the child table.
6. an acquisition step of acquiring, for a newly generated new table, parent table identification information which is identification information of a parent table of the new table in the hierarchical structure of tables included in the database, and new attribute information which indicates identification information of new attributes which are attributes to be included in the new table but are not included in the parent table of the new table; using the parent table identification information to identify a unique attribute, which is an attribute for which a unique constraint is set in the parent table of the new table; a generating step of generating the new table having all the unique attributes included in the parent table of the new table and all the new attributes indicated in the new attribute information, using the identification result in the identifying step and the new attribute information; and a second generation step of identifying, for each new attribute, an attribute from the database that has identification information identical to the identification information of the new attribute, and generating reference information representing a reference to the new attribute from the identified attribute.
7. an acquisition step of acquiring, for a newly generated new table, parent table identification information which is identification information of a parent table of the new table in the hierarchical structure of tables included in the database, and new attribute information which indicates identification information of new attributes which are attributes to be included in the new table but are not included in the parent table of the new table; using the parent table identification information to identify a unique attribute, which is an attribute for which a unique constraint is set in the parent table of the new table; a generating step of generating the new table having all the unique attributes included in the parent table of the new table and all the new attributes indicated in the new attribute information, using the identification result in the identifying step and the new attribute information; and a second generation step of identifying, for each new attribute, an attribute from the database that has identification information identical to the identification information of the new attribute, and generating reference information representing a reference to the new attribute from the identified attribute.
Citation Information
Patent Citations
Rdb system and recording medium
JP2001222460A
Computer, program and method for adding item to database
JP2006139746A
Database reuse method
JP2009146045A
System and method for efficient management of big data in a database using streaming tables
US20150142733A1