Download presentation
Presentation is loading. Please wait.
Published byMadeline Underwood Modified over 6 years ago
1
Secondary Storage Management 13.5 Arranging data on disk
2
Example CREATE TABLE SUPPLIERS (SNUM CHAR(15) NOT NULL,
SNAME CHAR(15), STATUS INT, CITY CHAR(15)); The following location has been allocated Cylinder # 10; 2. Surface # 3 4. Block # 2 (total # 4 sectors) 5 The record start from offset 10 bytes Give the address for each field
3
Example of Hard Drive Physical Address Host name: My PC
Disk name:Megatron747 Cylinder # 10 (total #216 ) Surface # 3 (Track within cylinder) (total # 24) A sector has total # of 212 bytes. 5. Block # 2 (total # 4 sectors) (total # 28 sectors per track (average))
4
Example of Hard Drive Move one track 1.00025 millisecond
One rotation 8.33 millisecond 2. Start and Stop take one millisecond Move one track millisecond Every 4000 track takes one milliseconds. From the most inner to out (total 216 tacks) take millisecond
5
Outline Fixed-Length Records Example of Fixed-Length Records
Packing Fixed-Length Records into Blocks Example of Packing Fixed-Length Records into Blocks Details of Block header
6
Example of Hard Drive Physical Address Host name: My PC
Disk name:Megatron747 Cylinder # 10 (total #216 ) Surface # 3 (Track within cylinder) (total # 24) A sector has total # of 212 bytes. 5. Block # 2 (total # 4 sectors) (total # 28 sectors per track (average))
7
Example of Hard Drive Physical Address
A sector has total # of 212 bytes. Block # 2 (total # 4 sectors) (total # 28 sectors per track (average)) Offset of the beginning record 10 HW: Please compute the read time for one cylinder By DBMS and OS
8
Arranging Data on Disk A data element such as a tuple or object is represented by a record, which consists of consecutive bytes in some disk block.
9
Fixed Length Records The Simplest record consists of fixed length fields. The record begins with a header, a fixed-length region where information about the record itself is kept. Fixed Length Record header 1. A pointer to record schema. 2. The length of the record. 3. A timestamp indicating when the record was created.
10
Example CREATE TABLE employee( name CHAR(30) PRIMARY KEY,
address VARCHAR(255), gender CHAR(1), birthdate DATE );
11
Packing Fixed Length Records into Blocks
Records are stored in blocks of the disk and moved into main memory when we need to access or update them. A block header is written first and it is followed by series of blocks.
12
Example Along with the header we can pack as many record as we can in one block as shown in the figure and remaining space will be unused
13
Block header contains following information
Links to one or more other blocks that are part of a network blocks Information about the role played by this block in such a network Information about which relation the tuples of this block belong to. A “directory” giving the offset of each round in the block Timestamp(s) indicating the time of the block's last modification and / or access
14
Thank You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.