ADD

Tuesday, 17 May 2016

RECORDS

RECORDS 


Definition : A record is collection of data items and is the unit for data storage at the logical or file level. 
     A record may consist of different fields and each field corresponds to an attribute (column) of the record. For example, a student record has fields such as student name, courses, class, roll number and grade.

Spanned and Unspanned Records : 
      The records may be of fixed size, or may be variable in length. One block (also sometimes called a physical record) may contain multiple records. 

Unspanned Records Definition : When many records are restricted to fit within one block due to their small size then such records are called Unspanned Records. 

Spanned Records : When (portions of ) a single record may lie in different blocks, due to their large size, then such records are called Spanned Records

Blocking of Records : Different methods of arranging records in blocks, is called as blocking of records.
The blocking of records is done in three ways, shown as follows  
1 . fixed blocking or fixed - length records 
       i ) . Waste due to interblock gap 
      ii ) . Waste due to track size 
     iii ) . Waste due to records cannot fit in remaining portion of the block.
2 . Variable blocking for unspanned records 
3 . Variable blocking for spanned records 

BLOCKING FACTOR 
The ratio B/R where R is the record size and Bis the equal length of number of blocks Then above figures, a portion of the block would be wasted and add to the Gap G For variable length unspanned    records there is wasted space in blocks. However, the greater the radio of block length of the mean record length, the less will be the space that is wasted. 
                 Thus for fixed blocking 

                                               W  = GRm/B           
where W     ----->  calculate average waste per record 
           G      ----->  gap size 
           Rm   ----->  mean record length 
            B     ----->  equal length of number of blocks.
While retrieving or storing records in a block, it is necessary to identify where records begin or and. Such blocking information may be a part of each block, called a block header. For fixed blocking, only record length needs to be known to locate a particular record in block. However, for variable length records, the data describing the blocking must be available in the block header. Different techniques are available to identify variable length records such as making from the end - of - records or from the beginning of record. this is done by storing pointer values corresponding to each records per block. in the case of spanned records, we also need to store in each block a block pointer which points to the successor block where the remaining portion of the spanned record is stored. storing such pointer will load to further wastage of the block space.
For spanned records, the average waste per record can be expressed as
                                     W = (G + P) Rm/B + P
The spanned records have the advantage that,unlike unspanned blocking, there is no space wastage in the blocks due to the inability to pack variable length records into a fixed length block. However, Spanned records are usually difficult to implement and updating of such records creates problems. Hence, unspanned records or generally prepared and the average waste space may be reduced by increasing the mean blocking factor i.e., using either larger blocks or smaller blocks.

                                 

3 comments: