4.2.5 Index File Maintenance



As the previous section might have implied, sequential or indexed sequential files that have the reusing deleted record option set are practically maintenance free. The same is true of the RMS index file used for the B-tree indexes. A special root page pointer is the head of a linked list of unused index pages. When keys are being deleted from an index, sometimes two or more pages are condensed into one index page. The extra page is added to the unused index page list.

As keys are being added to an index, there are times when one index page must be split into two pages. If there are any unused index pages in the list, they are used. Otherwise, a new page is appended to the end of the RMS index file. This reuse of index pages make index files maintenance free.