Efficiency, Indexing, Physical Design Flashcards
Why should we study efficiency
If databases and DBMS don’t run fast enough to be useful, then the point is missed entirely.
Main Memory (RAM)
Volatile, fast, small, and expensive
Secondary Memory (DISK)
Permanent, slow, big, and cheap
Main Memory Access Time
30ns (.3 x 10^-7 sec)
Disk Access Time
10ms (1 x 10^-2)
Only this cost (I/O) is calculated
Parts of the Disk
Read/Write Head Actuator Arm Spindle Track/Cylinder Sector Block Platters
Spanned Representation
Where a record is split up between two blocks of disk memory
Unspanned Representation
Where a record exists on a single block on disk memory
Why not fill up a block with data?
We may want to leave space at the end of a block in case we need to insert new records.
Target is 80% filled.
File
A series of blocks linked by address pointers.
Seek Time
Time it takes to find a block on disk. Costs 3-8ms
Rotation Delay
Time it takes for the disk to rotate to a block. Costs 2-3ms
Transfer Time
Time it takes for I/O to deliver the data via data bus to Main Memory. Costs .5-1ms
LRU buffer management strategy
When we run out of buffer space and need to free some, the least recently used space will be overwritten.
Excellent for Merge Joins
Kills Nested loop joins
Heap
Unsorted file of data.