WO2010125742A1 - インデックス更新データ作成装置、作成方法及びプログラム - Google Patents

インデックス更新データ作成装置、作成方法及びプログラム Download PDF

Info

Publication number
WO2010125742A1
WO2010125742A1 PCT/JP2010/002341 JP2010002341W WO2010125742A1 WO 2010125742 A1 WO2010125742 A1 WO 2010125742A1 JP 2010002341 W JP2010002341 W JP 2010002341W WO 2010125742 A1 WO2010125742 A1 WO 2010125742A1
Authority
WO
WIPO (PCT)
Prior art keywords
update
node
index
data
tree
Prior art date
Application number
PCT/JP2010/002341
Other languages
English (en)
French (fr)
Inventor
新庄敏男
國分光裕
Original Assignee
株式会社エスグランツ
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社エスグランツ filed Critical 株式会社エスグランツ
Publication of WO2010125742A1 publication Critical patent/WO2010125742A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures

Definitions

  • the present invention relates to update processing of a database index, and more particularly, to creation processing of index update data used for index update and index update processing using the index update data.
  • a data update function is essential. As the amount of data stored in the database increases, for example, if a large amount of data is added to or deleted from an existing database by batch processing, the time required for the operation increases. Yes.
  • the database batch update mode includes a differential update mode in which the database is updated with addition, change, or deletion data to the existing database, and a mode in which the existing database is completely replaced with a new database.
  • the database data supplier does not supply the database update data when the database needs to be updated, but supplies a new version of the database with updated data. It is adopted when doing.
  • the database update mode since the database cannot be used during the update operation, it is inconvenient if this update operation takes a long time.
  • a database is usually composed of a data portion of the database body and an index for retrieving data from the database body.
  • the database update mode includes a mode in which the index part is updated, and even in this part update, the entire index after the update is supplied and may be completely replaced with the index before the update.
  • the index data of the new map data purchased from the map data distributor can be updated from the car navigation system distributor or the car dealer center. It is distributed to each mounted car and the index data is updated for each mounted car navigation system. In this way, since the entire new index data is distributed, the amount of data to be distributed is large, and the update time of the map data in each car navigation system becomes long.
  • Patent Document 1 describes a difference update of map data used in a navigation terminal.
  • bit string search processing techniques are known. Among them, various attempts have been made to devise various data structures for storing bit strings in order to search bit strings at high speed.
  • One of such methods is a search method using a data structure called a coupled node tree described in Patent Documents 2 and 3 below.
  • the coupled node tree has a root node that is the starting point of the tree and a node pair as a component of the tree that is composed of two nodes arranged in adjacent storage areas.
  • the node has an area for storing a node type indicating whether the node is a branch node or a leaf node.
  • the branch node has an area for storing a discrimination bit position of a search key and a link destination. This includes an area for storing information indicating the position of a representative node that is one node of the node pair, but does not include an area for storing an index key composed of a bit string to be searched.
  • the leaf node includes an area for storing an index key including a bit string to be searched, but stores information indicating an area for storing a discrimination bit position of the search key and a position of a representative node of a link destination. It does not include the area.
  • any node in the above coupled node tree as a search start node, select a link destination according to the bit value of the search key located at the discrimination bit position of each branch node, and store in the leaf node by reaching the leaf node
  • the index key thus obtained is acquired as a search result key based on the search key.
  • the coupled node tree and search processing using the same will be further described.
  • the coupled node tree is stored in an array.
  • the data indicating the position of the representative node held by the branch node may be the address information of the storage device, but is composed of array elements that can store the larger storage capacity of the area occupied by the branch node or leaf node.
  • the position of the node can be represented by an array number, and the amount of information on the position information can be reduced.
  • FIG. 1 is a diagram for explaining a configuration example of a coupled node tree stored in an array.
  • the node 101 is arranged in the array element of the array element number 10 in the array 100.
  • the node 101 includes a node type 102, a discrimination bit position 103, and a representative node number 104.
  • the node type 102 is 0, indicating that the node 101 is a branch node. 1 is stored in the discrimination bit position 103.
  • the representative node number 104 stores the array element number 20 of the representative node of the link destination node pair.
  • the array element number stored in the representative node number may be referred to as a representative node number.
  • the array element number stored in the representative node number may be represented by a code attached to the node or a code attached to the node pair.
  • the node [0] 112 that is the representative node of the node pair 111 is stored in the array element of the array element number 20. Then, node [1] 113 paired with the representative node is stored in the next adjacent array element (array number 20 + 1). 0 is stored in the node type 114 of the node [0] 112, 3 is stored in the discrimination bit position 115, and 30 is stored in the representative node number 116. Further, 1 is stored in the node type 117 of the node [1] 113, indicating that the node [1] 113 is a leaf node.
  • the index key 118 stores “0001”. As described above for the Patricia tree, it is natural that the leaf node includes information for accessing the record corresponding to the index key, but the description is omitted.
  • a representative node may be represented by a node [0] and a node paired therewith may be represented by a node [1].
  • a node stored in an array element having a certain array number may be referred to as a node having the array number
  • an array number of the array element in which the node is stored may be referred to as a node array number.
  • the contents of the node pair 121 composed of the node 122 and the node 123 stored in the array elements of the array element numbers 30 and 31 are omitted.
  • the 0 or 1 added to the array elements stored in the node [0] 112, the node [1] 113, the node 122, and the node 123 are linked to either node of the node pair when searching with the search key. It shows what to do.
  • the search key bit value 0 or 1 at the discrimination bit position of the preceding branch node is linked to the node of the array element number obtained by adding the representative node number. Therefore, by adding the bit value of the discrimination bit position of the search key to the representative node number of the preceding branch node, the array element number of the array element storing the link destination node can be obtained.
  • the representative node number is the smaller of the array element numbers where the node pairs are arranged. However, it is obvious that the larger one can be adopted.
  • FIG. 2 is a diagram conceptually showing a tree structure of a coupled node tree.
  • a reference numeral 210a indicates a root node.
  • the root node 210a is a representative node of the node pair 201a arranged at the array element number 220.
  • a note pair 201b is arranged below the root node 210a
  • a node pair 201c and a node pair 201f are arranged below it
  • a node pair 201h and a node pair 201g are arranged below the node pair 201f.
  • a node pair 201d is disposed below the node pair 201c
  • a node pair 201e is disposed below the node pair 201d.
  • the code of 0 or 1 added before each node is the same as the code assigned before the array element described in FIG.
  • the tree is traversed according to the bit value of the discrimination bit position of the search key, and the leaf node to be searched is found.
  • the node type 260a of the root node 210a is 0, indicating that it is a branch node, and the discrimination bit position 230a indicates 0.
  • the representative node number is 220a, which is the array element number of the array element stored in the representative node 210b of the node pair 201b.
  • the node pair 201b is composed of nodes 210b and 211b, and their node types 260b and 261b are both 0, indicating that they are branch nodes. 1 is stored in the discrimination bit position 230b of the node 210b, and the array element number 220b of the array element stored in the representative node 210c of the node pair 201c is stored in the link representative node number.
  • this node is a leaf node and therefore includes an index key. “000111” is stored in the index key 250c.
  • the node type 261c of the node 211c is 0, the discrimination bit position 231c is 2, and the array element number 221c of the array element stored in the representative node 210d of the node pair 201d is stored in the representative node number.
  • the node type 260d of the node 210d is 0, the discrimination bit position 230d is 5, and the array number 220d of the array element in which the representative node 210e of the node pair 201e is stored is stored in the representative node number.
  • the node type 261d of the node 211d paired with the node 210d is 1, and “011010” is stored in the index key 251d.
  • the node types 260e and 261e of the nodes 210e and 211e of the node pair 201e are both 1, indicating that both are leaf nodes. “010010” and “010011” are stored as index keys in the index keys 250e and 251e, respectively. Has been.
  • the node types 260f and 261f of the nodes 210f and 211f of the node pair 201f are both 0, and both are branch nodes. 5 and 3 are stored in the discrimination bit positions 230f and 231f, respectively.
  • the representative node number of the node 210f stores the array element number 220f of the array element in which the representative node 210g of the node pair 201g is stored, and the representative node number of the node 211f contains the node [0] 210h that is the representative node of the node pair 201h.
  • the array element number 221f of the stored array element is stored.
  • the node types 260g and 261g of the nodes 210g and 211g of the node pair 201g are both 1, indicating that both are leaf nodes, and “100010” and “1000011” are stored in the respective index keys 250g and 251g. .
  • the node type 260h and 261h of the node [0] 210h which is the representative node of the node pair 201h, and the node [1] 211h that is paired with the node [0] 210h are both 1, indicating that both are leaf nodes. In “250h” and “251h”, “101011” and “101100” are stored.
  • the flow of processing for searching for the index key “100010” from the above tree will be briefly described below.
  • the discrimination bit positions are 0, 1, 2,... From the left.
  • processing is started from the root node 210a using the bit string “100010” as a search key. Since the discrimination bit position 230a of the root node 210a is 0, it is 1 when the bit value of the discrimination bit position of the search key “100010” is 0 is seen. Therefore, the node 211b stored in the array element having the array element number obtained by adding 1 to the array element number 220a storing the representative node number is linked.
  • the discrimination bit position of the search key “100010” is 0 when the bit value of 2 is viewed, and therefore the array number 221b in which the representative node number is stored is Link to the node 210f stored in the array element.
  • node type 260g of the node 210g is 1, indicating that it is a leaf node, when the index key 250g is read and compared with the search key, both are “100010” and match. In this way, a search using a coupled node tree is performed.
  • the configuration of a coupled node tree is defined by a set of index keys.
  • the discrimination bit position of the root node 210a is 0 because the index keys illustrated in FIG.
  • the index key group whose 0th bit is 0 is classified under the node 210b, and the index key group whose 0th bit is 1 is classified under the node 211b.
  • the discrimination bit position of the node 211b is 2 because the 0th bit stored in the nodes 211h, 210h, 211g and 210g is all equal to 0 in the 1st bit of the index key, and is different for the first time in the 2nd bit. This reflects the nature of the set of index keys.
  • a case where the second bit is 1 is classified on the node 211f side, and a case where the second bit is 0 is classified on the node 210f side.
  • the third bit is different, so 3 is stored in the discrimination bit position of the node 211f, and in the index key whose second bit is 0, the third bit is also the fourth bit. Since the fifth bit is equally different, 5 is stored in the discrimination bit position of the node 210f.
  • the nodes 210h and 211h are leaf nodes, and “101011” and “101100” are assigned to the index keys 250h and 251h, respectively. "Is stored. Even if “101101” or “101110” is included in the set of index keys instead of “101100”, since the third bit is equal to “101100”, only the index key stored in the node 211h changes. Thus, the tree structure itself does not change. However, if “101101” is included in addition to “101100”, the node 211h becomes a branch node, and its discrimination bit position is 5. If the index key to be added is “101110”, the discrimination bit position is 4.
  • the coupled node tree structure is determined by the bit value of each bit position of each index key included in the set of index keys. Furthermore, since the node branches to a node having a bit value “1” and a node having a bit value “0” for each bit position having a different bit value, the node [1] side and the depth of the tree When the leaf nodes are traced with priority given to the direction, the index keys stored in them are “101100” of the index key 251h of the node 211h, “101011” of the index key 250h of the node 210h,. The key 250c is “000111” and is sorted in descending order. That is, in the coupled node tree, the index keys are sorted and arranged on the tree.
  • the index key When searching with the search key, the index key follows the route arranged on the coupled node tree. For example, if the search key is “101100”, the node 211h can be reached. Further, as can be imagined from the above description, even when “101101” or “101110” is used as a search key, the node 211h is reached. By comparing with the index key 251h, it can be determined that the search has failed, or “101100” as the index key 251h can be used as the search result key.
  • the third and fourth bits of the search key are not used in the link paths of the nodes 210a, 211b, and 210f, and the fifth bit of “100100” is 0.
  • the node 210g is reached in the same manner as when searching for “100010”. In this way, branching is performed using the discrimination bit position corresponding to the bit configuration of the index key stored in the coupled node tree.
  • a temporary storage area corresponding to each process is used in order to use various values obtained during the process in a later process.
  • data stored in a certain data storage area is described with the data storage area code added, and the name of the data itself may be used as the name of a temporary storage area for storing the data.
  • FIG. 3 is a flowchart showing the basic operation of bit string search disclosed in Patent Document 3 below.
  • the array element number of the search start node is acquired.
  • the array corresponding to the acquired array element number stores arbitrary nodes constituting a coupled node tree.
  • the search start node may be specified by an input from an operator or by an application program that uses the process illustrated in FIG.
  • the obtained array number of the search start node is set in a search start node setting area (not shown).
  • This search start node setting area is used to set various values obtained in the middle of processing as described later. This is one of the “temporary storage areas corresponding to each process for use in the process”.
  • the expression “set in a search start node setting area (not shown) instead of the expression “set in a search start node setting area (not shown)”, “get the search start node array number”, “set as search start node” or simply “start search” It may also be described as “set to node”.
  • step S302 the obtained array element number is stored in the search path stack 310.
  • step S303 the array element corresponding to the array element number is read as a node to be referred to.
  • step S304 the node type is extracted from the read node, and in step S305, it is determined whether the node type is a branch node. If it is determined in step S305 that the read node is a branch node, the process proceeds to step S306, where information on the discrimination bit position is extracted from the node, and in step S307, a bit value corresponding to the extracted discrimination bit position is obtained. Retrieve from search key.
  • step S308 the representative node number is extracted from the node.
  • step S309 the bit value extracted from the search key and the representative node number are added, and the process returns to step S302 as a new array number.
  • step S310 the index key is extracted from the leaf node as a search result key, and the process ends.
  • the search path stack 310 since the coupled node tree is stored in the array, the search path stack 310 stores the array number. However, if the coupled node tree is not stored in the array, the array number is stored. Instead, information indicating the position of the link destination node is stored in the search path stack 310.
  • FIG. 4A is a diagram showing a processing flow of search processing that is the preceding stage of insertion processing, and corresponds to the search processing shown in FIG. 3 with the root node as the search start node and the insertion key as the search key.
  • step S401 the root node array number is set in the area for setting the search start node array number, and in step S402, the insertion key is set as the search key.
  • step S410 the search process shown in FIG. 3 is executed to obtain an index key as a search result, and the process proceeds to step S411.
  • step S411 the insertion key is compared with the index key. If they are equal, the insertion key already exists in the coupled node tree, so the insertion fails and the process ends. If not equal, the process proceeds to the next process, that is, the process of step S412 and subsequent steps in FIG. 4B.
  • FIG. 4B is a process flow diagram illustrating a process of preparing an array element for a node pair to be inserted.
  • step S412 an empty node pair is obtained from the array, and the array element number of the array element to be the representative node is acquired from the node pair.
  • step S413 the size of the insertion key and the index key obtained in step S410 are compared. When the insertion key is large, a value of 1 is obtained, and when the insertion key is small, a Boolean value of 0 is obtained. Proceeding to step S414, an array element number obtained by adding the Boolean value obtained at step S413 to the array element number of the representative node obtained at step S412 is obtained.
  • an array element number is obtained by adding the logical negation value of the Boolean value obtained at step S413 to the array element number of the representative node obtained at step S412.
  • the array element number obtained in step S414 is the array element number of the array element in which the leaf node having the insertion key as an index key is stored
  • the array element number obtained in step S415 is the branch node or leaf paired with that leaf node.
  • the size of the index key and the insertion key stored in the leaf node obtained in the previous search process determines which node of the inserted node pair stores the insertion key. Is done.
  • FIG. 4C is a diagram showing a processing flow in which nodes are stored in the array prepared in FIG. 4B, their insertion positions are obtained, the contents of existing nodes are changed, and insertion processing is completed.
  • the processing from step S416 to step S423 is processing for obtaining the position of the node pair to be inserted on the coupled node tree, and the processing after step S424 is processing for setting data in each node and completing the insertion processing. .
  • step S416 the bit string comparison between the insertion key and the index key obtained in step S410 is performed by, for example, exclusive OR, to obtain a difference bit string.
  • step S417 the bit position of the first non-matching bit viewed from the upper 0th bit is obtained from the difference bit string obtained in step S416.
  • a CPU having a priority encoder can input a difference bit string to obtain a mismatched bit position. It is also possible to obtain the bit position of the first non-matching bit by performing processing equivalent to that of the priority encoder in software.
  • step S418 it is determined whether the stack pointer of the search path stack points to the array element number of the root node. If so, the process proceeds to step S424. If not, the process proceeds to step S419.
  • step S419 the stack pointer of the search path stack is returned by 1, and the array element number stacked there is extracted. Proceeding to step S420, the array element having the array element number extracted at step S419 is read from the array as a node. Proceeding to step S421, the discrimination bit position is extracted from the node read out at step S420. Next, the process proceeds to step S422, and it is determined whether the discrimination bit position extracted in step S421 is higher than the bit position obtained in step S417.
  • the upper positional relationship is a position on the left side of the bit string, that is, a position where the value of the bit position is small.
  • step S422 If the determination result in step S422 is negative, the process returns to step S418, and is repeated until the determination in step S418 becomes affirmative or the determination in step S422 becomes affirmative. If the determination in step S422 becomes affirmative, the stack pointer of the route search stack is incremented by 1 in step S423, and the process proceeds to step S424 and subsequent steps.
  • the bit string comparison is performed between the index key to be inserted and the index key acquired by the search in order to determine the insertion position of the node pair to be inserted, Check the relative positional relationship between the first (most significant) bit position that is the value and the discrimination bit position of the branch node stored in the search path stack, and the branch node next to the branch node that has the higher discrimination bit position This is the insertion position of the node pair into which the link destination is inserted. Also, even if the route search stack is traced back to the root node, the discrimination bit position of the root node is not a higher bit position than the most significant bit position that becomes a different bit value in the previously obtained bit string comparison.
  • step S424 the array element number pointed to by the stack pointer is extracted from the search path stack.
  • step S425 1 (leaf node) is written in the node type of the array element indicated by the array element number obtained in step S414, and the insertion key is written in the index key.
  • step S426 the array element having the array element number obtained at step S424 is read from the array.
  • step S427 the contents read in step S426 are written in the array element having the array element number obtained in step S415.
  • step S428 0 (branch node) is obtained for the node type of the array element indicated by the array element number obtained in step S424, the bit position obtained in step S417 is obtained for the discrimination bit position, and the representative node number is obtained in step S412. Write the array element number and end the process.
  • FIG. 5 is an example of a processing flow for generating a coupled node tree disclosed in Patent Document 2 below.
  • a coupled node tree is generated by the root node insertion process and the normal insertion process.
  • step S501 it is determined whether the array element number of the root node of the coupled node tree requested to be acquired has been registered. If registered, the normal insertion process described with reference to FIGS. 4A to 4C is performed.
  • step S502 If the determination in step S501 is not registered, registration and generation of a completely new coupled node tree starts.
  • step S502 an empty node pair is obtained from the array, and the array element number of the array element to be the representative node is acquired from the node pair.
  • step S503 the array element number obtained by adding 0 to the array element number obtained in step S502 is obtained. (In actuality, it is equal to the array element number acquired in step S502).
  • step S504 1 (leaf node) is written in the node type of the root node to be inserted into the array element having the array element number obtained in step S503, and the insertion key is written in the index key.
  • step S505 the root node acquired in step S502 is written. The sequence number is registered and the process ends.
  • the index keys are sequentially extracted from the set, and the process of FIGS. 5 and 4A to 4C is repeated to construct the coupled node tree of the present invention corresponding to the set of index keys. it can.
  • FIG. 6A is a diagram showing an example of a processing flow of search processing that is the first stage of deletion processing, and corresponds to the search processing shown in FIG. 3 with the root node as the search start node and the insertion key as the search key. .
  • step S601 the root node array number is set in the area for setting the search start node array number, and in step S602, the delete key is set as the search key.
  • step S610 the search process shown in FIG. 4 is executed to obtain an index key as a search result, and the process advances to step S611.
  • step S611 in FIG. 6A the delete key and the index key are compared. If they are not equal, the index key to be deleted does not exist in the coupled node tree, so the deletion fails and the process ends. If they are equal, the process proceeds to the next process, the process of step S612 and subsequent steps in FIG. 6B.
  • FIG. 6B is a diagram for explaining the processing flow of the latter stage of the deletion processing.
  • step S612 it is determined whether two or more array element numbers are stored in the search path stack. The fact that two or more array numbers are not stored is, in other words, only one, and the array number is that of the array element in which the root node is stored. In that case, the process proceeds to step S618, and the node pair related to the array number of the root node obtained in step S601 is deleted. In step S619, the registered root node array element number is deleted, and the process ends.
  • step S612 When it is determined in step S612 that two or more array element numbers are stored in the search path stack, the process proceeds to step S613, and the representative node number obtained in step S308 of the processing flow shown in FIG. 3 referred to in step S610. To the array number obtained by adding the inverted values of the bit values obtained in step S307. In this process, the array element number in which the node paired with the leaf node storing the index key to be deleted is obtained.
  • step S614 the contents of the array element having the array element number obtained in step S613 are read.
  • step S616, the contents of the array element read in step S614 are overwritten on the array element having the array element number obtained in step S615.
  • a branch node that is a link source to the leaf node storing the index key to be deleted is replaced with a node that is paired with the leaf node.
  • step S617 the node pair related to the representative node number obtained in step S308 of the processing flow shown in FIG. 3 referred to in step S610 is deleted, and the process ends.
  • the problem to be solved by the present invention is to provide a technique for reducing the processing burden of an index update device that updates a database index.
  • the index update data creation device of the present invention includes a difference tree acquisition unit that acquires a difference tree that is a coupled node tree storing an index key of a database before update, an index of the database before update, and an index of the database after update Difference data acquisition means for acquiring the difference data, and update the difference tree based on the difference data, the update position that is the position information of the updated node of the updated difference tree and the update node that is the content of the node Update data creating means for creating index update data comprising:
  • the index update device of the present invention also includes an update tree acquisition means for acquiring an update tree that is a coupled node tree storing the index key of the database before update, and nodes of the update tree to be updated from the index update data creation device Update data acquisition means for acquiring the update data of the index composed of the update position that is the position information of the node and the update node that is the content of the node, and the update tree by rewriting the contents of the node of the update position of the update data with the update node Update
  • the index update data creation device creates the position and contents of data to be updated by the index update device based on the difference data, the processing load of the index update device is greatly reduced.
  • the differential update system includes an index update data creation device 300 and an arbitrary number of index update devices 400a and 400b.
  • the component elements of the index update device may be described in the same way.
  • the index update data creation device 300 includes an array 309 for storing an index, a difference data storage area 320, and an update data storage area 322.
  • an insertion key that is insertion data and a deletion key that is deletion data are acquired and stored as difference data.
  • the difference data acquisition method may be a method of receiving a provision from a database supplier, or a method of receiving a new index from a database supplier and extracting a difference from the old index.
  • the index update data creation apparatus 300 inserts and deletes a coupled node tree (old differential tree) 3090 that stores an index key that is an old index, using an insertion key and a deletion key stored in the differential data storage area 320.
  • the process is executed to obtain a new difference tree 3091 corresponding to the new index.
  • the difference tree is arranged in the array, but as described above, it is not essential to arrange the difference tree in the array.
  • the index update data creation apparatus 300 Based on the information obtained at the time of the insertion process and the deletion process, the index update data creation apparatus 300 creates update data 380 used for updating the index in the index update apparatus 400 and stores it in the update data storage area 322.
  • the update data 380 includes an update position 383 that indicates the position of the node to be updated and an update node 384 that is the update content.
  • Update data 380 stored in the update data storage area 322 is transmitted to the index update device 400 that updates the database index using the update data.
  • the transmission of the update data 380 is realized by wireless, wired or a communication line using a combination thereof, a storage medium, a combination of a communication line and a storage medium, or the like.
  • the update data 380 transmitted to the index update device 400 is stored in the update data storage area 420.
  • the index update device 400 stores update data for the contents of the node of the coupled node tree (old update tree) 4090 storing the index key which is the old index, that is, the array element of the array 409a in which the old update tree is arranged.
  • a rewrite process using the update data 380 stored in the area 420 is executed to obtain a new update tree 4091 corresponding to the new index.
  • the update of the index key stored in the update tree in the index update device 400 is realized by rewriting the contents of the array element of the array in which the update tree is arranged, not by the insertion process or deletion process of the coupled node tree. Therefore, the processing load on the index update device 400 can be reduced.
  • FIG. 8A is a diagram for explaining a functional block configuration example of the index update data creation device.
  • the index update data creation device 300 includes a difference tree acquisition unit 330, a difference data acquisition unit 340, and an update data creation unit 350.
  • the difference tree acquisition means 330 acquires a coupled node tree (old difference tree) 3090 storing an index key which is an old index shown in FIG. If the index key that is the old index is already stored in the coupled node tree, it is set as the old difference tree 3090. Otherwise, the coupled node tree generated by extracting the index key and executing the coupled node tree generation process shown in FIG. 5 is defined as the old difference tree.
  • the difference data acquisition means acquires the insertion key that is insertion data and the deletion key that is deletion data as difference data, and stores them in the difference data storage area 320.
  • the method for obtaining the difference data may be provided from the database supplier, or receives a new index from the database supplier and extracts a difference from the old index. There may be.
  • the update data creation unit 350 updates the difference tree acquired by the difference tree acquisition unit 330 based on the difference data acquired by the difference data acquisition unit 340, and generates update data of the index used in the index update device 400.
  • the update data creation unit 350 includes an insertion data creation unit 352, a deletion data creation unit 354, and an update type determination unit 356.
  • the update type determination unit 356 determines whether the difference data is insertion data or deletion data.
  • the insertion data creation unit 352 creates update data based on the insertion data
  • the deletion data creation unit 354 creates update data based on the deletion data. The detailed operation of each means will be described later with reference to FIGS. 10 to 13E.
  • FIG. 8B is a diagram illustrating a functional block configuration example of the index update device.
  • the index update device 400 includes an update tree acquisition unit 430, an update data acquisition unit 440, and an update tree update unit 350.
  • the update tree acquisition means 430 acquires a coupled node tree (old update tree) 4090 storing the index key which is the old index shown in FIG. If the index key that is the old index is already stored in the coupled node tree, it is set as the old update tree 4090. Otherwise, the coupled node tree generated by extracting the index key and executing the coupled node tree generation process shown in FIG. 5 is set as the old update tree.
  • the update data acquisition unit 440 receives the update data transmitted from the index update data creation device 300 and stores it in the update data storage device 420.
  • the update data transmission method is as described above.
  • the update tree update means 450 updates the update data for the contents of the node of the coupled node tree (old update tree) 4090 storing the index key which is the old index, that is, the array element of the array 409 in which the old update tree is arranged.
  • a rewrite process using the update data acquired by the acquisition means 440 and stored in the update data storage area 420 is executed to obtain a new update tree 4091 corresponding to the new index.
  • FIG. 9 is a diagram illustrating a hardware configuration example for carrying out the present invention.
  • hardware for carrying out the present invention includes an index update data creation device 300 and index update devices 400a to 400x.
  • the number of the index update devices 400a to 400x is arbitrary.
  • the update data creation by the index update data creation device 300 of the present invention is performed by the data processing device 301 including at least the central processing unit 302 and the cache memory 303 using the data storage device 308.
  • the data storage device 308 having the update data storage area 322 to be stored can be realized by the main storage device 305 or the external storage device 306, or using a device disposed at a distance connected via the communication device 307. Is also possible.
  • the main storage device 305, the external storage device 306, and the communication device 307 are connected to the data processing device 301 by a single bus 304, but the connection method is not limited to this.
  • the main storage device 305 can be in the data processing device 301, and the search path stack 310 can be realized as hardware in the central processing unit 302.
  • the update data storage area 322 and the difference data storage area 320 have the external storage device 306 and the search path stack 310 in the main storage device 305, depending on the usable hardware environment, the size of the index key set, etc. It is clear that the hardware configuration can be selected as appropriate. Although not particularly illustrated, it is natural that a temporary storage area corresponding to each process is used in order to use various values obtained during the process in a later process.
  • the update data created in the index update data creation device 300 is sent to the index update devices 400a to 400x, stored in the difference data storage areas 420a to 420x, and stored in the arrays 409a to 409x that are the respective index storage areas. Used to update the old data that has been updated to the new data.
  • the index update devices 400a to 400x also include a data processing device and a data storage device having a differential data storage area, an index storage area, and other storage areas.
  • the data stored in a certain data storage area is appended with the code of the data storage area so that the difference data stored in the difference data storage area 320 is expressed as the difference data 320, for example. May explain.
  • FIG. 10 is a diagram for explaining an overview of processing for creating update data based on difference data according to an embodiment of the present invention.
  • difference data 390 a, 390 b, 390 c, and 390 d are stored in the difference data storage area 320.
  • Each difference data is composed of an update type 391 and a difference key 392.
  • the update type of the difference data 390a is “d” meaning deletion, and the difference key is a key 321d “101011”.
  • the update type of the difference data 390b is “d”, and the difference key is the key 321b “010011”.
  • the update type of the difference data 390c is “i” meaning insertion, and the difference key is a key 322c “1000011”.
  • the update type of the difference data 390d is “i”, and the difference key is the key 322b “010110”.
  • the difference tree 3090 before the start of the update process stores “101100”, “101101”, “1000011”, “010011”, and “010010” as index keys.
  • the difference tree 3090 is deleted by the difference data key 321d and the key 321b whose update type is “d”, and as indicated by the arrow 333, the update data 380a by the key 321d is deleted.
  • update data 380b by the key 321b is created and stored in the update data storage area 322.
  • an insertion process is performed using the difference data key 322c and key 322b whose update type is “i”, and the update data is inserted as an index key into the updated difference tree 3091. Then, as indicated by an arrow 334, update data 380c by the key 322c and update data 380d by the key 322b are created and stored in the update data storage area 322.
  • index key “101101” indicated by reference numeral 321d and the index key “1000011” indicated by reference numeral 321b are deleted from the difference tree 3090 before the update, and the index key 321e is indicated by the dotted arrow. “101100”, 321c “1000011”, and 321a “010010” remain in the updated difference tree 3091.
  • index keys 322c and 322b are inserted in the difference tree 3091.
  • a difference tree is set in step S1101, and difference data is set in step S1102.
  • the difference tree is set by obtaining the difference tree by the difference tree obtaining unit 330 shown in FIG. 8A, that is, by obtaining and setting the array element number of the root node of the difference tree.
  • Setting of the difference data is performed by acquiring the difference data by the difference data acquisition unit 340 and storing it in the difference data storage area 320.
  • step S1103 it is determined whether all the difference data has been processed. If all the difference data has been processed, the process ends. If all the difference data has not been processed, the process proceeds to step S1104.
  • step S1104 the difference data is read from the difference data storage area, the difference key of the read difference data is extracted, and in step S1105, the update type of the difference data is extracted.
  • step S1106 the update type extracted in step S1105 is determined. If the update type is deletion, the process proceeds to step S1107. If not, the process proceeds to step S1108.
  • step S1107 the difference key extracted in step S1104 is deleted from the difference tree, and update data is created, and the process returns to step S1103. Details of the processing in step S1107 will be described later with reference to FIG. 12B.
  • step S1108 the key extracted in step S1104 is inserted as an insertion key into the difference tree, update data is created, and the process returns to step S1103. Details of the processing in step S1108 will be described next with reference to FIG. 12A.
  • the loop processing from step S1103 to step S1107 and step S1108 is repeated until it is determined in step S1103 that all the difference data has been processed.
  • various methods such as counting the number of difference data stored in the difference data storage area and decrementing the number of difference data each time one difference data is processed Can be adopted.
  • FIG. 12A is a diagram showing an example of a processing flow for creating update data by inserting a difference key of difference data whose update type is insertion into the difference tree, and describes details of the processing in step S1108 shown in FIG. It is.
  • step 1201 the difference key is inserted into the difference tree as an insertion key. Details of the processing in step S1201 have been described with reference to FIGS. 4A to 4C.
  • step S1202 first update data is created based on the array number of the leaf node including the inserted key and the content of the leaf node.
  • the array element number of the leaf node including the inserted key is the array element number obtained in step S414 shown in FIG. 4B in step S1201, and the contents of the leaf node are those written in step S425 of FIG. 4C.
  • step S1203 second update data is created based on the array element number of the pair node paired with the leaf node including the inserted key and the contents of the pair node.
  • the array number of the pair node is the array number obtained in step S415 shown in FIG. 4B in step S1201, and the contents of the pair node are those written in step S427 of FIG. 4C.
  • step S1204 the third update data is created based on the array element number of the branch node immediately above the leaf node including the inserted key and the content of the branch node, and the process ends.
  • the array element number of the branch node is the array element number extracted from the search path stack in step S424 shown in FIG. 4C in step S1201, and the contents of the branch node are those written in step S428 of FIG. 4C.
  • FIG. 12B is a diagram illustrating an example of a processing flow for creating update data by deleting a difference key of difference data whose update type is deletion from the difference tree, and illustrates details of the processing in step S1107 illustrated in FIG. 11. It is.
  • step 1211 the difference key is deleted from the difference tree using the delete key. Details of the processing in step S1211 have been described with reference to FIGS. 6A and 6B.
  • step S1212 update data is created based on the contents of the node paired with the array number of the branch node immediately above the leaf node storing the deleted key and the leaf node, and the process ends.
  • the array element number of the branch node is the array element number extracted from the search path stack in step S615 shown in FIG. 6B in step S1211, and the contents of the node paired with the leaf node are written in step S616 shown in FIG. 6B. It has been.
  • FIG. 13A shows a difference tree 3090 before being updated by the difference data 390a.
  • the difference tree 3090 corresponds to a result obtained by removing the nodes 210g, 211d, and 210c from the coupled node tree illustrated in FIG. Therefore, the contents of the node 211g of the tree shown in FIG. 2 are written to the node 210f of the difference tree 3090, and the contents of the node 210d of the tree shown in FIG. 2 are written to the node 210b of the difference tree 3090. It is. Then, as shown by the arrow 331a in FIG. 13A, when the deletion process is executed using the difference key 321d of the difference data 390a as the deletion key, the node 210h becomes a deletion target.
  • FIG. 13B shows a difference tree 3092 after updating with the difference data 390a and before updating with the difference data 390b.
  • the content of the node 211f is changed to the content of the node 211h that is paired with the leaf node 210h including the delete key, so the difference before the update by the difference data 390a
  • Update node 384 is set as the content of node 211h of tree 3090, and update data 380a having the array element number 221b + 1 of branch node 211g immediately above leaf node 210h as the update position is created and stored in update data storage area 322.
  • the deletion process is executed using the difference key 321b of the difference data 390b as a deletion key, the node 211c becomes a deletion target.
  • FIG. 13C shows a difference tree 3093 after updating with the difference data 390b and before updating with the difference data 390c.
  • the content of the node 210b is changed to the content of the node 211c that is paired with the leaf node 210c including the delete key, so the difference before the update by the difference data 390b
  • Update data 380b having the update node 384 as the contents of the node 211c of the tree 3092 and the array element number 220a of the branch node 210b immediately above the leaf node 210c as the update position is created and stored in the update data storage area 322.
  • the node 210f is obtained as a leaf node that stores the search result key.
  • FIG. 13D shows a difference tree 3094 after updating with the difference data 390c and before updating with the difference data 390d.
  • the node pair 201g is inserted under the node 210f
  • the leaf node including the insertion key is the node 210g.
  • Arrows 341c, 342c, and 343c indicate three update data 380c created by the update using the difference data 390c.
  • the content of the leaf node 210g including the insertion key 322c in the inserted node pair 201g is set as the first update node, and the array element number 220f of the leaf node 210g is set as the first update position.
  • Update data is created and stored in the update data storage area 322.
  • the content of the node 211g paired with the leaf node 210g including the insertion key 322c is set as the second update node, and the array number 220f + 1 of the node 211g is set as the second update position.
  • Update data is created and stored in the update data storage area 322.
  • the third update data having the content of the branch node 210f immediately above the leaf node 210g as the third update node and the array element number 221b of the branch node 210f as the third update position is displayed. Created and stored in the update data storage area 322.
  • the node 210b is obtained as a leaf node that stores the search result key.
  • FIG. 13E shows a difference tree 3091 after updating with the difference data 390d, that is, after updating with all the difference data.
  • the node pair 201e is inserted under the node 210b, and the leaf node including the insertion key is the node 211e.
  • Arrows 341d, 342d, and 343d indicate three update data 380d created by the update using the difference data 390d.
  • the content of the leaf node 211e including the insertion key 322d in the inserted node pair 201e is the first update node
  • the array element number 220b + 1 of the leaf node 211e is the first update position.
  • Update data is created and stored in the update data storage area 322.
  • the second update node is the content of the node 210e paired with the leaf node 211e including the insertion key 322d
  • the second update position is the array element number 220b of the node 210e.
  • Update data is created and stored in the update data storage area 322.
  • the third update data having the content of the branch node 210b immediately above the leaf node 211e as the third update node and the array element number 220a of the branch node 210b as the third update position is displayed. Created and stored in the update data storage area 322.
  • FIG. 14 is a diagram illustrating an overview of index update processing using update data executed by the index update device.
  • update data 380a to 38d0d transmitted from the index update data creation device 300 and received and stored by the update data acquisition means 440 are set.
  • the update data 380a and 380b are created by difference tree deletion processing using the key 321d of the difference data 390a and the key 321b of the difference data 390b as deletion keys, respectively.
  • the update data 380c and 380d are created by difference tree insertion processing using the key 322c of the difference data 390c and the key 322b of the difference data 390d as insertion keys, respectively.
  • the same index key as the difference tree 3090 (shown in FIG. 10) before the update process of the index update data creation device 300 is stored.
  • the same nodes of the difference tree 3090 and the update tree 4090 are arranged in the array element having the same array element number in the array.
  • the update data 380a based on the key 321d and the update data 380b based on the key 321b delete the keys 321d and 321b from the update tree 4090, and the update data 380c based on the key 322c and the update data 380d based on the key 322b
  • the updated difference tree 4091 is obtained by inserting the keys 322c and 322b.
  • FIG. 15 is a diagram illustrating an example of a process flow of index update using update data.
  • an update tree is set in step S1501, and update data is set in step S1502.
  • the update tree is set by acquiring the difference tree by the update tree acquisition unit 430 shown in FIG. 8B, that is, by acquiring and setting the array element number of the root node of the update tree.
  • the update data is set by storing update data received from the index update data creation device in the update data storage area 420 by the update data acquisition means 440.
  • step S1503 it is determined whether all update data has been processed. If all the update data has been processed, the process ends. If all the update data has not been processed, the process proceeds to step S1504.
  • step S1504 the update data is read from the update data storage area, the update position and the update node are extracted from the read update data.
  • step S1505 the update node is written in the array element of the update tree pointed to by the update position. Return to. The loop processing from step S1503 to step S1505 is repeated until it is determined in step S1503 that all update data has been processed. When it is determined that all update data has been processed, the processing ends.
  • the index update device updates the index by rewriting the array element with the array number pointed to by the update position of the update data at the update data update node, as in the process of step S1505 described above. Therefore, the processing load for updating the index is lighter than when the update tree deletion processing and insertion processing are performed.
  • each update data 380a to 380d Since the update data is transmitted from the index data creation device, it is the same as the update data illustrated in FIGS. 13A to 13E. Also, the structure of the update tree shown in FIGS. 16A to 16E and the contents of each node correspond to the difference trees exemplified in FIGS. 13A to 13E, respectively, and are the same.
  • FIG. 16A shows an update tree 4090 before update by the update data 380a. As indicated by an arrow 360a in FIG. 16A, since the update position 383 of the update data 380a is 221b + 1, the node 211f is a rewrite target.
  • FIG. 16B shows an update tree 4092 after rewriting with the update data 380a and before rewriting with the update data 380b.
  • the node 211f is rewritten to a node 211h that is paired with the node 210h of the update tree 4090 that stores the difference key 321d.
  • the update position 383 of the update data 380b is 220a, so that the node 210b is the target of rewriting.
  • FIG. 16C shows an update tree 4093 after rewriting with the update data 380b and before rewriting with the update data 380c.
  • the node 210b is rewritten to a node 210c that forms a pair with the node 211c of the update tree 4090 that stores the difference key 321b.
  • an empty node pair 201g whose representative node array number is 220f is to be rewritten.
  • the array element number stored in the third update node in the update data 380c is 221b, so that the node 210f is to be rewritten.
  • FIG. 16D shows an update tree 4094 after rewriting with the update data 380c and before rewriting with the update data 380d.
  • the node 210f is rewritten to the third update node of the update data 380c.
  • the node 210g stores the first update node of the update data 380c, and the node 211g stores the second update node.
  • an empty node pair 201e whose representative node array number is 220b is to be rewritten.
  • the array element of the array element in which the third update node is stored in the update data 380d is 220a, so that the node 210b is a rewrite target.
  • FIG. 16E shows an update tree 4091 after rewriting with update data 380d, that is, after rewriting with all update data.
  • the update tree 4091 the node pair 201e is inserted under the node 210b, and the leaf node including the insertion key is the node 211e.
  • the update tree 4091 is exactly the same as the difference tree 3091.
  • the index synchronization between the index update data creation device and the index update device can be achieved.
  • the update data created by the index update data creation device is the update position that is the location information of the updated node in the updated difference tree and the contents of the node, regardless of the insertion processing or deletion processing using the difference data.
  • the update tree can be updated by rewriting the contents of the node at the update position of the update data with the update node, and the difference tree and the update tree can be easily synchronized.
  • the present invention it is possible to provide index update data for efficiently updating the index of the database from the old data to the new data using the coupled node tree.
  • the index update data of the present invention can reduce the processing load on the index update device.
  • the embodiments of the present invention are not limited to the above and can be variously modified.
  • the index update data creation apparatus and creation method, and the index update apparatus and update method according to the present invention can be realized on a computer by a program that causes the computer to execute. Therefore, the program and a computer-readable storage medium storing the program are included in the embodiment of the present invention.
  • Index update data creation device 301
  • Data processing device 302
  • Central processing device 303
  • Cache memory 304
  • Main storage device 306
  • External storage device 307
  • Communication device 308
  • Data storage device 309
  • Search path stack 320
  • Differential data storage region 322
  • Update data storage region 330
  • Difference tree acquisition means 340
  • Difference data acquisition means 350
  • Update data creation means 352
  • Insertion data creation means 354
  • Delete data creation means 356
  • Update type determination means 380
  • Update data 383
  • Update node 390 Difference data 391 Update type 392 Difference key
  • Index Update device 409
  • Update data storage area 430
  • Update tree acquisition means 440
  • Update data acquisition means 450 Update Lee update means

