WO2013098918A1 - データベースシステム及びデータベース管理方法 - Google Patents
データベースシステム及びデータベース管理方法 Download PDFInfo
- Publication number
- WO2013098918A1 WO2013098918A1 PCT/JP2011/080077 JP2011080077W WO2013098918A1 WO 2013098918 A1 WO2013098918 A1 WO 2013098918A1 JP 2011080077 W JP2011080077 W JP 2011080077W WO 2013098918 A1 WO2013098918 A1 WO 2013098918A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- search
- entry
- index
- program information
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2246—Trees, e.g. B+trees
Definitions
- the present invention relates to a database system and a database management method for managing a table and an index for retrieving a table row (record).
- Some databases manage indexes for table records so that the table records stored in the database can be searched at high speed.
- the index is also updated.
- logical destruction In the database system, if a write error occurs when updating an index, the index data may be corrupted, making it impossible to perform a table record search using the index.
- a state in which the index data is broken is referred to as “logical destruction”.
- Patent Document 1 a technique for repairing a database without stopping the provision of the database service is known (for example, see Patent Document 1).
- the present invention has been made in view of the above problems, and an object of the present invention is to provide a technique capable of executing a search appropriately and quickly even when a logical breakdown occurs in an index.
- the database system has an interface to the storage device and a control device that accesses the storage device through the interface.
- the storage device stores a table that manages a plurality of rows having values of a plurality of items, and an index configured by a tree structure of a plurality of nodes for enabling the specification of rows by the values of one or more items.
- the control device identifies the item value condition included in the search condition of the search query, determines whether or not the index node corresponding to the item value condition is not referable, and if the node is not referable A range of item values managed by the disabled node is specified, and a row satisfying the search condition is searched for the specified range.
- the database system may include the storage device described above.
- FIG. 1 is a diagram illustrating an example of a processing outline of the database system according to the embodiment.
- FIG. 2 is a configuration diagram of an example of a computer system including the database system according to the embodiment.
- FIG. 3 is a diagram illustrating an example of a search query according to the embodiment.
- FIG. 4 is a diagram illustrating an example of a configuration of a table according to the embodiment.
- FIG. 5 is a diagram illustrating an example of an index configuration according to the embodiment.
- FIG. 6 is a diagram illustrating an example of a configuration of an index node according to the embodiment.
- FIG. 7 is a diagram illustrating an example of the index stage number management table according to the embodiment.
- FIG. 8 is a diagram illustrating an example of an index management table according to the embodiment.
- FIG. 1 is a diagram illustrating an example of a processing outline of the database system according to the embodiment.
- FIG. 2 is a configuration diagram of an example of a computer system including the database system according to the embodiment.
- FIG. 9A is a diagram illustrating an example of a configuration of search program information according to the embodiment.
- FIG. 9B is a diagram illustrating a first example of search program information according to the embodiment.
- FIG. 9C is a diagram illustrating a second example of search program information according to the embodiment.
- FIG. 9D is a diagram illustrating a third example of search program information according to the embodiment.
- FIG. 9E is a diagram illustrating a fourth example of search program information according to the embodiment.
- FIG. 9F is a diagram illustrating an example of a search program information management queue according to the embodiment.
- FIG. 10 is a diagram illustrating an example of the configuration of the unreferenceable node management information according to the embodiment.
- FIG. 11 is a flowchart of an example of the index search process according to the embodiment.
- FIG. 12 is a flowchart of an example of a node reference detection process according to the embodiment.
- FIG. 13 is a flowchart of an example of entry reference detection processing according to the embodiment.
- FIG. 14 is a flowchart of an example of the unreferenceable part specifying process according to the embodiment.
- FIG. 15 is a flowchart of an example of an alternative search program selection process according to the embodiment.
- FIG. 16A is a diagram illustrating a first specific example of search program information according to the embodiment.
- FIG. 16B is a diagram illustrating a second specific example of search program information according to the embodiment.
- FIG. 16C is a diagram illustrating a third specific example of search program information according to the embodiment.
- aaa table various types of information may be described using the expression “aaa table”, but the various types of information may be expressed using a data structure other than the table. In order to show that it does not depend on the data structure, the “aaa table” can be called “aaa information”.
- processing may be described using “program” or a program module as the subject, but the program or program module is controlled by a control device (for example, a processor (for example, a CPU (Central Processing Unit)).
- a control device for example, a processor (for example, a CPU (Central Processing Unit)
- the subject of the processing may be a control device in order to perform a predetermined processing using a storage resource (for example, a memory) and / or a communication interface device (for example, an interface) as appropriate.
- the process described with the program or program module as the subject may be a process performed by the control device or an apparatus or system (for example, a server apparatus) having the control device.
- the control device may include a hardware circuit that performs part or all of the processing.
- the program may be installed from a program source.
- the program source may be, for example, a program distribution server or a storage medium.
- FIG. 1 is a diagram for explaining an example of processing outline of the database system according to the embodiment.
- the index search unit 2120 searches for search program information registered in the root node of the index corresponding to the search query 3010 and the search program management queue 8100.
- a search is executed for the node indicated by 8110.
- the node reference detection unit 2113 detects the reference failure in the node 9100
- the entry reference detection unit 2114 detects the reference failure in the entry 9104 of the node 9100.
- the reference impossible part specifying unit 2115 specifies the search range by the node that cannot be referred to according to the type of node (root node, intermediate node, leaf node), and reference impossible node management information 11000 is generated.
- the alternative search program selection unit 2116 selects search program information for searching a search range based on nodes that cannot be referenced based on the node management information 11000 that cannot be referenced. As a result, the index search unit 2120 appropriately searches the search range of the unreferenceable nodes, and obtains a search result.
- FIG. 2 is a configuration diagram of a computer system including a database system according to an embodiment of the present invention.
- the computer system includes a terminal device 2150, a server device 2100, and an external storage device 1001.
- the terminal device 2150 and the server device 2100 are connected via a network 2160.
- the external storage device 1001 is connected to the internal bus 2104 of the server device 2100.
- a database system is configured by the server device 2100 and the external storage device 1001.
- the terminal device 2150 executes an application that uses a database system, for example, and issues a search request (search query) to the table 6100 in the database to the server device 2100.
- FIG. 3 is a diagram illustrating an example of a search query according to the embodiment.
- the search query 3010 includes, for example, a table specification description 3011 for specifying a table to be searched (6100, etc.) and a search condition description 3012 for specifying a search condition.
- the search query 3010 shown in FIG. 3 is an example of a search query using SQL, and searches the table “T1” that the value of the key “C1” is between “50” and “200”. It is required to select a row that satisfies the condition.
- the external storage device 1001 stores a table 6100, an index management table 7100, an index stage number management table 10000, and indexes 4100, 7112, and 7113.
- a plurality of tables may be provided.
- FIG. 4 is a diagram illustrating an example of a configuration of a table according to the embodiment.
- Table 6100 stores a plurality of rows (records) having row ID 6101 and row content 6102.
- the row ID 6101 stores an ID that uniquely identifies a row in the table 6100.
- the line content 6102 includes a plurality of items (6102, 6103, 6104,). Each item stores a value corresponding to the item.
- the table 6100 whose table name is “T1” shown in FIG. 4 has items such as C1, C2, C3,. C1, C2, and C3 can be used as search keys, for example, alone or in combination.
- FIG. 5 is a diagram illustrating an example of an index configuration according to the embodiment.
- FIG. 6 is a diagram illustrating an example of a configuration of an index node according to the embodiment.
- the index (4100, etc.) is configured in a tree structure by a plurality of nodes (pages) 9100. Therefore, in the index (such as 4100), each node 9100 is divided into a root node that is the highest node, a leaf node that is the lowest node, and an intermediate node between the root node and the leaf node. .
- the index node has three levels and the intermediate node has one level. However, the number of node levels may be more than three, and in that case, two or more levels may be used. An intermediate node exists in the stage.
- the node 9100 includes header part consistency confirmation information 9101, previous page number 9102, subsequent page number 9103, entry 9104, index stage number 9105, own page number 9106, and footer part matching. Sex confirmation information 9107.
- the header part consistency confirmation information 9101 stores a value that is uniquely determined when updating the page that is the node, such as time data.
- the value stored in the header part consistency check information 9101 is the same as the value stored in the footer part consistency check information 9107 if the node is updated normally.
- the previous page number 9102 stores the page number of the node (previous page) immediately before the corresponding node in the same hierarchy. If the corresponding node is the head in the hierarchy, a null value is stored.
- the subsequent page number 9103 stores the page number of the node (following page) immediately after the corresponding node in the same hierarchy. If the corresponding node is the last in the hierarchy, a null value is stored.
- the index is arranged in order from the node that manages the entry with the smaller key value, and the previous page manages the entry with the smaller key value than the page, and , An entry having a key value larger than that of the page is managed.
- the entry 9104 When the node is a root node or an intermediate node, the entry 9104 includes a number indicating the entry (entry number (entry #)) and a node (lower node) in a hierarchy directly below the node. The page number and the maximum value of the key value managed by the corresponding lower node are stored in association with each other. Further, when the node is a leaf node, the entry 9104 stores an entry #, a key value, and an ID (row ID) of a row of the table 6100 having the corresponding key value in association with each other. One or more entries 9104 can be provided in the node 9100. In this embodiment, the entries 9104 are arranged in ascending order based on the maximum key value.
- the index stage number 9105 stores the stage number of the hierarchy of the corresponding node in the index 4100.
- the number of stages of leaf nodes is 1, and the number of stages of nodes in a higher hierarchy is 2, 3,.
- the own page number 9106 stores the page number of the node.
- the footer unit consistency confirmation information 9107 stores a value uniquely determined when the page as the node is updated, such as time data. If the node is updated normally, the value is the same as the value stored in the header part consistency confirmation information 9101.
- a node 9100 illustrated in FIG. 6 indicates the last (right end) node of the second stage in the index illustrated in FIG. 5.
- the previous page number 9102 indicates the page number of the previous page “# 8 ”is stored, and the back page number 9103 has no back page, so a null value is set.
- the entry 9104 is the page number“ # 4 ”and the maximum key value of the node of the page number.
- the entry # associated with “130” is the entry # associated with “0006”, the page number “# 3”, and “160”, which is the maximum key value of the node of the page number.
- the entry # associated with the entry “0007”, the page number “# 9”, and “200” which is the maximum key value of the node of the page number is “0008”. There are a entry, the index number, stores '2', the relevant page numbers, "# 5" are stored.
- FIG. 7 is a diagram showing an example of the index stage number management table according to the embodiment.
- the index stage number management table 10000 is provided corresponding to each index.
- the index stage number management table 10000 includes a stage number 10001 and a page number (#) 10002.
- the number of stages 10001 stores the number of stages of each stage included in the corresponding index.
- the number of leaf nodes is 1.
- the page # 10002 stores the page number of the node (page) having the smallest managed key value at the corresponding stage node. According to the index stage number management table 10000, the head node in each stage can be specified.
- the index stage number management table 10000 shown in the figure is an index stage number management table 10000 corresponding to the index “IDX1” having the configuration shown in FIG. 5.
- the maximum number of key values managed by page # 1 is shown. The value is the smallest, the maximum value of the key value managed by page # 8 is the smallest in the second row, and the maximum value of the key value managed by page # 2 is the smallest in the first row. It is shown that.
- FIG. 8 is a diagram showing an example of the index management table according to the embodiment.
- the index management table 7100 manages a record having a table name 7101, an index name 7102, and a configuration column 7103.
- the table name 7101 stores the name (table name) of the table 6100 targeted by the index.
- the index name 7102 stores the name of the corresponding index (index name).
- the configuration column 7103 stores a column (item) constituting the corresponding index, that is, the index target.
- the configuration column 7103 may store a plurality of columns.
- the top record of the index management table 7100 indicates that the index 4100 of “IDX1” in the table 6100 of “T1” is composed of the item “C1”.
- the second record indicates that the index 7113 of “IDX3” in the table 6100 of “T1” is composed of items “C1” and “C3”.
- the server apparatus 2100 includes an interface 2101, a CPU 2102, and a memory 2103.
- the interface 2101, the CPU 2102, and the memory 2103 are connected via an internal bus 2104.
- the interface 2101 controls communication with the terminal device 2150.
- the CPU 2102 executes various processes by executing programs stored in the memory 2103.
- the memory 2103 stores a program executed by the CPU 2102 and data used by the CPU 2102. Specifically, the memory 2103 stores a database management system (DBMS) 2110.
- the database management system 2110 stores a query reception unit 2111 and an index detection unit 2112 as program modules.
- the query reception unit 2111 receives the search query 3010 transmitted from the terminal device 2150.
- the query receiving unit 2111 creates an execution procedure including a search condition for executing the search included in the received search query 3010.
- the index search unit 2112 includes a node reference detection unit 2113, an entry reference detection unit 2114, an unreferenceable part specifying unit 2115, and an alternative search program selection unit 2116.
- the node reference detection unit 2113 detects the exclusion in units of nodes for the index or the impossibility of reference due to logical destruction.
- the entry reference detection unit 2114 detects an exclusion in units of entries in a node or an impossibility of reference due to logical destruction for an index.
- the unreferenceable part specifying unit 2115 specifies a range of key values of parts that cannot be referred to due to logical destruction of indexes.
- the alternative search program selection unit 2116 selects an alternative search program that executes a search for a key value range that cannot be referred to by an index.
- the database management system 2110 stores a search program information management queue 8100 and a reference impossible node management information 11000 as data.
- the search program information management queue 8100 stores search program information used at the time of search.
- the unreferenceable node management information 11000 stores information related to unreferenceable nodes.
- FIG. 9A is a diagram illustrating an example of a configuration of search program information according to the embodiment.
- FIG. 9B is a diagram illustrating a first example of search program information according to the embodiment.
- FIG. 9C is a diagram illustrating a second example of search program information according to the embodiment.
- FIG. 9D is a diagram illustrating a third example of search program information according to the embodiment.
- FIG. 9E is a diagram illustrating a fourth example of search program information according to the embodiment.
- FIG. 9F is a diagram illustrating an example of a search program information management queue according to the embodiment.
- the search program information 8110 includes a search program ID 8111, a first area 8112, and a second area 8113, as shown in FIG. 9A.
- the search program ID 8111 stores the ID of the search program or the alternative search program.
- the first area 8112 and the second area 8113 store various types of information as shown in FIGS. 9B to 9E according to the type of the search program information 8110.
- the first area 8112 stores the number of the entry (original entry) for starting the search.
- the second area 8113 stores the number of the parent entry that is the parent of the original entry.
- the search program ID 8111 stores an ID indicating the alternative search program.
- the first area 8112 stores the number of the entry (original entry) for starting the search.
- the second area 8113 stores the number of the parent entry that is the parent of the original entry. When the parent entry cannot be referred to, the second area 8113 stores the number of the entry that refers to the parent entry. For example, in the case where the original entry is entry # 0018 shown in FIG. 5 and node # 5 cannot be referred to, entry # 0002 that refers to node # 5 that cannot be referred to is stored in second area 8113. Stored.
- the search program information 8110 for performing an alternative search using an alternative index stores an ID indicating the alternative search program in the search program ID 8111.
- the first area 8112 stores the root node number (#) of the alternative index used for the search.
- the second area 8113 stores a flag (alternative index use flag) indicating that the alternative index is used.
- the search program information 8110 for performing an alternative search using a table stores an ID indicating an alternative search program in the search program ID 8111.
- the first area 8112 stores the head data page number (#) of the table.
- the second area 8113 stores a flag (table scan flag) indicating that a table scan is performed.
- the search program information management queue 8100 can store one or more search program information 8110 as shown in FIG. 9F.
- the search program information 8110 stored in the search program information management queue 8100 is extracted and executed one by one by the index search unit 2120.
- FIG. 10 is a diagram illustrating an example of the configuration of the unreferenceable node management information according to the embodiment.
- the non-referenceable node management information 11000 stores a non-referenceable node search range 11001, a non-referenceable node node type 11002, and a previous entry number (#) 11003.
- the unreferenceable node search range 11001 includes a key value minimum value 11001a and a key value maximum value 11001b.
- the key value minimum value 11001a stores the minimum value of the key value that is a search range by a node that cannot be referred to (a node that cannot be referred to).
- the key value maximum value 11001b stores the maximum value of the key value that is the search range by the unreferenceable node.
- a null value is stored in the key value minimum value 11001a and the key value maximum value 11001b.
- the unreferenceable node node type 11002 stores the node type of the non-referenceable node.
- the node type is one of a root node, an intermediate node, and a leaf node.
- the previous entry number (#) 11003 stores the number of the previous entry (previous entry) in the node (parent node) including the unreferenceable node as an entry.
- the previous entry is an entry of the immediately preceding node having a key value smaller than the key value set as the range of the non-referenceable node. If there is no previous entry, a null value is stored.
- the non-referenceable node management information 11000 has “100” in the key value minimum value 11001a as shown in FIG. “200” is stored in the key value maximum value 11001b, “intermediate node” is stored in the unreferenceable node node type 11002, and “# 0001” is stored in the previous entry # 11003.
- FIG. 11 is a flowchart of the index search process according to the embodiment.
- the index search process (step S100) is realized by the CPU 2102 executing the index search unit 2112.
- the CPU 2102 receives a search request from the query reception unit 2111 (step S101), and determines whether or not it is the first search for the search request, that is, whether or not the result has been returned even once (step S102). ).
- step S102 if it is the first search (Yes in step S102), the CPU 2102 advances the process to step S105. If it is not the first search (No in step S102), the CPU 2102 starts from the search program information management queue 8100. An attempt is made to acquire the search program information 8110 (step S103).
- the CPU 2102 determines whether or not the search program information 8110 is exhausted in the search program information management queue 8100 (step S104). As a result, if the search program information is exhausted (Yes in step S104), it means that the search process corresponding to the search request has been completed, and thus the CPU 2102 ends the process while the search program information 8110 is finished. Is not depleted (No in step S104), the process proceeds to step S105.
- step S105 the CPU 2102 moves to the root node in the case of the first search (Yes in step S102), and moves to the node specified in the search program information 8110 when the search program information 8110 is acquired. . If an alternative index use flag is set in the search program information 8110, the CPU 2102 uses the alternative index to perform a search, focusing on the key value of the search condition. For example, the CPU 2102 executes a search using the alternative index, with the key value range of the reference impossible node search range 11001 of the reference impossible node management information 11000 as the search range.
- the CPU 2102 executes a node reference detection process for detecting a reference state with respect to the target node (step S200).
- step S106 determines whether or not reference failure has been detected. If no reference failure has been detected (No in step S106), the CPU 2102 The first entry is stored as the current position (S115), and if there is another entry in the node (S116: Yes), the loop processing from step S107 to step S111 is executed while the entry satisfying the search condition exists. To do.
- the CPU 2102 acquires one entry that satisfies the search condition in the target node (step S108), and executes entry reference detection processing for detecting the reference state for the entry (step S400).
- the CPU 2102 determines a search ID, stores the search entry including the search ID, and stores the entry # of the acquired entry in the first area 8112.
- the search program information 8110 having the original entry stored in the second area 8113 is created and registered in the search program information management queue 8100 (step S110), and the process proceeds to step S111.
- step S106 when the reference failure is detected for the node (Yes in step S106) or the reference failure is detected for the entry (Yes in step S109), the CPU 2102 executes a reference impossible location specifying process (step S600), An alternative search program selection process is executed (step S700), and the process proceeds to step S102.
- step S112 determines whether or not the target node is a leaf node (step S112) and is not a leaf node. In the case (No in step S112), the process proceeds to step S102 to continue another search process, while in the case of a leaf node (Yes in step S112), a row ID satisfying the search condition is acquired. (Step S113), and the process proceeds to step S102.
- search program information 8110 for searching for leaf node # 4 shown in FIG. 5 (entry # 0002 includes entry # 0006 in first area 8112 and entry # 0002 in second area 8113).
- the search condition is (50 ⁇ key (C1) ⁇ 200)
- the first area 8112 includes entries # 0019 and # 0020 in step S110 shown in FIG.
- Two pieces of search program information are created and registered in the search program information management queue 8100.
- step S113 a row ID corresponding to the entry # 0018 is acquired, and the row ID is returned as a part of the search result.
- FIG. 12 is a flowchart of node reference detection processing according to the embodiment.
- the node reference detection process (step S200) is realized by the CPU 2102 executing the node reference detection unit 2113.
- the CPU 2102 confirms whether or not the target node is exclusive (step S201), and further, the value of the header part consistency check information 9101 of the target node 9100 and the footer part match Depending on whether or not the value of the property confirmation information 9107 matches, it is confirmed whether or not logical consistency is achieved, in other words, whether or not logical destruction has occurred (step S202).
- the CPU 2102 determines whether or not reference is not possible because the target node is exclusive or logically broken (step S203). As a result of the determination, when reference is impossible (Yes in step S203), reference impossible detection is set as a return code (step S204), and the process ends. On the other hand, when reference is not possible (No in step S203), The process is terminated as it is.
- FIG. 13 is a flowchart of entry reference detection processing according to the embodiment.
- the entry reference detection process (step S400) is realized by the CPU 2102 executing the entry reference detection unit 2114.
- the CPU 2102 checks whether or not the target entry is exclusive (step S401), and whether or not the key value of the target entry is logically consistent. In other words, it is confirmed whether or not logic breakdown has occurred (step S402). In this embodiment, it is confirmed whether or not the key value of the target entry 9104 is larger than the key value of the previous entry in the node and smaller than the key value of the subsequent entry.
- the CPU 2102 determines whether or not the target node is a leaf node (step S403). If it is not a leaf node (No in step S403), the consistency of the page number of the lower node of the entry is confirmed. (Step S404). Specifically, the CPU 2102 confirms whether or not the page number in the entry 9104 matches the page number of the own page number 9106 of the lower node 9100 connected to the entry 9104 with a pointer.
- step S403 the consistency of the entry row ID is confirmed (step S405). Specifically, the CPU 2102 checks whether or not the row ID in the entry 9104 matches the row ID 6101 of the row of the table 6100 connected to the entry 9104 with a pointer.
- the CPU 2102 determines whether or not the target entry cannot be referred to because exclusion or logical destruction has occurred (step S406). As a result of the determination, if reference is impossible (Yes in step 406), reference impossible detection is set as a return code (step S407), and the process ends. On the other hand, if reference is not possible (No in step S406), The process is terminated as it is.
- FIG. 14 is a flowchart of the unreferenceable part specifying process according to the embodiment.
- the non-referenceable part specifying process (step S600) is realized by the CPU 2102 executing the non-referenceable part specifying unit 2115.
- the CPU 2102 obtains the node type of the target node based on the index stage number 9105 of the node 9100 and the index stage number management table 10000 and registers it in the unreferenceable node management information 11000 (step S601). ).
- the CPU 2102 determines whether or not the original entry of the search program information 8110 exists in the search program information 8110 at the target node (step S602). As a result, when the original entry does not exist (No in step S602), it means that the node is a root node, and thus the CPU 2102 indicates that the key value minimum value 11001a of the unreferenceable node management information 11000, A null value is registered in the key value maximum value 11001b (step S612), and the process ends.
- the original entry may be set in the search program information that is created when the search program information is created.
- step S602 when the original entry exists (Yes in step S602), the CPU 2102 registers the key value of the original entry in the key value maximum value 11001b of the unreferenceable node management information 11000 (step S603). It is determined whether or not a previous entry exists (step S604).
- step S604 if there is a previous entry (Yes in step S604), the CPU 2102 registers the key value of the previous entry in the minimum key value 11001b of the unreferenceable node management information 11000 (step S605). Is registered in the previous entry # 11003 of the unreferenceable node management information 11000 (step S606), and the process ends.
- the CPU 2102 further determines whether or not a parent entry for the original entry exists in the search program information (step S607), and no parent entry exists. In the case (No in step S607), a null value is registered in the key value minimum value 11001a of the reference impossible node management information 11000 (step S608), and the process is terminated.
- the parent entry may be set in the search program information that is created when the search program information is created.
- step S607 the CPU 2102 determines whether there is a previous entry for the parent entry (step S609), and if there is no previous entry for the parent entry (step S609).
- step S609 the null value is registered in the key value minimum value 11001a of the unreferenceable node management information 11000 (step S608), and the process ends.
- step S609 if there is a previous entry for the parent entry (Yes in step S609), the key value of the previous entry is registered in the minimum key value 11001a of the unreferenceable node management information 11000 (step S610), and the previous entry for the parent entry is registered.
- the entry number of the entry is registered in the previous entry # 11003 of the unreferenceable node management information 11000 (step S611), and the process ends.
- the key value range in each node can be appropriately stored in the unreferenceable node management information 11000.
- FIG. 15 is a flowchart of an example of an alternative search program selection process according to the embodiment.
- FIGS. 16A to 16C are referred to as appropriate.
- FIG. 16A is a diagram illustrating a first specific example of search program information according to the embodiment.
- FIG. 16B is a diagram illustrating a second specific example of search program information according to the embodiment.
- FIG. 16C is a diagram illustrating a third specific example of search program information according to the embodiment.
- the alternative search program selection process (step S700) is realized by the CPU 2102 executing the alternative search program selection unit 2116.
- the CPU 2102 obtains the node type and node search range (key value range) from the unreferenceable node management information 11000 (step S701), and whether or not the node type of the target node is a leaf node. Is determined (step S702).
- step S702 if the target node is a leaf node (Yes in step S702), the CPU 2102 searches the index management table 7100 for an index that includes the same component column as the index as an alternative index (step S703). It is determined whether or not there is an index (step S704).
- search program information 8110 for searching for a key value range similar to that of the unreferenceable node is created from the alternative index (step S705), and the process proceeds to step S707. .
- the search program information 8110 created in step S705 is as shown in FIG.
- the alternative search program ID is included in the program ID 8111, the page number of the root node of the alternative index is included in the first area 8112, and the flag indicating the use of the alternative index is included in the second area 8113.
- the index search unit 2120 acquires such search program information 8110, a search process is executed using a part of another existing index, so that the search can be performed quickly.
- search program information for searching for the same key value range as the unreferenceable node is created from the table 6100 (step S706), and the process proceeds to step S707. Proceed.
- the search program information 8110 created in step S706 includes the alternative search program ID in the program ID 8111, the page number with the head of the table 6100 in the first area 8112, and scans the table.
- the second area 8113 includes a flag to indicate.
- the index search unit 2120 obtains such search program information 8110, the search for the table 6100 is limited to the same key value range as that of the node that cannot be referred to. Thus, the search processing time and load can be reduced. Note that the key value range of the unreferenceable node can be acquired from the unreferenceable node management information 11000.
- step S707 the created search program information 8110 is registered in the search program information management queue 8100, and the process ends.
- the CPU 2102 determines whether or not the target node is a root node (step S708). If the target node is the root node (Yes in step S708), the CPU 2102 moves to a lower node based on the index stage number management table 10000 (step S709), and executes node reference detection processing (step S200). ). On the other hand, if the target node is not the root node (No in step S708), the CPU 2102 moves to a lower node based on the index stage number management table 10000 or the previous entry (step S710), and performs node reference detection processing. Execute (Step S200).
- the subordinate nodes mean all nodes indicated by entries of the target node.
- the method of moving to a lower node is to specify the entry (entry # 0001) before the original entry (entry # 0002) of node # 5.
- the node moves to the node # 8 based on the last entry of the node # 8 (entry # 0005), and moves to the node # 6 based on the subsequent page #
- the node moves to node # 4, that is, the first node (node immediately below) of the nodes lower than node # 5.
- step S711 determines whether or not reference is detected based on the result of the node reference detection process (step S711). If the reference is not detected (No in step S711), reference is not possible.
- the loop processing of step S711 to step S716 is executed for the number of entries within the range of the key value of the node.
- step S711 to step S716 are executed for the entry of the lower node of the target node. For example, when node # 1 which is the root node shown in FIG. 5 cannot be referred to, entries of node # 8 and node # 5 are targeted, and when node # 5 cannot be referred to, node # 4 and node # 4 The entries of # 3 and node # 9 are targeted. *
- the CPU 2102 acquires one target entry and executes an entry reference detection process for detecting the reference state for the entry (step S400).
- the CPU 2102 determines whether or not the key value matches the search condition (step S714), and if the key value matches the search condition.
- the search ID is determined, search program information 8110 including the search ID and storing the entry # of the entry in the first area 8112 is created and registered in the search program information management queue 8100 (step S715).
- the process proceeds to step S716.
- search program information 8110 for searching for all entries satisfying the search condition that is, the entries # 0018 to 0026 # is created.
- step S711 when the reference failure is detected for the node (Yes in step S711) or the reference failure is detected for the entry (Yes in step S713), the CPU 2102 executes the reference impossible location specifying process (step S600), An alternative search program selection process is executed (step S700), and the process ends.
- the CPU 2102 determines whether the target node is a leaf node (step S111), the process is terminated. By this processing, it becomes possible to appropriately execute the search for the search range by the non-referenceable node.
- the index is searched from the one with the smaller key value.
- the index may be searched from the one with the larger key value.
- each node manages the minimum value of the key value of each node as an entry of each lower node, and in the same stage, the node that manages the large key value becomes the previous node.
- the page number for managing the maximum value of the key value of each stage may be managed.
- the non-referenceable node is an intermediate node
- the lower node of the non-referenceable node may be specified by tracing an adjacent node that manages a key value larger than that of the non-referenceable node. .
- retrieval program information is extracted one by one and sequentially executed.
- the present invention is not limited to this.
- a plurality of retrieval program information is retrieved and a search based on each retrieval program information is performed. May be executed in parallel.
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)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
代替検索プログラムIDをプログラムID8111に含み、代替インデクスのルートノードのページ番号を第1領域8112に含み、代替インデクス使用を示すフラグを第2領域8113に含む。
次いで、CPU2102は、参照不可を検知していない場合(ステップS713でNo)には、キー値が検索条件に合致しているか否かを判定し(ステップS714)、検索条件に合致している場合には、検索IDを決定し、当該検索IDを含み、当該エントリのエントリ#を第1領域8112に格納した検索プログラム情報8110を作成し、検索プログラム情報管理キュー8100に登録し(ステップS715)、ステップS716に進む。
Claims (15)
- 記憶デバイスに対するインタフェースと、
前記インタフェースを通じて前記記憶デバイスにアクセスする制御デバイスと
を有し、
前記記憶デバイスが、複数の項目の値を有する行を複数管理する表と、1以上の前記項目の値により前記行を特定可能にするための複数のノードを含む木構造で構成されたインデクスとを記憶し、
前記制御デバイスは、
前記表に対する検索クエリの検索条件に含まれる項目値条件を特定し、
前記項目値条件に対応する前記インデクスの前記ノードが参照不可であるか否かを判定し、
前記ノードが参照不可である場合に、前記参照不可のノードが管理する項目値の範囲を特定し、特定した前記範囲に対して前記検索条件を満たす行を検索する
データベースシステム。 - 前記制御デバイスは、
前記参照不可のノードが、前記インデクスにおける中間ノードである場合に、前記ノードと同じ段における直前のノードが管理する項目値に基づいて、前記参照不可のノードが管理する項目値の範囲を特定する
請求項1に記載のデータベースシステム。 - 前記制御デバイスは、
前記参照不可のノードが、前記インデクスにおける中間ノードである場合に、前記参照不可のノードの下位のノードを特定し、
前記下位のノードを用いて、前記特定した前記範囲に対して前記検索条件を満たす行を検索する
請求項2に記載のデータベースシステム。 - 前記記憶デバイスは、前記インデクスの各段における先頭のノードのノード番号を含む段数管理情報を記憶し、
前記制御デバイスは、
前記参照不可のノードが、前記インデクスにおける中間ノードである場合に、前記参照不可のノードの上位のノードの、前記参照不可のノードの直前のノードのエントリがあれば、当該エントリに従って前記直前のノードを経由して下位のノードを特定し、
前記参照不可のノードの直前のノードのエントリがなければ、前記段数管理情報に基づいて、下位の段のノードを特定し、特定したノードを経由して下位のノードを特定する
請求項3に記載のデータベースシステム。 - 前記制御デバイスは、
前記参照不可のノードが、ルートノードである場合に、前記段数管理情報に基づいて、下位の最前のノードを特定し、特定したノード及び当該ノードから接続された各ノードを用いて、前記検索条件を満たす行を検索する
請求項1に記載のデータベースシステム。 - 前記記憶デバイスは、前記インデクスが対象とする1以上の前記項目を含む複数項目について対象とする他のインデクスを記憶し、
前記制御デバイスは、
前記参照不可のノードが、リーフノードである場合に、前記他のインデクスに基づいて、前記参照不可のノードと同じ項目値の範囲を検索する
請求項1に記載のデータベースシステム。 - 前記ノードは、ヘッダと、フッタとに、整合性確認用の情報を格納するように管理されており、
前記制御デバイスは、
前記ノードの前記ヘッダの整合性確認用の情報と、前記フッタの整合性確認用の情報とに基づいて、当該ノードが参照不可か否かを判定する
請求項1に記載のデータベースシステム。 - 前記ノードに排他がかけられているか否かに基づいて、当該ノードが参照不可か否かを判定する
請求項1に記載のデータベースシステム。 - 前記ノードは、当該ノードに接続される下位のノードのページ番号又は、当該ノードに接続される行を示す行IDと、項目の値とを含む1以上のエントリを、前記エントリの前記項目の値に従って並べて格納し、
前記制御デバイスは、
前記ノードの前記エントリが前記項目の値に従って並んでいるか否かに基づいて、当該ノードが参照不可であるか否かを判定する
請求項1に記載のデータベースシステム。 - 前記ノードは、前記下位のノード又は前記接続されている行に対するポインタが設けられており、
前記制御デバイスは、
前記ポインタにより対応付けられているノードのページ番号又は行の行IDと、前記ノードが格納しているページ番号又は行IDとが一致しているか否かにより、前記ノードが参照不可であるか否かを判定する
請求項1に記載のデータベースシステム。 - 前記制御デバイスは、前記ポインタにより対応付けられている前記ノードに排他がかけられているか否かに基づいて、当該ノードが参照不可か否かを判定する
請求項1に記載のデータベースシステム。 - 検索対象とするノード又は行を示す1以上の検索プログラム情報を格納可能な検索プログラム情報キューを有し、
前記制御デバイスは、前記検索プログラム情報キューから逐次前記検索プログラム情報を取得し、
前記取得した検索プログラム情報が示す前記ノードが参照不可であるか否かを判定し、
前記ノードから参照不可でなく、且つ検索条件に該当するエントリを検出した場合に、当該エントリを検索対象とするための検索プログラム情報を出力して、前記検索プログラム情報キューに登録する
請求項1に記載のデータベースシステム。 - 前記制御デバイスは、
前記参照不可のノードの下位のノードから、参照不可でなく、且つ検索条件に該当するエントリを検出した場合に、当該エントリを検索対象とするための検索プログラム情報を出力して、前記検索プログラム情報キューに登録する
請求項12に記載のデータベースシステム。 - 前記制御デバイスは、
複数の前記検索プログラム情報に基づいた処理を並行して実行する
請求項12に記載のデータベースシステム。 - 複数の項目の値を有する行を複数管理する表と、1以上の前記項目の値により前記行を特定可能にするための複数のノードを含む木構造で構成されたインデクスとを記憶する記憶デバイスにおけるインデクスを用いて前記表を検索するデータベース管理方法であって、
前記表に対する検索クエリの検索条件に含まれる項目値条件を特定し、
前記項目値条件に対応する前記インデクスの前記ノードが参照不可であるか否かを判定し、
前記ノードが参照不可である場合に、前記参照不可のノードが管理する項目値の範囲を特定し、特定した前記範囲に対して前記検索条件を満たす行を検索する
データベース管理方法。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US14/369,029 US9703829B2 (en) | 2011-12-26 | 2011-12-26 | Database system and database management method |
PCT/JP2011/080077 WO2013098918A1 (ja) | 2011-12-26 | 2011-12-26 | データベースシステム及びデータベース管理方法 |
JP2013551059A JP5731015B2 (ja) | 2011-12-26 | 2011-12-26 | データベースシステム及びデータベース管理方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2011/080077 WO2013098918A1 (ja) | 2011-12-26 | 2011-12-26 | データベースシステム及びデータベース管理方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013098918A1 true WO2013098918A1 (ja) | 2013-07-04 |
Family
ID=48696488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2011/080077 WO2013098918A1 (ja) | 2011-12-26 | 2011-12-26 | データベースシステム及びデータベース管理方法 |
Country Status (3)
Country | Link |
---|---|
US (1) | US9703829B2 (ja) |
JP (1) | JP5731015B2 (ja) |
WO (1) | WO2013098918A1 (ja) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5960798B2 (ja) * | 2012-03-08 | 2016-08-02 | 株式会社Murakumo | データベースの管理方法 |
US20160154851A1 (en) * | 2013-04-24 | 2016-06-02 | Hitachi Ltd. | Computing device, storage medium, and data search method |
US9892158B2 (en) * | 2014-01-31 | 2018-02-13 | International Business Machines Corporation | Dynamically adjust duplicate skipping method for increased performance |
US11294961B2 (en) * | 2017-05-19 | 2022-04-05 | Kanagawa University | Information search apparatus, search program, database update method, database update apparatus and database update program, for searching a specified search target item associated with specified relation item |
CN110866003B (zh) * | 2018-08-27 | 2023-09-26 | 阿里云计算有限公司 | 索引值数目的估算方法和装置以及电子设备 |
CN111488370B (zh) * | 2020-04-02 | 2023-09-12 | 杭州迪普科技股份有限公司 | 列表分页快速响应系统和方法 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63191226A (ja) * | 1987-02-03 | 1988-08-08 | Ricoh Co Ltd | B↑+tree上における同時実行制御方式 |
JP2004185617A (ja) * | 2002-12-02 | 2004-07-02 | Microsoft Corp | 左リンクを使用してツリーをトラバースするアルゴリズム |
JP2008065716A (ja) * | 2006-09-08 | 2008-03-21 | Ricoh Co Ltd | データ管理装置、データ管理方法及びデータ管理プログラム |
JP2009252148A (ja) * | 2008-04-10 | 2009-10-29 | Nippon Telegr & Teleph Corp <Ntt> | データベース自動修復装置及びその方法並びにデータベース自動修復プログラム |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6105025A (en) * | 1996-03-08 | 2000-08-15 | Oracle Corporation | Method for using an index as a workspace for deferred enforcement of uniqueness constraints |
US6859808B1 (en) * | 2001-05-31 | 2005-02-22 | Oracle International Corporation | Mapping logical row identifiers for primary B+tree-like structures to physical row identifiers |
US6772179B2 (en) * | 2001-12-28 | 2004-08-03 | Lucent Technologies Inc. | System and method for improving index performance through prefetching |
US7383276B2 (en) * | 2004-01-30 | 2008-06-03 | Microsoft Corporation | Concurrency control for B-trees with node deletion |
US7447233B2 (en) * | 2004-09-29 | 2008-11-04 | Intel Corporation | Packet aggregation protocol for advanced switching |
US7831624B2 (en) * | 2005-06-24 | 2010-11-09 | Seagate Technology Llc | Skip list with address related table structure |
US7702619B2 (en) * | 2005-09-23 | 2010-04-20 | Alan El-Sabbagh | Methods and systems for joining database tables using indexing data structures |
JP4445509B2 (ja) * | 2007-03-20 | 2010-04-07 | 株式会社東芝 | 構造化文書検索システム及びプログラム |
JP2009295013A (ja) * | 2008-06-06 | 2009-12-17 | Hitachi Ltd | データベース管理方法、データベース管理装置およびプログラム |
JP5339507B2 (ja) * | 2008-10-01 | 2013-11-13 | インターナショナル・ビジネス・マシーンズ・コーポレーション | 木構造を探索する方法 |
US8732139B2 (en) * | 2008-12-18 | 2014-05-20 | Sap Ag | Method and system for dynamically partitioning very large database indices on write-once tables |
US8676855B2 (en) * | 2009-05-01 | 2014-03-18 | Brother Kogyo Kabushiki Kaisha | Distributed storage system, management apparatus, node apparatus, recording medium on which node program is recorded, page information acquisition method, recording medium on which page information sending program is recorded, and page information sending method |
US8352488B2 (en) * | 2009-06-02 | 2013-01-08 | Saffron Technology, Inc. | Methods, systems and computer program products for providing a distributed associative memory base |
US8412708B2 (en) * | 2009-09-17 | 2013-04-02 | Los Alamos National Security, Llc | System and method for modeling and analyzing complex scenarios |
US9195657B2 (en) * | 2010-03-08 | 2015-11-24 | Microsoft Technology Licensing, Llc | Columnar storage of a database index |
-
2011
- 2011-12-26 US US14/369,029 patent/US9703829B2/en not_active Expired - Fee Related
- 2011-12-26 JP JP2013551059A patent/JP5731015B2/ja active Active
- 2011-12-26 WO PCT/JP2011/080077 patent/WO2013098918A1/ja active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63191226A (ja) * | 1987-02-03 | 1988-08-08 | Ricoh Co Ltd | B↑+tree上における同時実行制御方式 |
JP2004185617A (ja) * | 2002-12-02 | 2004-07-02 | Microsoft Corp | 左リンクを使用してツリーをトラバースするアルゴリズム |
JP2008065716A (ja) * | 2006-09-08 | 2008-03-21 | Ricoh Co Ltd | データ管理装置、データ管理方法及びデータ管理プログラム |
JP2009252148A (ja) * | 2008-04-10 | 2009-10-29 | Nippon Telegr & Teleph Corp <Ntt> | データベース自動修復装置及びその方法並びにデータベース自動修復プログラム |
Also Published As
Publication number | Publication date |
---|---|
JPWO2013098918A1 (ja) | 2015-04-30 |
US9703829B2 (en) | 2017-07-11 |
US20150066943A1 (en) | 2015-03-05 |
JP5731015B2 (ja) | 2015-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112559554B (zh) | 一种查询语句优化方法及装置 | |
US12032576B2 (en) | Joining large database tables | |
JP5731015B2 (ja) | データベースシステム及びデータベース管理方法 | |
US8332366B2 (en) | System and method for automatic weight generation for probabilistic matching | |
CN110325985B (zh) | 使用对高速缓存友好的存储器内散列索引的原子rdma读取的基于主键的高效查询的方法 | |
US9934289B2 (en) | Fuzzy full text search | |
WO2010003061A1 (en) | Database systems and methods | |
US9454561B2 (en) | Method and a consistency checker for finding data inconsistencies in a data repository | |
JP2017526021A (ja) | データ検索におけるエラー修正装置及びその方法 | |
US8843499B2 (en) | Accelerating database queries comprising positional text conditions plus bitmap-based conditions | |
US9971793B2 (en) | Database management system and database management method | |
US8452757B2 (en) | Index mechanism for finding nearest matches in a computer system | |
CN116561154A (zh) | Sql语句优化方法及装置 | |
CN114840487A (zh) | 分布式文件系统的元数据管理方法和装置 | |
CN114625554A (zh) | 故障修复方法、装置、电子设备及存储介质 | |
US10318388B2 (en) | Datasets profiling tools, methods, and systems | |
CN111666302A (zh) | 用户排名的查询方法、装置、设备及存储介质 | |
CN110968267B (zh) | 数据管理方法、装置、服务器及系统 | |
CN110413617B (zh) | 一种根据数据量的大小动态调节哈希表组的方法 | |
CN113779955B (zh) | 一种差异脚本的生成方法、装置和存储介质 | |
US11301448B2 (en) | Method and system of a secondary index in a distributed data base system | |
JP5953262B2 (ja) | データ索引装置、データ索引方法及びプログラム | |
US10713305B1 (en) | Method and system for document search in structured document repositories | |
JP5953277B2 (ja) | データ索引装置、データ索引方法及びプログラム | |
CN118708611A (zh) | 基于llm实现数据库精准输出的系统及方法 |
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: 11878592 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2013551059 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
WWE | Wipo information: entry into national phase |
Ref document number: 14369029 Country of ref document: US |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 11878592 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 11878592 Country of ref document: EP Kind code of ref document: A1 |