stored entirely in main memory (often called ramfor random access memoryhoweverin many situations the amount of data to be processed is too large to fit in main memory all at once in this case different kind of storage is necessary disk files generally have much larger capacity than main memorythis is made possible by their lower cost per byte of storage of coursedisk files have another advantagetheir permanence when you turn off your computer (or the power fails)the data in main memory is lost disk files can retain data indefinitely with the power off howeverit' mostly the size difference that we'll be involved with here the disadvantage of external storage is that it' much slower than main memory this speed difference means that different techniques must be used to handle it efficiently as an example of external storageimagine that you're writing database program to handle the data found in the phone book for medium-sized cityperhaps , entries each entry includes nameaddressphone numberand various other data used internally by the phone company let' say an entry is stored as record requiring bytes the result is file size of , which is , , bytes or megabytes we'll assume that on the target machine this is too large to fit in main memorybut small enough to fit on your disk drive thus you have large amount of data on your disk drive how do you structure it to provide the usual desirable characteristicsquick searchinsertionand deletionin investigating the answersyou must keep in mind two facts firstaccessing data on disk drive is much slower than accessing it in main memory secondyou must access many records at once let' explore these points very slow access computer' main memory works electronically any byte can be accessed just as fast as any other bytein fraction of microsecond ( millionth of secondthings are more complicated with disk drives data is arranged in circular tracks on spinning disksomething like the tracks on compact disc (cdor the grooves in an oldstyle phonograph record to access particular piece of data on disk drivethe read-write head must first be moved to the correct track this is done with stepping motor or similar deviceit' mechanical activity that requires several milliseconds (thousandths of secondonce the correct track is foundthe read-write head must wait for the data to rotate into position on the averagethis takes half revolution even if the disk is spinning at , revolutions per minuteabout more milliseconds pass before the data can be read once the read-write head is positionedthe actual reading (or writingprocess beginsthis might take few more milliseconds thusdisk access times of around milliseconds are common this is something like , times slower than main memory technological progress is reducing disk access times every yearbut main memory access times are being reduced fasterso the disparity between disk access and main memory access times will grow even larger in the future one block at time once it is correctly positioned and the reading (or writingprocess beginsa disk drive can transfer large amount of data to main memory fairly quickly for this reasonand to