Landscapes

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

Abstract

更新前のデータベースのインデックスキーを格納した差分ツリーを取得する手段と、更新前のデータベースのインデックスと更新後のデータベースのインデックスの差分データを取得する手段と、差分データに基づき差分ツリーを更新し、更新された差分ツリーのうち更新されたノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを作成する手段を備えたインデックス更新データ作成装置。

Description

インデックス更新データ作成装置、作成方法及びプログラム
本発明は、データベースのインデックスの更新処理に関し、特に、インデックス更新に用いるインデックス更新データの作成処理とそのインデックス更新データによるインデックス更新処理に関する。
 近年、社会の情報化が進展し、大規模なデータベースが各所で利用されるようになってきている。また、カーナビゲーション用の地図データのように販売数の非常に大きなデータベースも存在する。
 このようなデータベースシステムの機能として、データの更新機能は必須である。データベースに保管されるデータ量が増大するのに伴って、例えばバッチ処理により既存のデータベースに対して大量のデータの追加や削除を行おうとすると、その作業に要する時間が長くなるという不都合が生じている。
 データベースのバッチ更新の態様としては、既存のデータベースに対する追加、変更あるいは削除データによりデータベースを更新する差分更新という態様と、既存のデータベースを新しいデータベースでそっくり置き換える態様が存在する。
 後者のデータベース更新の態様は、例えばデータベースのデータの供給者が、データベースの更新が必要になったときにデータベースの更新データを供給するのではなく、データを更新済みの新しい版のデータベースを改めて供給する場合に採用される。しかし、このようなデータベースの更新の態様では、更新作業中はデータベースの利用ができないことから、この更新作業に長時間を要するのでは不便である。
 また、データベースは、データベース本体のデータ部分とデータベース本体からデータを検索するためのインデックスから構成されるのが通例である。そこで、データベースの更新の態様には、インデックス部分を更新する態様があり、この部分の更新においても、更新後のインデックス全体が供給され、更新前のインデックスとそっくり入れ替える場合がある。
 例えばカーナビゲーションシステムの地図データのインデックスを更新する場合には、地図データの販売業者から購入した新しい地図データのインデックスデータを、カーナビゲーションシステムの販売業者あるいは車のディーラーのセンターから、カーナビゲーションシステムを搭載した各車に配布し、搭載されたカーナビゲーションシステムごとに、インデックスデータを更新する。このように、新しいインデックスデータ全体を配布するため、配布するデータ量が多く、また各カーナビゲーションシステムにおける地図データの更新時間も長いものとなる。
 そこで、インデックデータの追加、変更あるいは削除データの供給を受けるか、あるいはインデックスデータの新旧データから差分データを抽出して差分更新により、データベースを更新することが行われている。
 下記特許文献1には、ナビゲーション端末で用いられる地図データの差分更新について記載されている。
 上述のデータベースの差分更新を行うためには、データベースから更新対象のレコードの検索を行う必要がある。データベースからレコードを検索するには、各レコードの記憶されたアドレスと対応づけられたレコード内の項目をインデックスキーとして検索をし、所望のレコードを探し出すことが通例である。また、全文検索における文字列も、文書のインデックスキーと見なすことができる。
