Hard Disk Storage and Management in Database Systems, Study Guides, Projects, Research of Introduction to Database Management Systems

An introduction to the concept of hard disk storage and management in the context of databases. It covers the anatomy of a hard disk, typical disk parameters, accessing a disk block, and managing the hard disk through buffer management and disk space management. The document also discusses the advantages and disadvantages of solid state disks and why databases are not typically stored in main memory.

Typology: Study Guides, Projects, Research

2011/2012

Uploaded on 02/15/2012

arien
arien 🇺🇸

4.8

(24)

309 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Storage and Indexes
Introduction to Databases
Computer Science 557
Instructor: Joe Bockhorst
University of Wisconsin - Milwaukee
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Hard Disk Storage and Management in Database Systems and more Study Guides, Projects, Research Introduction to Database Management Systems in PDF only on Docsity!

Storage and Indexes

Introduction to Databases

Computer Science 557

Instructor: Joe Bockhorst

University of Wisconsin - Milwaukee

Announcements

Any problems logging in to course accounts?

Use grid3, grid5 or weise for course work

  • Send bugs on weise to

[email protected]

Reading Assignment: Chapter 14 in the textbook

Program 1 assigned today, due next Friday

Our First Equation

t

r

s

I/O_Cost

seek time

rotational delay

transfer time

Anatomy of a Hard Disk

Typical Disk Parameters

(Courtesy of Seagate Technology)

Accessing a Disk Block

to

Read

or

Write

block give block addr to disk controller

  • Hardware block address – cylinder #, surface #, block #– Logical block addressing allows higher levels to refer to

hardware block address using a

block_id

Seek time – move head to correct cylinder (~10ms)

Rotation time – rotate start of block under head

  • @ 15000 rpm, average rotation time is 4ms

Transfer time – transfer entire block

Accessing consecutive blocks only need to pay the seekand rotation time once

Compare to typical main memory access times whichare measured in micro (

) or nano (

) seconds

Why not store DB in main memory?

  • cost of RAM is > 100 X hard drive cost

main memory is volatile

32 bit addressing

Managing the Hard Disk

Query Optimization Relational Operators

Files and Access Methods

Buffer Management

Disk Space Management

The DSM provides anabstraction of theblock as a unit of dataDSM interfaceincludes commands toread and write blockcommands

I/O requests

Managing the Hard Disk

Disk Space Manager

yes

block ID

yes yes

allocated?

N-
N

no

no

no

no

hardware addr

no

no

Example: Managing the Hard Disk

allocate_blocks

write_block(5,data)read_block(5)deallocate

block(2)

Disk Space Manager

yes

block ID

yes yes

allocated?

N-
N

no

no

no

no

hardware addr

no

no

allocate_blocks

write_block(5,data)read_block(5)deallocate

block(2)

Example: Managing the Hard Disk

Disk Space Manager

yes

block ID

yes yes

allocated?

N-
N

no

no

yes yes

hardware addr

yes

no

//write blockID 5 to disk

write_block(903,data)

allocate_blocks

write_block(5,data)read_block(5)deallocate

block(2)

Example: Managing the Hard Disk

Disk Space Manager

yes

block ID

yes yes

allocated?

N-
N

no

no

yes yes

hardware addr

yes

no

// read blockID 5 to buffer

read_block(903)

Buffer Management

Responsible for managingregion of main memorycalled the

buffer pool

MM pages are calledframes (slots that can holdone block)

Higher levels of the DBMSneed not worry if the pageis in memory or not... Justask for it.

Query Optimization Relational Operators

Files and Access Methods

Disk Space Management

Buffer Management

Buffer Manager Operations

add_blocks_to_DB(num_blocks)

  • add new blocks to DB

delete_block_from_DB(block_id)

  • delete block from the DB

pin_block(block_id)

  • bring block from disk to buffer pool if not in BP– increment

pin count

for block

unpin_block(block_id)

  • decrement pin count for block

mark_dirty(block_id)

Buffer Manager maintains for each frame

  • pin count– dirty bit