CS计算机代考程序代写 database 2021/4/28 Storage Management

2021/4/28 Storage Management
Storage Management
Storage Management
Storage Technology
Views of Data in Query Evaluation Storage Management
Cost Models
>>
COMP9315 21T1 ♢ Storage Management ♢ [0/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
1/12

2021/4/28 Storage Management
❖ Storage Management
Lowest levels of DBMS related to storage management:
∧ >>
COMP9315 21T1 ♢ Storage Management ♢ [1/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
2/12

2021/4/28 Storage Management
❖ Storage Technology Persistent storage is
large, cheap, relatively slow, accessed in blocks used for long-term storage of data
Computational storage is
small, expensive, fast, accessed by byte/word used for all analysis of data
Access cost HDD:RAM ≅ 100000:1, e.g. 10ms to read block containing two tuples 1μs to compare elds in two tuples
<< ∧ >>
COMP9315 21T1 ♢ Storage Management ♢ [2/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
3/12

2021/4/28 Storage Management
<< ∧ >>
❖ Storage Technology (cont)
Hard disk drives (HDD) are well-established, cheap, high-volume,

Latency: move to track + spin to block = ~10ms (avg)
Volume: one HDD can store up to 20TB (typically 4TB/8TB/…)
Summary: very large, persistent, slow, block-based transfer
spinning magnetic medium
access requires moving r/w head to position transfers blocks of data (e.g. 1KB)
COMP9315 21T1 ♢ Storage Management ♢ [3/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
4/12

2021/4/28 Storage Management
<< ∧ >>
❖ Storage Technology (cont)
Solid state drives (SSD) are modern, high-volume devices …
faster than HDDs, no latency
can read single items
update requires block erase then write over time, writes “wear out” blocks require controllers that spread write load
Volume: one SSD can store up to 8TB (typically 1TB/2TB/…) Summary: large, persistent, fast, (partly) block-based transfer
COMP9315 21T1 ♢ Storage Management ♢ [4/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
5/12

2021/4/28 Storage Management
❖ Storage Technology (cont) Comparison of storage device properties:
<< ∧ >>
RAM
HDD
SDD
Capacity
~ 32GB
~ 8TB
~ 2TB
Cost/byte
~$10/GB
~$40/TB
~$200/TB
Read latency
~ 1μs
~ 10ms
~ 50μs
Write latency
~ 1μs
~ 10ms
~ 900μs
Read unit
byte
block (e.g. 1KB)
byte
Writing
byte
write a block
write on empty block
COMP9315 21T1 ♢ Storage Management ♢ [5/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
6/12

2021/4/28 Storage Management
❖ Storage Technology (cont) Aims of storage management in DBMS:
provide view of data as collection of pages/tuples map from database objects (e.g. tables) to disk les manage transfer of data to/from disk storage
use buffers to minimise disk/memory transfers interpret loaded data as tuples/records
basis for le structures used by access methods
<< ∧ >>
COMP9315 21T1 ♢ Storage Management ♢ [6/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
7/12

2021/4/28 Storage Management
❖ Views of Data in Query Evaluation
<< ∧ >>
COMP9315 21T1 ♢ Storage Management ♢ [7/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
8/12

2021/4/28 Storage Management
<< ∧ >> ❖ Views of Data in Query Evaluation (cont)
Representing database objects during query execution:
DB (handleonanauthorised/openeddatabase)
Rel (handleonanopenedrelation)
Page (memorybuffertoholdcontentsofdiskblock) Tuple (memoryholdingdatavaluesfromonetuple)
Addressing in DBMSs:
PageID = FileID+Offset…identiesablockofdata
where Offset gives location of block within le TupleID = PageID+Index…identiesasingletuple
where Index gives location of tuple within page
COMP9315 21T1 ♢ Storage Management ♢ [8/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
9/12

2021/4/28 Storage Management
❖ Storage Management Topics in storage management …
Disks and Files
performance issues and organisation of disk les Buffer Management
using caching to improve DBMS system throughput Tuple/Page Management
how tuples are represented within disk pages DB Object Management (Catalog)
how tables/views/functions/types, etc. are represented
<< ∧ >>
COMP9315 21T1 ♢ Storage Management ♢ [9/10]
cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html
10/12

2021/4/28 Storage Management
❖ Cost Models
Throughout this course, we compare costs of DB operations Important aspects in determining cost:
data is always transferred to/from disk as whole blocks (pages) cost of manipulating tuples in memory is negligible
overall cost determined primarily by #data-blocks read/written
Complicating factors in determining costs:
not all page accesses require disk access (buffer pool) tuples typically have variable size (tuples/page ?)
More details later …
<< ∧ COMP9315 21T1 ♢ Storage Management ♢ [10/10] cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html 11/12 2021/4/28 Storage Management Produced: 17 Feb 2021 cgi.cse.unsw.edu.au/~cs9315/21T1/lectures/storage/slides.html 12/12