そして、それらのインデックスキーはビット列で表現されることから、データベースの検索はビット列の検索に帰着されるということができる。
ビット列の検索処理手法については、種々のものが知られている。それらのなかでも、ビット列の検索を高速に行うために、ビット列を記憶するデータ構造を種々に工夫することが行われている。このようなものの一つとして、下記特許文献2、3に記載された、カップルドノードツリーというデータ構造を用いた検索手法がある。
カップルドノードツリーは、ツリーの始点であるルートノードと、隣接した記憶領域に配置される2つのノードで構成されるツリーの構成要素としてのノード対を有する。ノードは該ノードがブランチノードであるかリーフノードであるかを示すノード種別を格納する領域を有し、ブランチノードは、ノード種別に加えて、検索キーの弁別ビット位置を格納する領域とリンク先のノード対の一方のノードである代表ノードの位置を示す情報を格納する領域を含むが、検索対象のビット列からなるインデックスキーを格納する領域を含まないものである。リーフノードは、ノード種別に加えて、検索対象のビット列からなるインデックスキーを格納する領域を含むが、検索キーの弁別ビット位置を格納する領域とリンク先の代表ノードの位置を示す情報を格納する領域を含まないものである。
上記カップルドノードツリーの任意のノードを検索開始ノードとして、各ブランチノードの弁別ビット位置に位置する検索キーのビット値に応じてリンク先を選択し、リーフノードに至ることにより、リーフノードに格納されたインデックスキーを検索キーによる検索結果キーとして取得する。
以下において、カップルドノードツリーとそれを用いた検索処理について、さらに説明する。その説明では、カップルドノードツリーは配列に格納されたものとする。ブランチノードが保持する代表ノードの位置を示すデータとして、記憶装置のアドレス情報とすることもできるが、ブランチノードあるいはリーフノードのうち占有する領域の記憶容量の大きい方を格納可能な配列要素からなる配列を用いることにより、ノードの位置を配列番号で表すことができ、位置情報の情報量を削減することができる。
図1は、配列に格納されたカップルドノードツリーの構成例を説明する図である。
 図1を参照すると、ノード101が配列100の配列番号10の配列要素に配置されている。ノード101はノード種別102、弁別ビット位置103及び代表ノード番号104で構成されている。ノード種別102は0であり、ノード101がブランチノードであることを示している。弁別ビット位置103には1が格納されている。代表ノード番号104にはリンク先のノード対の代表ノードの配列番号20が格納されている。なお、以下では表記の簡略化のため、代表ノード番号に格納された配列番号を代表ノード番号ということもある。また、代表ノード番号に格納された配列番号をそのノードに付した符号あるいはノード対に付した符号で表すこともある。
 配列番号20の配列要素には、ノード対111の代表ノードであるノード[0]112が格納されている。そして隣接する次の配列要素(配列番号20+1)に代表ノードと対になるノード[1]113が格納されている。ノード[0]112のノード種別114には0が、弁別ビット位置115には3が、代表ノード番号116には30が格納されている。またノード[1]113のノード種別117には1が格納されており、ノード[1]113がリーフノードであることを示している。インデックスキー118には、“0001”が格納されている。パトリシアツリーについて先に述べたと同様に、リーフノードにインデックスキーと対応するレコードにアクセスする情報が含まれることは当然であるが、表記は省略している。
 なお、代表ノードをノード[0]で表し、それと対になるノードをノード[1]で表すことがある。また、ある配列番号の配列要素に格納されたノードを、その配列番号のノードということがあり、ノードの格納された配列要素の配列番号を、ノードの配列番号ということもある。
 配列番号30及び31の配列要素に格納されたノード122とノード123からなるノード対121の内容は省略されている。
 ノード[0]112、ノード[1]113、ノード122、及びノード123の格納された配列要素にそれぞれ付された0あるいは1は、検索キーで検索を行う場合にノード対のどちらのノードにリンクするかを示すものである。前段のブランチノードの弁別ビット位置にある検索キーのビット値である0か1を代表ノード番号に加えた配列番号のノードにリンクする。
 したがって、前段のブランチノードの代表ノード番号に、検索キーの弁別ビット位置のビット値を加えることにより、リンク先のノードが格納された配列要素の配列番号を求めることができる。
 なお、上記の例では代表ノード番号をノード対の配置された配列番号のうち小さい方を採用しているが、大きいほうを採用することも可能であることは明らかである。
