index file in memory because it' so much smaller than the file containing actual recordsit may be that the index is small enough to fit entirely in main memory in our example there are , records each one has -byte entry in the indexso the index will be , or , , bytes long ( megabytesin modern computers there' no problem fitting this in memory the index can be stored on the diskbut read into memory whenever the database program is started up from then onoperations on the index can take place in memory at the end of the day (or perhaps more frequentlythe index can be written back to disk for permanent storage searching the index-in-memory approach allows much faster operations on the phone book file than are possible with file in which the records themselves are arranged sequentially for examplea binary search requires index accesses at microseconds per accessthat' only about / , of second then there' (inevitablythe time to read the actual record from the fileonce its block number has been found in the index howeverthis is only one disk access of (say milliseconds insertion to insert new item in an indexed file two steps are necessary we first insert its full record into the main filethen we insert an entryconsisting of the key and the block number where the new record is storedinto the index because the index is in sequential orderto insert new item we need to move half the index entrieson the average figuring microseconds to move byte in memorywe have , times times or about seconds to insert new entry this compares with five minutes for the unindexed sequential file (note that we don' need to move any records in the main filewe simply append the new record at the end of the file of courseyou can use more sophisticated approach to storing the index in memory you could store it as binary treetreeor red-black treefor example any of these would significantly reduce insertion and deletion times in any case the index-in-memory approach is much faster than the sequential-file approach in some cases it will also be faster than -tree the only actual disk accesses necessary for an insertion into an indexed file involve the new record itself usually the last block in the file is read into memorythe new record is