Cost vs. capacity The first hard drive in 1956 was the IBM 305

Comments

Transcription

Cost vs. capacity The first hard drive in 1956 was the IBM 305
Cost vs. capacity
The first hard drive
in 1956 was the
IBM 305 RAMAC,
and cost $10,000
per MB - it had a
capacity of 5MB!
In PCs it’s normally
on the motherboard,
although there are
also controller cards.
Multiple disks are connected to a computer system through a controller
Controller functionality (checksum, bad sector remapping) often
carried out by individual disks reduced load on controller
Disk interface standards families
ATA (AT adaptor), today called PATA
SATA (Serial ATA)
SCSI (Small Computer System Interconnect) range of standards
SAN (Storage Area Network), e.g. Fibre Channel
For external disks:
USB
FireWire
(P)ATA vs. SATA
Review of performance measures
Disk performance measures:
Seek time
2-30 ms
10 ms
Rotational latency time
4-11.1 ms/rotation 5 ms
Data transfer rate
25-100 Mbyte/s 50 Mbyte/s
MTTF 1,200,000 hours = 136 years!
Application performance measures:
Response time
Throughput
Availability
Example disk scheduling algorithms (not in text)
Further improvement is possible by writing to disk out-of-order
11.3 RAID
1. Redundancy
availability
E.g. RAID level 1 (mirroring) → theoretical MTTF absurdly
large, practical 1,000,000 h
2.Parallel access
throughput + response time
E.g. RAID level 0 (striping)
Read over lightly the rest of 11.3
Read and take notes: 11.4 Tertiary Storage
For tr
For ts
Toss-immediate
Most recently used (MRU)
Both types of
blocks must be
pinned while in
use
------------------------------------------------------------------------------------------
Week 13, Lect.1
Recap of buffer replacement policies:
LRU
MRU
Toss-immediate
What’s the difference beteen MRU and toss-immediate?
Numerical example:
Buffer capacity is 5 blocks
r and s each have 5 blocks
Solve with either policy above
Example of join algorithm that is compatible with LRU:
Sort each table based on join attribute
Duplicate attributes can “straddle” multiple blocks
Solve example above in this scenario, with LRU.
Other factors impacting buffer management in DBMS:
Statistical knowledge about usage
a. e.g. dictionary/catalog, index
Concurrency
Crash-recovery
11.6 File organization
Problems:
Deletion
o Locally mark deleted records w/a special code
o Free list
A record straddling two blocks
----------------------------------------------------------------------------------
Quiz: Consider the following file, that is being used to store fixed-length records:
Show how the file changes as a result of the following insertions and deletions:
INSERT
A-42
INSERT
A-43
DELETE
A-102
INSERT
A-44
INSERT
A-45
INSERT
A-46
Quiz: Consider again the fixed-length record file:
Reorganize it as a slotted page. Assume the entire page is stored in a 4 KB block.
Problem: large objects (e.g. blob, clob, image) can extend over many blocks!
11.7 Organization of records inside the files
Heap files → see all the previous examples
Not
necessarily
the PK
Pluses: …
Minuses:
Quiz: Sequential files
Show the structure of this file (including the overhead block) after the
following insertions:
INSERT (A-042, Cedar Ridge, 100)
INSERT (A-043, Citrus Ridge, 100)
INSERT (A-044, Copper Ridge, 100)
INSERT (A-045, Tardyridge, 100)
How to add a free list to a sequential file.
To test your ideas, show what happens when you DELETE (A-043, Citrus
Ridge, 100) after the insertions at above.
Hint: The overhead block does not need a free list – explain why!
Homework: end-of-chapter 4, 5, 6, 17.
Extra-credit: 15
Review material:
Quiz:
Heap files
Show the structure of this file (including the header and the free list!) after the
following DB operations have been performed:
DELETE (A-305, Round Hill, 350)
DELETE (A-215, Mianus, 700)
DELETE (A-110, Downtown, 600)
INSERT (A-042, Dublin, 100)
INSERT (A-042, Dublin, 200)
INSERT (A-042, Dublin, 300)
INSERT (A-042, Dublin, 400)