図2は、カップルドノードツリーのツリー構造を概念的に示す図である。
 符号210aで示すのがルートノードである。図示の例では、ルートノード210aは配列番号220に配置されたノード対201aの代表ノードとしている。
 ツリー構造としては、ルートノード210aの下にノート対201bが、その下層にノード対201cとノード対201fが配置され、ノード対201fの下層にはノード対201hとノード対201gが配置されている。ノード対201cの下にはノード対201dが、さらにその下にはノード対201eが配置されている。
 各ノードの前に付された0あるいは1の符号は、図1において説明した配列要素の前に付された符号と同じである。検索キーの弁別ビット位置のビット値に応じてツリーをたどり、検索対象のリーフノードを見つけることになる。
 図示された例では、ルートノード210aのノード種別260aは0でブランチノードであることを示し、弁別ビット位置230aは0を示している。代表ノード番号は220aであり、それはノード対201bの代表ノード210bの格納された配列要素の配列番号である。
 ノード対201bはノード210bと211bで構成され、それらのノード種別260b、261bはともに0であり、ブランチノードであることを示している。ノード210bの弁別ビット位置230bには1が格納され、リンク先の代表ノード番号にはノード対201cの代表ノード210cの格納された配列要素の配列番号220bが格納されている。
 ノード210cのノード種別260cには1が格納されているので、このノードはリーフノードであり、したがって、インデックスキーを含んでいる。インデックスキー250cには“000111”が格納されている。一方ノード211cのノード種別261cは0、弁別ビット位置231cは2であり、代表ノード番号にはノード対201dの代表ノード210dの格納された配列要素の配列番号221cが格納されている。
 ノード210dのノード種別260dは0、弁別ビット位置230dは5であり、代表ノード番号にはノード対201eの代表ノード210eの格納された配列要素の配列番号220dが格納されている。ノード210dと対になるノード211dのノード種別261dは1であり、インデックスキー251dには“011010”が格納されている。
 ノード対201eのノード210e、211eのノード種別260e、261eはともに1であり双方ともリーフノードであることを示し、それぞれのインデックスキー250e、251eにはインデックスキーとして“010010”と“010011”が格納されている。
 ノード対201bのもう一方のノードであるノード211bの弁別ビット位置231bには2が格納され、リンク先の代表ノード番号にはノード対201fの代表ノード210fの格納された配列要素の配列番号221bが格納されている。
 ノード対201fのノード210f、211fのノード種別260f、261fはともに0であり双方ともブランチノードである。それぞれの弁別ビット位置230f、231fには5、3が格納されている。ノード210fの代表ノード番号にはノード対201gの代表ノード210gの格納された配列要素の配列番号220fが格納され、ノード211fの代表ノード番号にはノード対201hの代表ノードであるノード[0]210hの格納された配列要素の配列番号221fが格納されている。
 ノード対201gのノード210g、211gのノード種別260g、261gはともに1であり双方ともリーフノードであることを示し、それぞれのインデックスキー250g、251gには“100010”と“100011”が格納されている。
 また同じくノード対201hの代表ノードであるノード[0]210hとそれと対をなすノード[1]211hのノード種別260h、261hはともに1であり双方ともリーフノードであることを示し、それぞれのインデックスキー250h、251hには“101011”と“101100“が格納されている。
