1 / 19

Representing Block and Record Addresses

Representing Block and Record Addresses. Rajhdeep Jandir ID: 103. Agenda. Background Client-Server Systems Logical and Structured Addresses Pointer Swizzling. Background.

anana
Download Presentation

Representing Block and Record Addresses

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. Representing Block and Record Addresses Rajhdeep Jandir ID: 103

  2. Agenda • Background • Client-Server Systems • Logical and Structured Addresses • Pointer Swizzling

  3. Background • Need to know about second storage address representation to see how the addresses, pointers, or references to records and blocks can be represented • In secondary storage: sequence of byted describes the location of the block within the overall system of data accessible to the DBMS. • Record can be found by giving its block and offset of the first byte of the record within the block.

  4. Client-Server Systems • A db consists of server that provides data from secondary storage to client process • Client-Server process can be on one machine or on multiple machines

  5. Client-Server Systems Contd. • Client applications use “virtual” address space: • Typically 32 bits or 4 billion different addresses • OS or DBMS decides which part of the address space are currently located in MM and hw maps VA space to physical location in MM • For us think of client address space as MM

  6. Client-Server Systems Contd. • There are two ways that addresses of the server’s data can be represented: • Physical Addresses • Logical Addresses

  7. Client-Server Systems Contd. • Physical Address: • Byte strings used to determine where the block or record is in the secondary storage • One or more bytes of the string are used to indicate the following 6 things

  8. Client-Server Systems Contd. • The host to which the storage is attached to • An identifier to recognize which block is the data on • The cylinder number on the disk • The track number of the disk • The block number of the track • The offset of the beginning of the record within the block (some cases)

  9. Client-Server Systems Contd. • Logical Addresses: • Each block/record has a “logical address” which is an arbitrary string of bytes of some fixed length. • Map Table: In a disk in a known location • Map Table relates logical to physical addresses

  10. Client-Server Systems Contd. • Physical Addresses are long – 8 bytes minimum and can be as long as 16 bytes. • Ex. A db lasts 100 years and may grow to have 1 mil. machines and each machine can create an object every ns. As a result the system creates around 227 objects. This requires a min. of 10 bytes but need more bytes to represent the host, storage unit,…etc.

  11. Logical and Structured Addresses • Purposes of a logical address: • By using a map table can easily move or delete the record to be changed • Structured address schemes are possible through combo of logical and physical addresses • Ex. Can use physical address for block and add key value for the record being referred to. To find the record, use physical address to get the block and find matching key

  12. Logical and Structured Addresses Contd. • Can also have each block have an offset table that holds the offsets of the records within the block. • Table grows from the front and records placed from the back – this way we don’t have to allocate a fixed amount of block header initially

  13. Logical and Structured Addresses Contd. offset table unused header record 4 record 3 record 2 record 1

  14. Logical and Structured Addresses Contd. • Record address is now physical address of block plus offset entry in block’s offset table. • The advantages: • Can move the record around the block easily • Can move the record to another block if there is sufficient space • A tombstone is made in the position where the record has been deleted so that when a pointer goes there it can be replaced by a null pointer

  15. Pointer Swizzling • Pointers/Addresses are for tuples that represent objects and not relations • OO db allow attributes of pointer type so that needs to be represented • Index structures are blocks which have pointers in them

  16. Pointer Swizzling Contd. • Definitions: • Database Address: the data is in the secondary storage for the server’s db to access • Memory Address: address in virtual memory • Efficient to use MA when item has a pointer • DA time-consuming – need a translation table

  17. Pointer Swizzling Contd. DA MA database address memory address

  18. Pointer Swizzling Contd. • Note: • Logical and physical address represented in DA. MA in TT for copied of corresponding object in memory • All addressable items in db have entries in map table vs only items in memory are in TT

  19. Pointer Swizzling Contd. • Pointer swizzling is a technique to avoid repeated translation from DA to MA • Move a block from MM pointers from block mey be “swizzled” – translated from DA space to VA space • Pointer has: • Bit: indicates if DA or SMA • Database or memory pointer

More Related