摘要 |
A method, system, and computer-readable code for embedding a file index among the fixed-length data blocks of a random-access file to which the index pertains. In the preferred embodiment, a B-tree index is used. The nodes of the B-tree are stored using blocks of the random-access file, so that the index records are embedded among the data records to which the index pertains. This technique avoids a number of problems that result when a data file and its index are separately located. Record updates and retrievals operate more efficiently, and the data records remain synchronized with the corresponding index when file operations (e.g., close, flush) complete successfully. In an optional enhancement, synchronization is ensured when record-level operations (write, delete) complete successfully.
|