以下、上述のツリーからインデックスキー“100010”を検索する処理の流れを簡単に説明する。弁別ビット位置は、左から0、1、2、・・・とする。
 まず、ビット列“100010”を検索キーとしてルートノード210aから処理をスタートする。ルートノード210aの弁別ビット位置230aは0であるので、検索キー“100010”の弁別ビット位置が0のビット値をみると1である。そこで代表ノード番号の格納された配列番号220aに1を加えた配列番号の配列要素に格納されたノード211bにリンクする。ノード211bの弁別ビット位置231bには2が格納されているので、検索キー“100010”の弁別ビット位置が2のビット値をみると0であるから、代表ノード番号の格納された配列番号221bの配列要素に格納されたノード210fにリンクする。
 ノード210gのノード種別260gは1でありリーフノードであることを示しているので、インデックスキー250gを読み出して検索キーと比較すると両方とも“100010”であって一致している。このようにしてカップルドノードツリーを用いた検索が行われる。
 次に、図2を参照してカップルドノードツリーの構成の意味について説明する。
 カップルドノードツリーの構成はインデックスキーの集合により規定される。図2Bの例で、ルートノード210aの弁別ビット位置が0であるのは、図2Bに例示されたインデックスキーに0ビット目が0のものと1のものがあるからである。0ビット目が0のインデックスキーのグループはノード210bの下に分類され、0ビット目が1のインデックスキーのグループはノード211bの下に分類されている。
 ノード211bの弁別ビット位置が2であるのは、ノード211h、210h、211g、210gに格納された0ビット目が1のインデックスキーの1ビット目がすべて0で等しく、2ビット目で初めて異なるものがあるという、インデックスキーの集合の性質を反映している。
 以下0ビット目の場合と同様に、2ビット目が1であるものはノード211f側に分類され、2ビット目が0であるものはノード210f側に分類される。
 そして2ビット目が1であるインデックスキーは3ビット目の異なるものがあるのでノード211fの弁別ビット位置には3が格納され、2ビット目が0であるインデックスキーでは3ビット目も4ビット目も等しく5ビット目で異なるのでノード210fの弁別ビット位置には5が格納される。
 ノード211fのリンク先においては、3ビット目が1のものと0のものがそれぞれ1つしかないことから、ノード210h、211hはリーフノードとなり、それぞれインデックスキー250hと251hに“101011”と“101100”が格納されている。
 仮にインデックスキーの集合に“101100”の代わりに“101101”か“101110”が含まれていたとしても、3ビット目までは“101100”と等しいので、ノード211hに格納されるインデックスキーが変わるだけで、ツリー構造自体は変わることはない。しかし、“101100”に加えて“101101”が含まれていると、ノード211hはブランチノードとなり、その弁別ビット位置は5になる。追加されるインデックスキーが“101110”であれば、弁別ビット位置は4となる。
 以上説明したように、カップルドノードツリーの構造は、インデックスキーの集合に含まれる各インデックスキーの各ビット位置のビット値により決定される。
 そしてさらにいえば、異なるビット値となるビット位置ごとにビット値が“1”のノードとビット値が“0”のノードとに分岐していることから、ノード[1]側とツリーの深さ方向を優先させてリーフノードをたどると、それらに格納されたインデックスキーは、ノード211hのインデックスキー251hの“101100”、ノード210hのインデックスキー250hの“101011”、・・・、ノード210cのインデックスキー250cの“000111”となり降順にソートされている。
 すなわち、カップルドノードツリーにおいては、インデックスキーはソートされてツリー上に配置されている。
 検索キーで検索するときはインデックスキーがカップルドノードツリー上に配置されたルートをたどることになり、例えば検索キーが“101100”であればノード211hに到達することができる。また、上記説明からも想像がつくように、“101101”か“101110”を検索キーとした場合でもノード211hにたどり着く。インデックスキー251hと比較することにより検索が失敗したとすることもできるし、インデックスキー251hである“101100”を検索結果キーとすることもできる。
 また、例えば“100100”で検索した場合でも、ノード210a、211b、210fのリンク経路では検索キーの3ビット目と4ビット目は使われることがなく、“100100”の5ビット目が0なので、“100010”で検索した場合と同様にノード210gに到達することになる。このように、カップルドノードツリーに格納されたインデックスキーのビット構成に応じた弁別ビット位置を用いて分岐が行われる。
次に、上述のカップルドノードツリーを用いた検索処理、及びカップルドノードツリーの挿入削除処理について説明する。以下の説明においては、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域が用いられる。また、あるデータ格納領域に格納されるデータ自体にデータ格納領域の符号を付して説明する場合があるし、データ自体の名前をそのデータを格納する一時記憶領域の名前として用いることもある。
図3は、下記特許文献3に開示されたビット列検索の基本動作を示したフローチャートである。
 まず、ステップS301で、検索開始ノードの配列番号を取得する。取得された配列番号に対応する配列は、カップルドノードツリーを構成する任意のノードを格納したものである。検索開始ノードの指定は、オペレータからの入力によってもよいし、図3に例示する処理を利用するアプリケーションプログラムによるものでもよい。
 取得された検索開始ノードの配列番号は、図示しない検索開始ノード設定エリアに設定されるが、この検索開始ノード設定エリアは、先に述べた「処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域」の一つである。以下の説明では、「図示しない検索開始ノード設定エリアに設定する」のような表現に変えて、「検索開始ノードの配列番号を得る。」、「検索開始ノードとして設定する」あるいは単に「検索開始ノードに設定する」のように記述することもある。
 次に、ステップS302で、探索経路スタック310に取得された配列番号を格納し、ステップS303で、その配列番号に対応する配列要素を参照すべきノードとして読み出す。そして、ステップS304で、読み出したノードから、ノード種別を取り出し、ステップS305で、ノード種別がブランチノードであるか否かを判定する。
 ステップS305の判定において、読み出したノードがブランチノードである場合は、ステップS306に進み、ノードから弁別ビット位置についての情報を取り出し、更に、ステップS307で、取り出した弁別ビット位置に対応するビット値を検索キーから取り出す。そして、ステップS308で、ノードから代表ノード番号を取り出して、ステップS309で、検索キーから取り出したビット値と代表ノード番号とを加算し、新たな配列番号として、ステップS302に戻る。
 以降、ステップS305の判定においてリーフノードと判定されてステップS310に進むまで、ステップS302からステップS309までの処理を繰り返す。ステップS310で、リーフノードからインデックスキーを検索結果キーとして取り出して、処理を終了する。
 上述の説明では、カップルドノードツリーは配列に格納されているものとしたため、探索経路スタック310には配列番号を格納するとしたが、カップルドノードツリーが配列に格納されていない場合は、配列番号に替えてリンク先のノードの位置を示す情報が探索経路スタック310に格納される。
次に、図4A~図4Cにより下記特許文献2に開示されたカップルドノードツリーにおけるノード挿入処理を説明する。
図4Aは挿入処理の前段である検索処理の処理フローを示す図であり、図3に示した検索処理において、ルートノードを検索開始ノードとし、挿入キーを検索キーとしたものに相当する。
ステップS401において、検索開始ノードの配列番号を設定するエリアにルートノードの配列番号を設定し、ステップS402において、検索キーに挿入キーを設定する。
 次にステップS410において、図3に示す検索処理を実行し検索結果のインデックスキーを得て、ステップS411に進む。
 ステップS411において挿入キーとインデックスキーを比較し、等しければ挿入キーは既にカップルドノードツリーに存在するのであるから、挿入は失敗となり、処理を終了する。等しくなければ次の処理、図4BのステップS412以下の処理に進む。
 図4Bは、挿入するノード対のための配列要素を準備する処理を説明する処理フロー図である。
 ステップS412において、配列から空きのノード対を求め、そのノード対のうち代表ノードとなるべき配列要素の配列番号を取得する。
 ステップS413に進み、挿入キーとステップS410で得たインデックスキーの大小を比較し、挿入キーが大きいときは値1を小さいときは値0のブール値を得る。
 ステップS414に進み、ステップS412で得た代表ノードの配列番号にステップS413で得たブール値を加算した配列番号を得る。
 ステップS415に進み、ステップS412で得た代表ノードの配列番号にステップS413で得たブール値の論理否定値を加算した配列番号を得る。
 ステップS414で得た配列番号は、挿入キーをインデックスキーとして持つリーフノードが格納される配列要素の配列番号であり、ステップS415で得た配列番号は、そのリーフノードと対を成すブランチノードあるいはリーフノードが格納される配列要素のものである。
 つまり、前段の検索処理で得られたリーフノードに格納されたインデックスキーと挿入キーの大小により、挿入されるノード対のうちどちらのノードに挿入キーを保持するリーフノードが格納されるかが決定される。
 次に図4CのステップS416以下の処理に進む。
 図4Cは図4Bで準備された配列にノードを格納するとともにその挿入位置を求め、既存のノードの内容を変更して挿入処理を完成させる処理フローを示す図である。
 ステップS416~ステップS423までの処理は、挿入するノード対のカップルドノードツリー上の位置を求める処理であり、ステップS424以下の処理は各ノードにデータを設定して挿入処理を完成させる処理である。
 ステップS416で、挿入キーとステップS410で得たインデックスキーのビット列比較を例えば排他的論理和で行い、差分ビット列を得る。
 ステップS417に進み、ステップS416で得た差分ビット列から、上位0ビット目から見た最初の不一致ビットのビット位置を得る。この処理は、例えばプライオリティエンコーダを有するCPUではそこに差分ビット列を入力し、不一致のビット位置を得ることができる。また、ソフト的にプライオリティエンコーダと同等の処理を行い最初の不一致ビットのビット位置を得ることも可能である。
 次にステップS418に進み、探索経路スタックのスタックポインタがルートノードの配列番号を指しているか判定する。指していればステップS424に移行し、指していなければステップS419に進む。
 ステップS419において、探索経路スタックのスタックポインタを1つ戻してそこにスタックされている配列番号を取り出す。
 ステップS420に進み、ステップS419で取り出した配列番号の配列要素を配列からノードとして読み出す。
 ステップS421に進み、ステップS420で読み出したノードから、弁別ビット位置を取り出す。
 次にステップS422に進み、ステップS421で取り出した弁別ビット位置がステップS417で得たビット位置より上位の位置関係か判定する。ここで上位の位置関係とは、ビット列のより左側の位置、すなわちビット位置の値が小さい位置であることとする。
 ステップS422の判定結果が否定であれば、ステップS418に戻り、ステップS418での判定が肯定になるかステップS422での判定が肯定になるまで繰り返す。ステップS422での判定が肯定になると、ステップS423で経路探索スタックのスタックポインタを1つ進め、ステップS424以下の処理に移行する。
 上記ステップS416~ステップS423で説明した処理は、挿入するノード対の挿入位置を決定するために、挿入するインデックスキーと検索により取得されたインデックスキーの間でビット列比較を行い、ビット列比較で異なるビット値となる先頭の(最上位の)ビット位置と探索経路スタックに格納されているブランチノードの弁別ビット位置との相対的位置関係を調べ、弁別ビット位置が上位となるブランチノードの次のブランチノードのリンク先を挿入するノード対の挿入位置とするものである。
 また、経路探索スタック逆にたどりルートノードに至っても、ルートノードの弁別ビット位置が、先に求めたビット列比較で異なるビット値となる最上位のビット位置より上位のビット位置でないということは、そのカップルドノードツリーのインデックスキーの上位ビットで、ルートノードの弁別ビット位置より上位のビットの値は全て等しい場合である。そして、挿入するインデックスキーにおいて、初めてルートノードの弁別ビット位置より上位のビットの値に異なるビット値のものがあるということである。したがって、挿入するノード対はルートノードの直接のリンク先となり、ルートノードの弁別ビット位置は、既存のインデックスキーと異なる値である挿入キーの最上位ビットの位置に変わる。
 次に、ステップS424以下の各ノードにデータを設定して挿入処理を完成させる処理について説明する。
 ステップS424では探索経路スタックからスタックポインタの指す配列番号を取り出す。
 ステップS425において、ステップS414で得た配列番号の指す配列要素のノード種別に1(リーフノード)を、インデックスキーに挿入キーを書き込む。
 ステップS426に進み、配列からステップS424で得た配列番号の配列要素を読み出す。
 次にステップS427において、ステップS415で得た配列番号の配列要素にステップS426で読み出した内容を書き込む。
 最後にステップS428において、ステップS424で得た配列番号の指す配列要素のノード種別に0(ブランチノード)を、弁別ビット位置にステップS417で得たビット位置を、代表ノード番号にステップS412で得た配列番号を書き込み、処理を終了する。
 図5は、下記特許文献2に開示されたカップルドノードツリーを生成する処理フロー例である。ルートノードの挿入処理と通常の挿入処理により、カップルドノードツリーが生成される。
 ステップS501において、取得することを求められたカップルドノードツリーのルートノードの配列番号が登録済みであるか判定される。登録済みであれば、図4A~図4Cを用いて説明した通常の挿入処理が行われる。
 ステップS501での判定が登録済みでなければ、まったく新しいカップルドノードツリーの登録、生成が始まることになる。
 まず、ステップS502において、配列から空きのノード対を求め、そのノード対のうち代表ノードとなるべき配列要素の配列番号を取得する。次にステップS503において、ステップS502で得た配列番号に0を加えた配列番号を求める。(実際には、ステップS502で取得した配列番号に等しい。)。さらにステップS504において、ステップS503で得た配列番号の配列要素に、挿入するルートノードのノード種別に1(リーフノード)とインデックスキーに挿入キーを書き込み、ステップS505で、ステップS502で取得したルートノードの配列番号を登録して処理を終了する。
 インデックスキーの集合があるとき、そこから順次インデックスキーを取り出し、図5及び図4A~図4Cの処理を繰り返すことにより、インデックスキーの集合に対応した本発明のカップルドノードツリーを構築することができる。
次に図6A、図6Bを参照して、下記特許文献2に開示されたカップルドノードツリーから、特定のインデックスキーを格納したリーフノードを削除する処理フローを説明する。
 図6Aは、削除処理の前段である検索処理の処理フロー例を示す図であり、図3に示した検索処理において、ルートノードを検索開始ノードとし、挿入キーを検索キーとしたものに相当する。
 ステップS601において、検索開始ノードの配列番号を設定するエリアにルートノードの配列番号を設定し、ステップS602において、検索キーに削除キーを設定する。
 次にステップS610において、図4に示す検索処理を実行し検索結果のインデックスキーを得て、ステップS611に進む。
 図6AのステップS611において削除キーとインデックスキーを比較し、等しくなければければ削除するインデックスキーはカップルドノードツリーに存在しないのであるから、削除は失敗となり、処理を終了する。等しければ次の処理、図6BのステップS612以下の処理に進む。
 図6Bは、削除処理の後段の処理フローを説明する図である。
 まず、ステップS612で探索経路スタックに2つ以上の配列番号が格納されているか判定する。2つ以上の配列番号が格納されていないということは、言い換えれば1つだけで、その配列番号はルートノードの格納された配列要素のものである。その場合はステップS618に移行し、ステップS601で得たルートノードの配列番号に係るノード対を削除する。次にステップS619に進み、登録されていたルートノードの配列番号を削除して処理を終了する。
 ステップS612において探索経路スタックに2つ以上の配列番号が格納されていると判定されたときはステップS613に進み、ステップS610で参照するする図3に示す処理フローのステップS308で得た代表ノード番号にステップS307で得たビット値を反転した値を加算した配列番号を得る。この処理は、削除対象のインデックスキーが格納されたリーフノードと対をなすノードの配置された配列番号を求めるものである。
 次にステップS614において、ステップS613で得た配列番号の配列要素の内容を読み出し、ステップS615において探索経路スタックのスタックポインタを1つ戻して配列番号を取り出す。
 次にステップS616に進み、ステップS614で読み出した配列要素の内容をステップS615で得た配列番号の配列要素に上書きする。この処理は、削除対象のインデックスキーが格納されたリーフノードへのリンク元であるブランチノードを上記リーフノードと対をなすノードに置き換えるものである。
 最後にステップS617において、ステップS610で参照するする図3に示す処理フローのステップS308で得た代表ノード番号に係るノード対を削除して処理を終了する。
