Patent ID: 8527481

Claim:
A method for correcting an index record, the method comprising: receiving an initial index record having descriptions of either data records or other index records; determining that the initial index record includes descriptions of data records or descriptions of other index records; for the initial index record which includes descriptions of data records: determining that the initial index record is valid; for the valid index record: locating a desired index entry from the valid index record; and retrieving a last index entry of the valid index record; reading all data records to be described in a corrected index record; storing a key and a location for each of the read data records; sorting the read data records sequentially by key; creating the corrected index record for all the read data records; and storing the corrected index record; for the initial index record which includes descriptions of other index records: storing a key from a first index entry; storing an index level for a first index record in the first index entry; locating a next index record having the stored index level; storing a key for the next index record having the stored index level; storing a location for the next index record having the stored index level; locating and reading a highest level index record; locating an index record having the stored key from the first index entry; proceeding to a next index level until the stored index level is reached; determining that the index record arrived at is to be rebuilt, otherwise producing an error; retrieving a previous index record having the stored index level; retrieving a last index entry from the previous index record; initializing a high level index record to be rebuilt; retrieving a lower level index record and adding an index entry relating to the lower level index record retrieved to the high level index record to be rebuilt until no more lower level index records have the stored index level in the first index entry; and storing the high level index record.