ADD

Wednesday, 18 May 2016

PINNED AND UN PINNED RECORDS

Pinned and Unpinned Records 

A record is said to be pinned down or pinned record if there exists a pointer to it somewhere in the database. For example, when a table look up approach is used to locate a record, the table contains a pointer to the record and the record becomes pinned down. The pinned records cannot be moved without reason randomly because in that case the pointers pointing to these records will dangle. Any movement of pinned records should be associated with appropriate modification of the pointers. In fact, the file organization method which maintain pointers to pinned records, appropriate modify these pointer whenever the records are inserted or deleted. 
A record is said to be unpinned record, if there does not exist any pointer pointing to it in the database. In fact, it is the independent record.

Pinned Records and Blocks 

  • 'pinned' means if the block cannot be written back to disk safety
  • indicated by a bit located in the header of the block
  • To write a pinned block back to disk we need to 'unpin' the block
  • Unswizzle any pointers associated to it.

 

Pinning and Unpinning of Pages 

       In buffer pool if some frame contains the requested page, the pin - count variable is incremented of that frame. So, increasing pin- count is called pinning the requested page in its frame. When the request of the requester is fulfilled, the pin - count variable is decrement of that frame and releases the page. This is called unpinning the page. 
       However, it is the buffer manager's (software) responsibility to pin a page. Whereas, it is the responsibility of the requestor of that page to tell the buffer manager to unpin a page.
    The buffer manager will not read another page into a frame unit its pin-count becomes, 0 (zero) that is,until all requestors of the page have unpinned it. If the requestor has modified the page, the Boolean variable : dirty is set as 'on' then it informs the buffer manager of this when it unpins the page to overwrite the old page with page changes and again dirty bit for the frame is set 'off'.

Buffer Replacement Policies 

         As the buffer memory is small, all the data cannot be brought into buffer memory at one time only. So, the DBMS must bring the pages in need, to the buffer memory to process it, decide what existing page buffer memory is to be replace to make space for the new page, collectively known as replacement policy. 
      The policy used to choose the replacement page for replacement can affect the time taken for database operations of the many alternative policies, each is suitable in different situations.
the buffer replacement policies is two types 
(i). Least Recently Used (LRU)
(ii). Clock Replacement.

No comments:

Post a Comment