特開2007-240492号公報 特開2008-015872号公報 特開2008-112240号公報
 本発明が解決しようとする課題は、データベースのインデックスの更新を行うインデックス更新装置の処理負担を軽減する手法を提供することである。
 本発明のインデックス更新データ作成装置は、更新前のデータベースのインデックスキーを格納したカップルドノードツリーである差分ツリーを取得する差分ツリー取得手段と、更新前のデータベースのインデックスと更新後のデータベースのインデックスの差分データを取得する差分データ取得手段と、差分データに基づき差分ツリーを更新し、該更新された差分ツリーのうち更新されたノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを作成する更新データ作成手段と、を備える。
 また、本発明のインデックス更新装置は、更新前のデータベースのインデックスキーを格納したカップルドノードツリーである更新ツリーを取得する更新ツリー取得手段と、インデックス更新データ作成装置から更新すべき更新ツリーのノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを取得する更新データ取得手段と、更新データの更新位置のノードの内容を更新ノードで書き換えることにより更新ツリーを更新する更新ツリー更新手段と、を備える。
 本発明によれば、インデックス更新データ作成装置が、差分データに基づいてインデックス更新装置が更新すべきデータの位置とその内容を作成するので、インデックス更新装置の処理負担は大幅に削減される。
配列に格納されたカップルドノードツリーの構成例を説明する図である。 カップルドノードツリーのツリー構造を概念的に示す図である。 ビット列検索の基本動作例を示すフローチャートである。 挿入処理の前段である検索処理の処理フロー例を示す図である。 挿入するノード対の配列要素を準備する処理フロー例を示す図である。 ノード対を挿入する位置を求め、ノード対の各ノードの内容を書き込んで挿入処理を完成させる処理フロー例を示す図である。 カップルドノードツリーを生成する処理フロー例を示す図である。 削除処理の前段である検索処理の処理フロー例を示す図である。 削除処理の後段の処理フロー例を示す図である。 本発明の原理を説明する図である。 インデックス更新データ作成装置の機能ブロック構成例を説明する図である。 インデックス更新装置の機能ブロック構成例を説明する図である。 本発明を実施するためのハードウェア構成例を説明する図である。 差分データによる更新データ作成処理の概要を説明する図である。 差分データによる更新データ作成の処理フロー例を示す図である。 差分ツリーに更新種別が挿入である差分データのインデックスキーを挿入して更新データを作成する処理フロー例を示す図である。 差分ツリーから更新種別が削除である差分データのインデックスキーを削除して更新データを作成する処理フロー例を示す図である。 本発明の一実施の形態における差分データに基づく更新データ作成処理の流れを説明する図である。 本発明の一実施の形態における差分データに基づく更新データ作成処理の流れを説明する図である。 本発明の一実施の形態における差分データに基づく更新データ作成処理の流れを説明する図である。 本発明の一実施の形態における差分データに基づく更新データ作成処理の流れを説明する図である。 本発明の一実施の形態における差分データに基づく更新データ作成処理の流れを説明する図である。 更新データによるインデックス更新処理の概要を説明する図である。 更新データによるインデックス更新の処理フロー例を示す図である。 本発明の一実施の形態における更新データに基づく更新ツリーの更新処理の流れを説明する図である。 本発明の一実施の形態における更新データに基づく更新ツリーの更新処理の流れを説明する図である。 本発明の一実施の形態における更新データに基づく更新ツリーの更新処理の流れを説明する図である。 本発明の一実施の形態における更新データに基づく更新ツリーの更新処理の流れを説明する図である。 本発明の一実施の形態における更新データに基づく更新ツリーの更新処理の流れを説明する図である。
 図7を参照して、本発明の原理を説明する。本発明に係る差分更新システムは、インデックス更新データ作成装置300と任意の数のインデックス更新装置400a、400bから構成される。なお、どのインデックス更新装置についての説明は同じであるので、以下の説明では、インデックス更新装置400のように表記する場合がある。インデックス更新装置の構成要素についても同様に表記する場合がある。
インデックス更新データ作成装置300は、インデックスを格納する配列309、差分データ格納領域320、及び更新データ格納領域322を含む。差分データ格納領域320には、差分データとして、挿入データである挿入キーと削除データである削除キーが取得され、格納される。差分データの取得方法は、データベースの供給元から提供を受けるものであってもよいし、データベース供給元から新インデックスを受領し、旧インデックスとの差分を抽出するものであってもよい。
 インデックス更新データ作成装置300は、旧インデックスであるインデックスキーを格納したカップルドノードツリー(旧差分ツリー)3090に対して、差分データ格納領域320に格納された挿入キーと削除キーによる挿入処理と削除処理を実行し、新インデックスに対応した新差分ツリー3091を得る。図7の例では、差分ツリーは配列に配置されているが、先にも述べたとおり、配列に配置することは必須ではない。
 上記挿入処理時及び削除処理時に得られる情報を基に、インデックス更新データ作成装置300は、インデックス更新装置400においてインデックスの更新に用いられる更新データ380を作成して更新データ格納領域322に格納する。更新データ380は、更新対象のノードの位置を示す更新位置383と更新内容である更新ノード384を含む。
 更新データ格納領域322に格納された更新データ380は、この更新データを用いてデータベースのインデックスを更新するインデックス更新装置400に送信される。更新データ380の送信は、無線、有線あるいはそれらを組み合わせた通信回線を用いたもの、記憶媒体を用いたもの、通信回線と記憶媒体を組み合わせたものなどで実現される。
 インデックス更新装置400に送信された更新データ380は、更新データ格納領域420に格納される。インデックス更新装置400は、旧インデックスであるインデックスキーを格納したカップルドノードツリー(旧更新ツリー)4090のノード、すなわち旧更新ツリーの配置された配列409aの配列要素の内容に対して、更新データ格納領域420に格納された更新データ380による書換処理を実行し、新インデックスに対応した新更新ツリー4091を得る。
インデックス更新装置400における更新ツリーに格納されたインデックスキーの更新は、カップルドノードツリーの挿入処理や削除処理によるのではなく、更新ツリーの配置された配列の配列要素の内容を書き換えることにより実現されるので、インデックス更新装置400における処理負担を軽減させることができる。
 図8Aは、インデックス更新データ作成装置の機能ブロック構成例を説明する図である。
 インデックス更新データ作成装置300は、差分ツリー取得手段330、差分データ取得手段340、及び更新データ作成手段350を含んで構成される。
 差分ツリー取得手段330は、図7に示す旧インデックスであるインデックスキーを格納したカップルドノードツリー(旧差分ツリー)3090を取得するものである。旧インデックスであるインデックスキーが既にカップルドノードツリーに格納されていれば、それを旧差分ツリー3090とする。そうでなければ、インデックスキーを取り出して図5に示すカップルドノードツリーの生成処理を実行して生成したカップルドノードツリーを旧差分ツリーとする。
 差分データ取得手段は、差分データとして、挿入データである挿入キーと削除データである削除キーを取得し、差分データ格納領域320に格納する。差分データの取得方法は、先に述べたように、データベースの供給元から提供を受けるものであってもよいし、データベース供給元から新インデックスを受領し、旧インデックスとの差分を抽出するものであってもよい。
 更新データ作成手段350は、差分データ取得手段340で取得された差分データに基づき差分ツリー取得手段330で取得された差分ツリーを更新し、インデックス更新装置400において用いるインデックスの更新データを作成する。更新データ作成手段350は、挿入データ作成手段352、削除データ作成手段354及び更新種別判定手段356を含む。更新種別判定手段356は、差分データが挿入データであるか削除データであるか判定する。挿入データ作成手段352は、挿入データに基づいて更新データを作成し、削除データ作成手段354は、削除データに基づいて更新データを作成する。
 それぞれの手段の詳細な動作は、後に図10~図13Eを参照して説明する。
 図8Bは、インデックス更新装置の機能ブロック構成例を説明する図である。
 インデックス更新装置400は、更新ツリー取得手段430、更新データ取得手段440、及び更新ツリー更新手段350を含んで構成される。
 更新ツリー取得手段430は、図7に示す旧インデックスであるインデックスキーを格納したカップルドノードツリー(旧更新ツリー)4090を取得するものである。旧インデックスであるインデックスキーが既にカップルドノードツリーに格納されていれば、それを旧更新ツリー4090とする。そうでなければ、インデックスキーを取り出して図5に示すカップルドノードツリーの生成処理を実行して生成したカップルドノードツリーを旧更新ツリーとする。
 更新データ取得手段440は、インデックス更新データ作成装置300から送信された更新データを受信して更新データ格納装置420に格納する。更新データの送信方法は、先に述べたとおりのものである。
 更新ツリー更新手段450は、旧インデックスであるインデックスキーを格納したカップルドノードツリー(旧更新ツリー)4090のノード、すなわち旧更新ツリーの配置された配列409の配列要素の内容に対して、更新データ取得手段440において取得され、更新データ格納領域420に格納された更新データによる書換処理を実行し、新インデックスに対応した新更新ツリー4091を得る。
 図9は、本発明を実施するためのハードウェア構成例を説明する図である。図に示すように、本発明を実施するためのハードウェアは、インデックス更新データ作成装置300とインデックス更新装置400a~400xで構成される。インデックス更新装置400a~400xの数は任意である。
 本発明のインデックス更新データ作成装置300による更新データ作成は中央処理装置302及びキャッシュメモリ303を少なくとも備えたデータ処理装置301によりデータ格納装置308を用いて実施される。カップルドノードツリーが配置される配列309と検索中にたどるノードが格納された配列要素の配列番号を記憶する探索経路スタック310、差分データを格納する差分データ格納領域320及び作成済みの更新データを格納する更新データ格納領域322を有するデータ格納装置308は、主記憶装置305または外部記憶装置306で実現することができ、あるいは通信装置307を介して接続された遠方に配置された装置を用いることも可能である。
 図9の例示では、主記憶装置305、外部記憶装置306及び通信装置307が一本のバス304によりデータ処理装置301に接続されているが、接続方法はこれに限るものではない。また、主記憶装置305をデータ処理装置301内のものとすることもできるし、探索経路スタック310を中央処理装置302内のハードウェアとして実現することも可能である。あるいは、更新データ格納領域322及び差分データ格納領域320は外部記憶装置306に、探索経路スタック310を主記憶装置305に持つなど、使用可能なハードウェア環境、インデックスキー集合の大きさ等に応じて適宜ハードウェア構成を選択できることは明らかである。
 また、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域が用いられることは当然である。
 インデックス更新データ作成装置300において作成された更新データは、インデックス更新装置400a~400xに送られ、それぞれの差分データ格納領域420a~420xに格納され、それぞれのインデックス格納領域である配列409a~409xに格納された旧データを新データに更新するために用いられる。特に図示はしていないが、インデックス更新装置400a~400xにおいても、データ処理装置や、差分データ格納領域、インデックス格納領域及びその他の記憶領域を有するデータ格納装置が備えられている。
 なお、以下においては、上述の例えば差分データ格納領域320に格納された差分データを差分データ320と表記するように、あるデータ格納領域に格納されるデータ自体にデータ格納領域の符号を付して説明する場合がある。
 図10は、本発明の一実施形態における差分データにより更新データを作成する処理の概要を説明する図である。
図10に示す例では、差分データ格納領域320には、差分データ390a、390b、390c、390dが格納されている。各差分データは更新種別391と差分キー392で構成されている。
差分データ390aの更新種別は削除を意味する“d”、差分キーはキー321d“101011”である。差分データ390bの更新種別は“d”、差分キーはキー321b“010011”である。差分データ390cの更新種別は挿入を意味する“i”、差分キーはキー322c“100011”である。差分データ390dの更新種別は“i”、差分キーはキー322b“010110”である。
 更新処理の開始前の差分ツリー3090には、インデックスキーとして“101100”、“101011”、“100011”、“010011”、“010010”が格納されている。矢印331d及び矢印331bで示すように、更新種別が“d”である差分データのキー321dとキー321bにより差分ツリー3090の削除処理が行われ、矢印333で示すように、キー321dによる更新データ380aとキー321bによる更新データ380bが作成され、更新データ格納領域322に格納される。
 また、矢印332c及び矢印332bで示すように、更新種別が“i”である差分データのキー322cとキー322bにより挿入処理が行われ、更新後の差分ツリー3091にインデックスキーとして挿入される。そして、矢印334で示すように、キー322cによる更新データ380cとキー322bによる更新データ380dが作成され、更新データ格納領域322に格納される。
 上述の削除処理と挿入処理により、更新前の差分ツリー3090から符号321dで示すインデックスキー“101011”と符号321bで示すインデックスキー“100011”が削除され、点線の矢印で示すように、インデックスキー321e“101100”、321c“100011”、321a“010010”が更新後の差分ツリー3091に残る。また、差分ツリー3091にはインデックスキー322c、322bが挿入されている。
 次に、図11を参照して、差分データによる更新データ作成の処理フロー例を説明する。
 図11に示すように、ステップS1101において差分ツリーを設定し、ステップS1102において差分データを設定する。差分ツリーの設定は、図8Aに示す差分ツリー取得手段330による差分ツリーの取得、すなわち差分ツリーのルートノードの配列番号を取得し設定することにより行われる。差分データの設定は、差分データ取得手段340により差分データを取得して差分データ格納領域320に格納することにより行われる。
 ステップS1103に進み、すべての差分データは処理済みか判定する。すべての差分データが処理済みであれば処理を終了し、すべての差分データが処理済みでなければ、ステップS1104に進む。
 ステップS1104では、差分データ格納領域から差分データを読み出し、読み出した差分データの差分キーを取り出し、ステップS1105において、差分データの更新種別を取り出す。
 次にステップS1106において、ステップS1105で取り出した更新種別を判定し、更新種別が削除であればステップS1107に進み、削除でなければステップS1108に進む。
 ステップS1107では、ステップS1104で取り出した差分キーを削除キーとして、差分ツリーより削除するとともに、更新データを作成し、ステップS1103に戻る。ステップS1107の処理の詳細は、後に図12Bを参照して説明する。
 ステップS1108では、ステップS1104で取り出したキーを挿入キーとして、差分ツリーに挿入するとともに、更新データを作成し、ステップS1103に戻る。ステップS1108の処理の詳細は、次に図12Aを参照して説明する。
