Download presentation
1
Representing Block & Record Addresses
Presented By Meenakshi Mali ID: 206
2
Outline Types of Addresses Pointer Swizzling Returning Blocks to Disk
Automatic swizzling Swizzling on demand No swizzling Programmer control of swizzling Returning Blocks to Disk Pinned Records and Blocks
3
Types of Addresses What is address? continued..
Commonly, database system consists of Client – Server architecture Client application uses virtual address space Server uses database address space, referred to as blocks continued..
4
Types of Addresses Physical Address Logical Address
Byte strings referring to the place within secondary storage where data(record) is saved Logical Address Arbitrary string of bytes of some fixed length that maps to physical address continued..
5
Map Table
6
More on Logical Address
Purpose Easy updating of records Structured address
7
Pointer Swizzling As discussed earlier, every record in memory has two forms of addresses We can use either to access record When block is moved from secondary storage to main memory pointers within block are “swizzled”,i.e translated from database address space (Server) to virtual address space (Client) Consists of a bit indicating if pointer is currently a database address or memory address The database or memory pointer itself
8
Pointer Swizzling
9
Types of Swizzling Automatic Swizzling Swizzling on Demand
Whenever a block is moved to main memory swizzle all its pointers Swizzling on Demand Leave all pointers unswizzled when block is first loaded into memory, swizzle the pointer only if we need to follow it Programmer Control of Swizzling No Swizzling Never swizzle the pointers. Advantage is there is no need to load record in main memory
10
Returning Blocks to Disk
When a block is moved from memory back to disk, any pointers within that block must be unswizzled, i.e. memory address must be replaced by database address.
11
Pinned Records and Blocks
‘Pinned’ means if the block cannot be written back to disk safely 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
12
Thank You
13
Any Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.