1 / 10

Overview

Database systems the complete book 13.8. record modification By Ahmad Yazdankhah ( ID 219) CS 257 P rof.: T. Y. Lin San José State University SPRING 2011. Overview. What problems we would have during: Insertion Deletion Update. 13.8.1 . Insertion. What would we do for record insertion?

nicole
Télécharger la présentation

Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database systemsthe complete book13.8. record modificationByAhmad Yazdankhah(ID 219)CS 257Prof.: T. Y. LinSan José State UniversitySPRING 2011

  2. Overview What problems we would have during: • Insertion • Deletion • Update

  3. 13.8.1. Insertion • What would we do for record insertion? • Find a block with enough empty space • Get a new block • But what would happen if we should insert the record in a specific block?

  4. 13.8.1. Insertion (cont’d) • There are two possibilities: • There is enough room in the target block • There is not enough room in the target block • In the 1st case, insert and update the offset table • In the 2nd case, there are two approaches: • Find space on a nearby block and slide the records • Create an overflow block

  5. 13.8.1. Insertion (cont’d) • What is an overflow block? • It is another block in which we put the records that theoretically belong to this block. • In block’s header, there is a pointer to an overflow.

  6. 13.8.2. Deletion • The usual technique is to put a tombstone in place of the record. • This is not the case that we delete the record physically. • This is a permanent tombstone until the database is reconstructed.

  7. 13.8.2. Deletion (cont’d) • Where to put the sign of deletion? • If using offset table in the block header, put null in the pointer’s place • If using a map table, put null in physical address

  8. 13.8.3. Update • No problem if fixed length records • The problems arise for variable length records • We have all problems mentioned for insertion and deletion

  9. 13.8.3. Update (cont’d) • If the new record is shorter: • Slide down the records to consolidate the free spaces • If the new record is longer: • Slide down the records to make room • Create an overflow block

  10. Thank You

More Related