上記ステップS1103~ステップS1107、ステップS1108のループ処理を、ステップS1103において全ての差分データを処理済みと判定するまで繰り返し、全ての差分データを処理済みと判定すると処理を終了する。
全ての差分データの処理済みを判定するには、差分データ格納領域に格納された差分データ数をカウントしておき、1つ差分データを処理する毎に差分データ数をデクリメントする等、種々の手法を採用可能である。
 図12Aは、差分ツリーに更新種別が挿入である差分データの差分キーを挿入して更新データを作成する処理フロー例を示す図であり、図11に示すステップS1108の処理の詳細を説明するものである。
 まずステップ1201で、差分キーを挿入キーとして、差分ツリーに挿入する。ステップS1201の処理の詳細は、図4A~図4Cを参照して説明したものである。
 次にステップS1202において、挿入したキーを含むリーフノードの配列番号とリーフノードの内容により第1の更新データを作成する。
 挿入したキーを含むリーフノードの配列番号は、ステップS1201において図4Bに示すステップS414で得た配列番号であり、リーフノードの内容は、図4CのステップS425で書き込まれたものである。
 次にステップS1203において、挿入したキーを含むリーフノードと対をなす対ノードの配列番号と対ノードの内容により第2の更新データを作成する。
 対ノードの配列番号は、ステップS1201において図4Bに示すステップS415で得た配列番号であり、対ノードの内容は、図4CのステップS427で書き込まれたものである。
 次にステップS1204において、挿入したキーを含むリーフノードの直近上位のブランチノードの配列番号とブランチノードの内容により第3の更新データを作成して処理を終了する。
 ブランチノードの配列番号は、ステップS1201において図4Cに示すステップS424で探索経路スタックから取り出した配列番号であり、ブランチノードの内容は、図4CのステップS428で書き込まれたものである。
 図12Bは、差分ツリーから更新種別が削除である差分データの差分キーを削除して更新データを作成する処理フロー例を示す図であり、図11に示すステップS1107の処理の詳細を説明するものである。
 まずステップ1211で、差分キーを削除キーとして、差分ツリーより削除する。ステップS1211の処理の詳細は、図6A、図6Bを参照して説明したものである。
 次にステップS1212において、削除したキーを格納していたリーフノードの直近上位のブランチノードの配列番号とリーフノードと対をなしていたノードの内容により更新データを作成して処理を終了する。
 ブランチノードの配列番号は、ステップS1211において、図6Bに示すステップS615で探索経路スタックから取り出した配列番号であり、リーフノードと対をなしていたノードの内容は、図6Bに示すステップS616で書き込まれたものである。
 次に図13A~図13Eを参照して、本発明の一実施の形態における、差分データによる更新データの作成処理の流れを差分データ390a~390d毎に説明する。例に挙げる差分データと差分ツリーは、図10で例示したものと同一である。しかし、差分ツリーについては、ツリー構造を明記している。
 図13Aには、差分データ390aによる更新前の差分ツリー3090が記載されている。差分ツリー3090は、図2に例示したカップルドノードツリーからノード210g、211d、210cを除いたものに相当する。したがって、差分ツリー3090のノード210fには、図2に示すツリーのノード211gの内容が書き込まれており、また、差分ツリー3090のノード210bには、図2に示すツリーのノード210dの内容が書き込まれている。
 そして、図13Aの矢印331aで示すように、差分データ390aの差分キー321dを削除キーとして削除処理を実行すると、ノード210hが削除の対象となる。
 図13Bには、差分データ390aによる更新後、差分データ390bによる更新前の差分ツリー3092が記載されている。
 矢印333aで示すように、差分データ390aによる更新の結果、ノード211fの内容が、削除キーを含むリーフノード210hと対をなすノード211hの内容に変更されたので、差分データ390aによる更新前の差分ツリー3090のノード211hの内容を更新ノード384とし、リーフノード210hの直近上位のブランチノード211gの配列番号221b+1を更新位置とする更新データ380aが作成され、更新データ格納領域322に格納される。
 そして、矢印331bで示すように、差分データ390bの差分キー321bを削除キーとして削除処理を実行すると、ノード211cが削除の対象となる。
 図13Cには、差分データ390bによる更新後、差分データ390cによる更新前の差分ツリー3093が記載されている。
 矢印333bで示すように、差分データ390bによる更新の結果、ノード210bの内容が、削除キーを含むリーフノード210cと対をなすノード211cの内容に変更されたので、差分データ390bによる更新前の差分ツリー3092のノード211cの内容を更新ノード384とし、リーフノード210cの直近上位のブランチノード210bの配列番号220aを更新位置とする更新データ380bが作成され、更新データ格納領域322に格納される。
 そして、矢印332cで示すように、差分データ390cの差分キー322cを挿入キーとして挿入処理を実行すると、ノード210fが検索結果キーを格納するリーフノードとして得られる。
 図13Dには、差分データ390cによる更新後、差分データ390dによる更新前の差分ツリー3094が記載されている。差分ツリー3094には、ノード対201gがノード210fの下に挿入され、挿入キーを含むリーフノードはノード210gである。
 矢印341c、342c、343cは、差分データ390cによる更新により作成される3つの更新データ380cを示している。
 矢印341cで示すように、挿入されたノード対201gのうち挿入キー322cを含むリーフノード210gの内容を第1の更新ノードとし、リーフノード210gの配列番号220fを第1の更新位置とする第1の更新データが作成され、更新データ格納領域322に格納される。
 また、矢印342cで示すように、挿入キー322cを含むリーフノード210gと対をなすノード211gの内容を第2の更新ノードとし、ノード211gの配列番号220f+1を第2の更新位置とする第2の更新データが作成され、更新データ格納領域322に格納される。
 さらに、矢印343cで示すように、リーフノード210gの直近上位のブランチノード210fの内容を第3の更新ノードとし、ブランチノード210fの配列番号221bを第3の更新位置とする第3の更新データが作成され、更新データ格納領域322に格納される。
 そして、矢印332dで示すように、差分データ390dの差分キー322bを挿入キーとして挿入処理を実行すると、ノード210bが検索結果キーを格納するリーフノードとして得られる。
 図13Eには、差分データ390dによる更新後、すなわち全差分データによる更新後の差分ツリー3091が記載されている。差分ツリー3091には、ノード対201eがノード210bの下に挿入され、挿入キーを含むリーフノードはノード211eである。
 矢印341d、342d、343dは、差分データ390dによる更新により作成される3つの更新データ380dを示している。
 矢印341dで示すように、挿入されたノード対201eのうち挿入キー322dを含むリーフノード211eの内容を第1の更新ノードとし、リーフノード211eの配列番号220b+1を第1の更新位置とする第1の更新データが作成され、更新データ格納領域322に格納される。
 また、矢印342dで示すように、挿入キー322dを含むリーフノード211eと対をなすノード210eの内容を第2の更新ノードとし、ノード210eの配列番号220bを第2の更新位置とする第2の更新データが作成され、更新データ格納領域322に格納される。
 さらに、矢印343dで示すように、リーフノード211eの直近上位のブランチノード210bの内容を第3の更新ノードとし、ブランチノード210bの配列番号220aを第3の更新位置とする第3の更新データが作成され、更新データ格納領域322に格納される。
図14は、インデックス更新装置で実行される更新データによるインデックス更新処理の概要を説明する図である。
 更新データ格納領域420には、インデックス更新データ作成装置300から送信され、更新データ取得手段440で受信され格納された更新データ380a~38d0dが設定されている。
 更新データ380a、380bは、それぞれ差分データ390aのキー321d及び差分データ390bのキー321bを削除キーとした差分ツリーの削除処理により作成されたものである。
 また、更新データ380c、380dは、それぞれ差分データ390cのキー322c及び差分データ390dのキー322bを挿入キーとした差分ツリーの挿入処理により作成されたものである。
 更新処理の開始前の更新ツリー4090にはインデックス更新データ作成装置300の更新処理前の差分ツリー3090(図10に示す)と同一のインデックスキーが格納されている。それだけではなく、配列の同一の配列番号の配列要素には差分ツリー3090と更新ツリー4090の同一のノードが配置されている。
 キー321dに基づく更新データ380a及びキー321bに基づく更新データ380bにより、更新ツリー4090からキー321d、321bが削除され、キー322cに基づく更新データ380c及びキー322bに基づく更新データ380dにより、更新ツリー4090にキー322c、322bが挿入されて更新後の差分ツリー4091が得られる。
図15は、更新データによるインデックス更新の処理フロー例を示す図である。
 図15に示すように、ステップS1501において更新ツリーを設定し、ステップS1502において更新データを設定する。更新ツリーの設定は、図8Bに示す更新ツリー取得手段430による差分ツリーの取得、すなわち更新ツリーのルートノードの配列番号を取得し設定することにより行われる。更新データの設定は、更新データ取得手段440により、インデックス更新データ作成装置から受信した更新データを更新データ格納領域420に格納することにより行われる。
ステップS1503に進み、全ての更新データは処理済みか判定する。すべての更新データが処理済みであれば処理を終了し、すべての更新データが処理済みでなければ、ステップS1504に進む。
ステップS1504では、更新データ格納領域から更新データを読み出し、読み出した更新データから、更新位置と更新ノードを取り出し、ステップS1505において、更新位置の指す更新ツリーの配列要素に、更新ノードを書き込み、ステップS1503に戻る。
上記ステップS1503~ステップS1505のループ処理を、ステップS1503において全ての更新データを処理済みと判定するまで繰り返し、全ての更新データを処理済みと判定すると処理を終了する。
本発明に係るインデックス更新装置は、上述のステップS1505の処理にあるように、更新データの更新位置の指す配列番号の配列要素を更新データの更新ノードで書き換えることにより、インデックスの更新を実行する。したがって、インデックス更新の処理負担は、更新ツリーの削除処理と挿入処理を行う場合と比べて軽くなる。
 次に図16A~図16Eを参照して、本発明の一実施の形態における、更新データに基づく更新ツリーの書換処理の流れを更新データ380a~380d毎に説明する。更新データは、インデックスデータ作成装置から送信されたものであるから、図13A~図13Eで例示した更新データと同一である。また、図16A~図16Eに示す更新ツリーの構造と各ノードの内容も、図13A~図13Eで例示した差分ツリーとそれぞれ対応し、同一のものとなる。
図16Aには、更新データ380aによる更新前の更新ツリー4090が記載されている。
 図16Aの矢印360aで示すように、更新データ380aの更新位置383は221b+1であるので、ノード211fが書き換え対象となる。
図16Bには、更新データ380aによる書き換え後、更新データ380bによる書き換え前の更新ツリー4092が記載されている。
 ノード211fは、差分キー321dを格納していた更新ツリー4090のノード210hと対をなすノード211hに書き換えられている。
そして、図16Bの矢印360bで示すように、更新データ380bの更新位置383は220aであるので、ノード210bが書き換え対象となる。
図16Cには、更新データ380bによる書き換え後、更新データ380cによる書き換え前の更新ツリー4093が記載されている。
 ノード210bは、差分キー321bを格納していた更新ツリー4090のノード211cと対をなすノード210cに書き換えられている。
 そして、矢印3601c、3602cで示すように、代表ノードの配列番号が220fである空ノード対201gが書き換え対象となる。また、矢印3603cで示すように、更新データ380cのうち第3の更新ノードの格納される配列要素の配列番号は221bなので、ノード210fが書き換え対象となる。
図16Dには、更新データ380cによる書き換え後、更新データ380dによる書き換え前の更新ツリー4094が記載されている。
 ノード210fは、更新データ380cの第3の更新ノードに書き換えられている。また、ノード210gには更新データ380cのうち第1の更新ノードが、ノード211gには第2の更新ノードが格納されている。
 そして、矢印3601d、3602dで示すように、代表ノードの配列番号が220bである空ノード対201eが書き換え対象となる。また、矢印3603dで示すように、更新データ380dのうち第3の更新ノードの格納される配列要素の配列番号は220aなので、ノード210bが書き換え対象となる。
図16Eには、更新データ380dによる書き換え後、すなわち全更新データによる書きかえ後の更新ツリー4091が記載されている。更新ツリー4091には、ノード対201eがノード210bの下に挿入され、挿入キーを含むリーフノードはノード211eである。
 更新ツリー4091は差分ツリー3091と全く同一であり、このようにして、インデックス更新データ作成装置とインデックス更新装置の間のインデックスの同期をとることができる。
 つまり、インデックス更新データ作成装置で作成される更新データは、差分データによる挿入処理や削除処理に関わらず、更新された差分ツリーのうち更新されたノードの位置情報である更新位置とそのノードの内容である更新ノードであり、インデックス更新装置において、更新データの更新位置のノードの内容を更新ノードで書き換えることにより更新ツリーを更新して、差分ツリーと更新ツリーを容易に同期させることができる。
