UNIHIVE

Study Hub UNIPORT CSC 283

CSC 283 · Information Systems and File Structures

File organisation and file operations

The main ways to organise a file, the operations performed on files, and how to choose the right organisation.

Our notes

2 min read

File organisation and access method

  • File organisation is how records are arranged on the storage device.
  • Access method is how a program gets to a record: sequentially (one after another) or directly (straight to the one wanted).

The organisation limits which access methods are efficient.

The four classic organisations

OrganisationArrangementAccessDevice
Serialin the order they arrive, no key ordersequential onlytape or disk
Sequentialin order of the primary keysequential (binary search possible on disk)tape or disk
Indexed sequentialin key order, plus an indexsequential and directdisk
Direct (random, relative, hashed)position worked out from the keydirectdisk

Operations on files

  • Create: set up a new file and write its first records.
  • Open / close: connect the program to the file and release it.
  • Read / retrieve: fetch a record (next one or by key).
  • Write / insert: add a record.
  • Update / amend: change fields of an existing record.
  • Delete: remove a record, often first by marking it deleted (a tombstone) and removing it later.
  • Sort and merge: reorder records or combine two ordered files.
  • Search / query: find records that meet a condition.

Hit rate (activity ratio)

Hit rate = records accessed in a run ÷ records in the file × 100%.

  • High hit rate (payroll: every employee is paid): sequential processing is efficient.
  • Low hit rate (an enquiry about one student): direct access is needed.

Example: 300 transactions touch a 20,000-record master file: hit rate = 300 ÷ 20,000 = 1.5%. Reading the whole file sequentially to update 1.5% of it wastes most of the run, so direct or indexed access is better.

Volatility and growth

  • Volatility: how often records are added and deleted. A very volatile file is awkward in sequential form (every insert means rewriting) and suits direct or indexed organisation with free space.
  • Growth: files that grow fast need room for expansion (overflow areas, spare buckets).

Choosing an organisation

Ask:

  1. Hit rate per run.
  2. Response time needed (batch overnight or seconds at a counter).
  3. Volatility and growth.
  4. Device available (tape allows only serial and sequential).
  5. Size of the file and cost of storage.

Exams usually ask

  • Name and compare the four file organisations.
  • Define hit rate and volatility and explain how they affect the choice.
  • List file operations.

Common mistake

Calling a serial file sequential. Both are read one record after another, but only a sequential file is in key order; a serial file is in arrival order.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

No reading links here yet

Our team adds free books, videos and practice for each topic, and opens every link before it goes up.

All CSC 283 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.