Transcript Slide 1
13.6 Representing Block and
Record Addresses
RAMYA KARRI
ID: 206
CS257
PROF: DR. T Y LIN
Introduction
Address of a block and Record
In Main Memory
In Secondary Memory
Sequence of Bytes
Device Id
Cylinder number
Etc
Addresses in Client-Server Systems
Pointer Swizzing
Addresses in Client-Server Systems
A server, one or more client processes
Database Address Space
Physical Addresses
Logical Addresses
Physical Address
Host
Identifier for the disk
Number of the cylinder
Number of the track
Offset of the beginning of the record
Addresses in Client-Server Systems (Contd…)
Logical Addresses
Logical Address
Map Table
Logical
Physical
Logical Address
Physical Address
Logical and Structured Addresses
Move the record around within the block
Move the record to another block
Option of deciding what to do when a record is
deleted?
Unused
Rec
ord
4
Offset table
Header
Rec
ord
3
Rec
ord
2
Rec
ord
1
Pointer Swizzling
Management of Pointers
Dbaddr
Mem-addr
Database address
Memory Address
Pointer Swizzling (Contd…)
Pointer
Bit indicating the type of address
Database or memory pointer
Disk
Memory
Swizzled
Block 1
Unswizzled
Block 2
Pointer Swizzling (Contd…)
Automatic Swizzling
When a block is brought into memory, locate all pointers and
addresses and enter them into the translation table
Swizzling on Demand
Leave all unswizzled when the block is first brought into
memory
No Swizzling
Programmer Control of Swizzling
Returning blocks to disk
Where clause can be used
Pinned Records and Blocks
Block cannot go back to disk safely
Unpin a block, we must unswizzle any pointers to it
Each database address whose data item is in memory and
places in memory where swizzled pointers exist.