以上詳細に説明したところから明らかなとおり、本発明によればカップルドノードツリーを活用した、データベースのインデックスを旧データのものから新データに効率よく更新するためのインデックス更新データを提供することができ、また、本発明のインデックス更新データにより、インデックス更新装置の処理負担を軽減することができる。
 また、本発明の実施の形態は上記に限ることなく種々の変形が可能であることは当業者に明らかである。さらに、本発明のインデックス更新データ作成装置及び作成方法、さらにはインデックス更新装置及び更新方法を、コンピュータに実行させるプログラムによりコンピュータ上で実現可能なことは明らかである。
 したがって、上記プログラム、及びプログラムを記憶したコンピュータ読み取り可能な記憶媒体は、本発明の実施の形態に含まれる。
300   インデックス更新データ作成装置
301   データ処理装置
302   中央処理装置
303   キャッシュメモリ
304   バス
305   主記憶装置
306   外部記憶装置
307   通信装置
308   データ格納装置
309   配列
310   探索経路スタック
320   差分データ格納領域
322   更新データ格納領域
330   差分ツリー取得手段
340   差分データ取得手段
350   更新データ作成手段
352   挿入データ作成手段
354   削除データ作成手段
356   更新種別判定手段
380   更新データ
383   更新位置
384   更新ノード
390   差分データ
391   更新種別
392   差分キー
400   インデックス更新装置
409   配列
420   更新データ格納領域
430   更新ツリー取得手段
440   更新データ取得手段
450   更新ツリー更新手段
 
 

Claims (15)

  1.  データベースのインデックスの更新データを作成するインデックス更新データ作成装置と該更新データにより自装置のデータベースのインデックスを更新するインデックス更新装置から構成されるシステムにおける前記インデックス更新データ作成装置において、
     更新前のデータベースのインデックスキーを格納したカップルドノードツリーである差分ツリーを取得する差分ツリー取得手段と、
     更新前のデータベースのインデックスと更新後のデータベースのインデックスの差分データを取得する差分データ取得手段と、
     前記差分データに基づき前記差分ツリーを更新し、該更新された差分ツリーのうち更新されたノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを作成する更新データ作成手段と、
     を備えることを特徴とするインデックス更新データ作成装置。
  2.  請求項1に記載のインデックス更新データ作成装置において、
     前記差分データは、更新対象であるインデックスキーと該インデックスキーが挿入されるものであるか削除されるものであるかを示す更新種別を含み、
     前記更新データ作成手段は、前記更新種別を判定する更新種別判定手段と、該更新種別が挿入であると判定されたときに前記更新データを作成する挿入データ作成手段と、該更新種別が削除であると判定されたときに前記更新データを作成する削除データ作成手段とを含む、
     ことを特徴とするインデックス更新データ作成装置。
  3.  請求項2に記載のインデックス更新データ作成装置において、
     前記挿入データ作成手段は、更新種別が挿入を示すものである前記差分データのインデックスキーを挿入キーとして、前記差分ツリーに該挿入キーを格納するリーフノードを挿入し、該リーフノードの内容を第1の更新ノードとし該リーフノードの位置情報を第1の更新位置とする第1の更新データと、該リーフノードと対をなす対ノードの内容を第2の更新ノードとし該対ノードの位置情報を第2の更新位置とする第2の更新データを作成するとともに、更新後の差分ツリーにおける前記リーフノードの直近上位のブランチノードの内容を第3の更新ノードとし該ブランチノードの位置情報を第3の更新位置とする第3の更新データを作成し、
    前記削除データ作成手段は、更新種別が削除を示すものである前記差分データのインデックスキーを削除キーとして、前記差分ツリーから該削除キーと同一のインデックスキーを格納するリーフノードを削除し、該リーフノードと同一のノード対を構成するノードの内容を前記更新ノードとし更新前の差分ツリーにおける前記リーフノードの直近上位のノードの位置情報を前記更新位置として更新データを作成する、
    ことを特徴とするインデックス更新データ作成装置。
  4.  請求項1~請求項3のいずれか1項に記載されたインデックス更新データ作成装置において、
     前記差分ツリーは配列に記憶され、前記ノードの位置情報は、該ノードの配置された配列要素の配列番号であることを特徴とするインデックス更新データ作成装置。
  5.  データベースのインデックスの更新データを作成するインデックス更新データ作成装置と該更新データにより自装置のデータベースのインデックスを更新するインデックス更新装置から構成されるシステムにおける前記インデックス更新データ作成装置がインデックスの更新データを作成するインデックス更新データ作成方法において、
     更新前のデータベースのインデックスキーを格納したカップルドノードツリーである差分ツリーを取得する差分ツリー取得ステップと、
     更新前のデータベースのインデックスと更新後のデータベースのインデックスの差分データを取得する差分データ取得ステップと、
     前記差分データに基づき前記差分ツリーを更新し、該更新された差分ツリーのうち更新されたノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを作成する更新データ作成ステップと、
     を備えることを特徴とするインデックス更新データ作成方法。
  6.  請求項5に記載のインデックス更新データ作成方法において、
     前記差分データは、更新対象であるインデックスキーと該インデックスキーが挿入されるものであるか削除されるものであるかを示す更新種別を含み、
     前記更新データ作成ステップは、前記更新種別を判定する更新種別判定ステップと、該更新種別が挿入であると判定されたときに前記更新データを作成する挿入データ作成ステップと、該更新種別が削除であると判定されたときに前記更新データを作成する削除データ作成ステップとを含む、
     ことを特徴とするインデックス更新データ作成方法。
  7.  請求項6に記載のインデックス更新データ作成方法において、
     前記挿入データ作成ステップは、更新種別が挿入を示すものである前記差分データのインデックスキーを挿入キーとして、前記差分ツリーに該挿入キーを格納するリーフノードを挿入するステップと、該リーフノードの内容を第1の更新ノードとし該リーフノードの位置情報を第1の更新位置とする第1の更新データと、該リーフノードと対をなす対ノードの内容を第2の更新ノードとし該対ノードの位置情報を第2の更新位置とする第2の更新データを作成するステップと、更新後の差分ツリーにおける前記リーフノードの直近上位のブランチノードの内容を第3の更新ノードとし該ブランチノードの位置情報を第3の更新位置とする第3の更新データを作成するステップを含み、
    前記削除データ作成ステップは、更新種別が削除を示すものである前記差分データのインデックスキーを削除キーとして、前記差分ツリーから該削除キーと同一のインデックスキーを格納するリーフノードを削除するステップと、該リーフノードと同一のノード対を構成するノードの内容を前記更新ノードとし更新前の差分ツリーにおける前記リーフノードの直近上位のノードの位置情報を前記更新位置として更新データを作成するステップを含む、
    ことを特徴とするインデックス更新データ作成方法。
  8.  請求項5~請求項7のいずれか1項に記載されたインデックス更新データ作成方法において、
     前記差分ツリーは配列に記憶され、前記ノードの位置情報は、該ノードの配置された配列要素の配列番号であることを特徴とするインデックス更新データ作成方法。
  9.  請求項5~請求項8のいずれか1項に記載のインデックス更新データ作成方法をコンピュータに実行させることを特徴とするプログラム。
  10.  データベースのインデックスの更新データを作成するインデックス更新データ作成装置と該更新データにより自装置のデータベースのインデックスを更新するインデックス更新装置から構成されるシステムにおける前記インデックス更新装置において、
     更新前のデータベースのインデックスキーを格納したカップルドノードツリーである前記更新ツリーを取得する更新ツリー取得手段と、
     前記インデックス更新データ作成装置から更新すべき前記更新ツリーのノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを取得する更新データ取得手段と、
     前記更新データの更新位置のノードの内容を更新ノードで書き換えることにより前記更新ツリーを更新する更新ツリー更新手段と、
     を備えることを特徴とするインデックス更新装置。
  11.  請求項10に記載のインデックス更新装置において、
     前記更新ツリーは配列に記憶され、前記更新位置は、前記更新すべきノードが配置された配列要素の配列番号であることを特徴とするインデックス更新装置。
  12. データベースのインデックスの更新データを作成するインデックス更新データ作成装置と該更新データにより自装置のデータベースのインデックスを更新するインデックス更新装置から構成されるシステムにおける前記インデックス更新装置がインデックスを更新するインデックス更新方法おいて、
     更新前のデータベースのインデックスキーを格納したカップルドノードツリーである前記更新ツリーを取得する更新ツリー取得ステップと、
     前記インデックス更新データ作成装置から更新すべき前記更新ツリーのノードの位置情報である更新位置とそのノードの内容である更新ノードからなるインデックスの更新データを取得する更新データ取得ステップと、
     前記更新データの更新位置のノードの内容を更新ノードで書き換えることにより前記更新ツリーを更新する更新ツリー更新ステップと、
     を備えることを特徴とするインデックス更新方法。
  13.  請求項12に記載のインデックス更新方法において、
     前記更新ツリーは配列に記憶され、前記更新位置は、前記更新すべきノードが配置された配列要素の配列番号であることを特徴とするインデックス更新方法。
  14.  請求項12又は請求項13に記載のインデックス更新方法をコンピュータに実行させることを特徴とするプログラム。
  15.  請求項9又は請求項14に記載のプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。
     
PCT/JP2010/002341 2009-04-28 2010-03-31 インデックス更新データ作成装置、作成方法及びプログラム WO2010125742A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009110080A JP2010257427A (ja) 2009-04-28 2009-04-28 インデックス更新データ作成装置、作成方法及びプログラム
JP2009-110080 2009-04-28

Publications (1)

Publication Number Publication Date
WO2010125742A1 true WO2010125742A1 (ja) 2010-11-04

Family

ID=43031902

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/002341 WO2010125742A1 (ja) 2009-04-28 2010-03-31 インデックス更新データ作成装置、作成方法及びプログラム

Country Status (2)

Country Link
JP (1) JP2010257427A (ja)
WO (1) WO2010125742A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111527189A (zh) * 2017-12-29 2020-08-11 荷兰联合利华有限公司 非球形微囊
CN113419739A (zh) * 2021-06-22 2021-09-21 网易(杭州)网络有限公司 节点图差异检测方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000231506A (ja) * 1999-02-12 2000-08-22 Nec Corp 木構造データ編集システムにおける木構造差分出力方法及び装置
JP2001067260A (ja) * 1999-08-30 2001-03-16 Jisedai Joho Hoso System Kenkyusho:Kk 送信装置および送信方法、受信装置および受信方法、ならびに、送受信システムおよび送受信方法
JP2001166973A (ja) * 1999-12-13 2001-06-22 Jisedai Joho Hoso System Kenkyusho:Kk コンテンツ同時変更方法及び装置
JP2001189069A (ja) * 1999-12-28 2001-07-10 Matsushita Electric Ind Co Ltd 変更操作情報記録方法及び装置
JP2008015872A (ja) * 2006-07-07 2008-01-24 S Grants Co Ltd ビット列検索装置、検索方法及びプログラム

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000231506A (ja) * 1999-02-12 2000-08-22 Nec Corp 木構造データ編集システムにおける木構造差分出力方法及び装置
JP2001067260A (ja) * 1999-08-30 2001-03-16 Jisedai Joho Hoso System Kenkyusho:Kk 送信装置および送信方法、受信装置および受信方法、ならびに、送受信システムおよび送受信方法
JP2001166973A (ja) * 1999-12-13 2001-06-22 Jisedai Joho Hoso System Kenkyusho:Kk コンテンツ同時変更方法及び装置
JP2001189069A (ja) * 1999-12-28 2001-07-10 Matsushita Electric Ind Co Ltd 変更操作情報記録方法及び装置
JP2008015872A (ja) * 2006-07-07 2008-01-24 S Grants Co Ltd ビット列検索装置、検索方法及びプログラム

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111527189A (zh) * 2017-12-29 2020-08-11 荷兰联合利华有限公司 非球形微囊
CN113419739A (zh) * 2021-06-22 2021-09-21 网易(杭州)网络有限公司 节点图差异检测方法、装置、电子设备及存储介质
CN113419739B (zh) * 2021-06-22 2022-12-06 网易(杭州)网络有限公司 节点图差异检测方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
JP2010257427A (ja) 2010-11-11

Similar Documents

Publication Publication Date Title
JP4498409B2 (ja) データベースのインデックスキー更新方法及びプログラム
JP4271214B2 (ja) ビット列検索装置、検索方法及びプログラム
JP4402120B2 (ja) ビット列検索装置、検索方法及びプログラム
JP4271227B2 (ja) ビット列検索装置、検索方法及びプログラム
JP2670383B2 (ja) 部分キー分岐機能を備えたプレフィックス探索ツリー
JP5473893B2 (ja) コード列検索装置、検索方法及びプログラム
US8332410B2 (en) Bit string merge sort device, method, and program
JP4379894B2 (ja) カップルドノードツリーの分割/結合方法及びプログラム
US8214405B2 (en) Longest-match/shortest-match search apparatus, search method, and program
JP4439013B2 (ja) ビット列検索方法及び検索プログラム
JP2008269197A (ja) カップルドノードツリーの退避/復元方法及びプログラム
WO2010125742A1 (ja) インデックス更新データ作成装置、作成方法及びプログラム
JP4491480B2 (ja) インデクス構築方法、文書検索装置及びインデクス構築プログラム
US20100174742A1 (en) Bit string search apparatus, search method, and program
JP4514810B2 (ja) ビット列検索装置、検索方法及びプログラム
JP4417431B2 (ja) カップルドノードツリーの分割/結合方法及びプログラム
JP2011018296A (ja) カップルドノードツリーのインデックスキー挿入/削除方法
JP2009169715A (ja) ビット列検索装置、検索方法及びプログラム
JP4813575B2 (ja) ビット列検索装置
WO2009093290A1 (ja) ビット列検索装置、検索方法及びプログラム

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10769444

Country of ref document: EP

Kind code of ref document: A1