Explore BrainMass
Share

Compare the Two Non-Sequential File Structure Models

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Compare the two non-sequential file structure models: the random (hashed) file and the index file. What advantages does the first one have over the second and what advantages does the second have over the first? What would be your criteria for choosing one over the other for different applications?

© BrainMass Inc. brainmass.com October 24, 2018, 7:47 pm ad1c9bdddf
https://brainmass.com/computer-science/control-structures/compare-the-two-non-sequential-file-structure-models-78731

Solution Preview

If selection queries are frequent, sorting the file or building an index is important.
Hash-based indexes only good for equality search.

The advantage of ordering records in a sequential file according to a key is that you can then search the file more quickly. If you know the key value that you want, you can use one of the relatively fast searches. The disadvantage is that when you insert, you need to rewrite at least everything after the insertion point, which makes inserts very expensive unless they are done at the end of the file.

INDEXED FILE
=========
An indexed file approach keeps a (hopefully) small part of each row, and some kind of "pointer" to the row's location within the data file. This allows a search to use the index, which is ordered by the index and (again hopefully) much smaller and therefore much faster than scanning the entire data file for the indexed data.

- Indexed files allow direct access and sequential ...

Solution Summary

This solution discusses the pros, cons and further background information on indexed files and hashed files in 589 words.

$2.19
See Also This Related BrainMass Solution

What are the differences between random hashed files and index files? Compare and contrast both these non-sequential file structure models.

Compare the two non-sequential file structure models: the random (hashed) file and the index file. What advantages does the first one have over the second and what advantages does the second have over the first? What would be your criteria for choosing one over the other for different applications?

View Full Posting Details