中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

10.7.1 Database Systems: Sequential File Organization

1. A sequential file is designed for ecient processing of records in sorted order on some search key.

  • Records are chained together by pointers to permit fast retrieval in search key order.
  • Pointer points to next record in order.
  • Records are stored physically in search key order (or as close to this as possible).
  • This minimizes number of block accesses.
  • Figure 10.15 shows an example, with bname as the search key.

2. It is dicult to maintain physical sequential order as records are inserted and deleted.

  • Deletion can be managed with the pointer chains.
  • Insertion poses problems if no space where new record should go.
  • If space, use it, else put new record in an over flow block.
  • Adjust pointers accordingly.
  • Figure 10.16 shows the previous example after an insertion.
  • Problem: we now have some records out of physical sequential order.
  • If very few records in over flow blocks, this will work well.
  • If order is lost, reorganize the file.
  • Reorganizations are expensive and done when system load is low.

3. If insertions rarely occur, we could keep the file in physically sorted order and reorganize when insertion occurs. In this case, the pointer fields are no longer required.

  Database System Structure: