Index Organized File

What
An index organized file is one in which the actual records are stored as leaves in the index

Details

 * Only one index on a set of records can be organized this way. This is because we are using the actual data and we want to avoid repeating data.

Advantages

 * Saves pointer lookup at the leaf node. We don't have to do an additional pointer lookup because we already have the data

Disadvantages

 * Expensive to maintain on insertion and delete

Cost of Operations
For the calculations, we will use the following values:
 * B: The number of data pages
 * R: The number of records per page
 * D: (Average) time to read or write disk page
 * F: Fan out of the index organized file

Scan
A scan of all the pages in the file will result in cost $$1.5BD$$ because it has been shown through extensive empirical study that pages are usually at about 67 percent occupancy. Therefore, for the same amount of data, we end up with more pages.

Equality Search
We end up saving a lot of time on equality search due to the structure of the index. The total cost of an equality search is simply $$(log_F1.5B)D$$

Range Search
Range search structure is very similar to that of sorted files. Basically, we need to find the beginning of the range, and then do scans of the data pages to retrieve all the records. This comes out to $$[(log_F1.5B) + \textrm{matching~pages}]*D$$

Insert
We see an interesting result here when inserting because we assume that most of the time, the leaf page has sufficient space for the new record. Therefore, the cost is $$(log_F1.5B + 1)*D$$. The extra 1 term is to account for the fact that we must write the data out to disk.

Delete
Same as insert