File organization & File access

File Organization

Serial file organization

The features of serial file orgnization:

  1. Records enter file in chronogical order.
  2. But otherwise, there are no particular order.
  3. Records can only be accessed sequentially/in sequential order.
  4. A typical use is for bank to record the transactions of a customer account.

Sequentail file organization

The features of sequential file orgnization:

  1. The records are ordered in some way, usually sorted according to the values of the key field.
  2. Records in a sequential file can only be accessed sequentially/in sequential order.
  3. It is an improvement to serial file organization. It takes shorter time to search a record in a sequential file than in a serial file.

Sequential file organization with fixed-size records

The features of sequential file organization with fixed-size records:

  1. It’s an improvment to sequential file organization. Each record in the file is of the same size.
  2. Direct access is possible if an index file is provided. An index file stores the key values and positions of relevant records.

Direct-access (random access) file organization

  1. The term random access is a lit bit misleading. The alternative direct-access suggests that record can be accessed directedly.
  2. Usually a hash algorithm is ued to get the postion of a record from its key value. The hash algorithm is implemented as a hash function generally. The function takes in the key value and generats an integer as the postion of the record with the key value. when searching a record in the file, the hash function is used to locate the postion of the record.
  3. A direct-access file can be access sequentially. The essence of direct-access file organization is to provide the ability to access records directly. Searching a record in a direct-access file is much faster than in a serial or sequentail file.

Methods of file access

Sequential accessDirect access
Serial Organization×
Sequential Organization×
Sequential Organization with index file
Direct access organization
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值