Thursday 17 February 2011

Shadow Paging

This technique does not require LOG in single user environment
  • In multi-user may need LOG for concurrency control method
  • Shadow paging considers
    • The database is partitioned into fixed-length blocks referred to as PAGES.
    • Page table has n entries – one for each database page.
    • Each contain pointer to a page on disk (1 to 1st page on database and so on…).
The idea is to maintain 2 pages tables during the life of transaction.
    • The current page table
    • The shadow page table
When transaction starts, both page tables are identical
    • The shadow page table is never changed over the duration of the transaction.
    • The current page table may be changed when a transaction performs a write operation.
    • All input and output operations use the current page table to locate database pages on disk.
Advantages

  • No Overhead for writing log records.
  • No Undo /  No Redo algorithm.
  • Recovery is faster.
Disadvantages
  • Data gets fragmented  or scattered.
  • After every transaction completion database pages containing old version of modified data need to be garbage collected.
  • Hard to extend algorithm to allow transaction to run concurrently.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Grants For Single Moms