Patent ID: 7650354

Claim:
A system for checking index consistency in a database that includes a main database storing a plurality of data segments and an index database storing a plurality of index segments, the system comprising: a computer having a storage unit and a central processing unit, the storage unit providing storage for the main database and the index database and a central processing unit; and a program product for execution on the central processing unit and stored on the storage unit, the program product comprising a record creating unit configured to create a pointer record that contains pointer values and key values by sequentially reading out the index segments from the index database and to create a segment record that contains storage addresses and indexed field values of index target segments to be indexed by sequentially reading out the data segments from the main database; a scan point setting unit configured to set scan points that indicate points up to which the creation of the pointer record and the segment record proceeds; an update log writing unit configured to write, in response to the update of an index segment in the index database or the update of an index target segment in the main database, an update log of the updated segment on condition that the updated segment is located at a point that precedes the scan point set by the scan point setting unit, while the record generating unit is generating the pointer record or segment record; a record modifying unit configured to modify the pointer record and the segment record on the basis of the update log, after the record generating unit has generated the pointer record or segment record; and a consistency verifying unit configured to verify index consistency by sorting the modified pointer record by the pointer value and the modified segment record by the storage address; comparing record entries of the modified pointer record with corresponding record entries of the modified segment record; and if the key value of an entry of the pointer record is the same as the indexed field value of an entry of the segment record with the entries having the same value for the pointer value and the storage address, determining that a consistency error has occurred, and otherwise determining that the consistency is kept.