chapter 0. 화일구조와성능평가 - gunadarma...

26
Chapter 0. 화일 구조와 성능평가 한기준 데이타베이스연구실 건국대학교 컴퓨터공학부 http://db.konkuk.ac.kr

Upload: dangdat

Post on 07-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

Chapter 0.화일 구조와 성능평가

한 기 준

데이타베이스연구실

건국대학교 컴퓨터공학부

http://db.konkuk.ac.kr

Page 2: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 2

Information System Environment

DataFacts collected from observations and measurements

Informationthe meaningful interpretation and correlation of data that allows one to make decisions

Information systema means of collecting, organizing, storing data, and extracting and distributing information

Page 3: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 3

Information System Environment

realworld data process

storeddata

information ...

capture

currentaccurate store access

currentaccurate

Decisionmaking

Page 4: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 4

Information System Environment

Primary storage(main memory)access time : independent to the data location (equal time)

Secondary storage(auxiliary memory)access time : dependent on the data location

Data structuremanagement of data in primary storage

(1) Linear data structure (or Linear list)

an ordered set of elements (a next record)

(2) Nonlinear data structure

an element has several next elements

File structure(organization)management of data in secondary storage

Page 5: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 5

Categorization of Data Structures

DATA STRUCTURES

Simple

Array

Record

Compound

Linear

Stack

Queue

Linear linked List

Nonlinear

Binary tree

Binary Search tree

M-way Search tree

B-tree, B*-tree, B+-tree

Trie

General tree

Graph

DATA TYPES

Primitive

Integer

Boolean

Character

Compound

String

FILE STRUCTURES

Sequential organization

Relative organization

Indexed sequential organization

Multi-key organization

Information System Environment

Page 6: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 6

Information System Environment

Recorda finite, ordered collection of possibly heterogeneous elements (i.e., fields) that are treated as a unit

record type, record occurrence

Fielda specific area of a record used for a particular category of data

Filea collection of logically related record occurrences that are treated as a unit

Page 7: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 7

File Structures

Technique used to represent and store the records on a file

Sequential filerecords are written consecutively and must accessed consecutively

Relative fileindividual records are accessed directly (-> on DASD)

Indexed sequential file (B+-Tree)both for sequential and direct access by the same key

Multi-key filesupport multiple access paths, each by a different key

Page 8: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 8

File Structures

ONE ACCESS KEY?

SEQUENTIAL ACCESSONLY?

SEQUENTIALORGANIZATION

DIRECT ACCESSONLY?

MULTI-KEYORGANIZATION

RELATIVEORGANIZATION

INDEXEDSEQUENTIAL

ORGANIZATION

YESNO

YES NO

YES NO

Page 9: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 9

File Operations

CreationCreate an empty file

Updaterecord insert, record update, record delete

RetrievalInquiry : low-volume, on-line processingReport generation : high-volume, batch processing

Maintenance for improving the performance

Restructuringstructural changes are made to the file within the context of the same file structure techniques

Reorganizationchanges from on file structure to another

Page 10: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 10

Performance Considerations

Data structureaccess: equal time (fast, expensive) : 20초

number of comparisons required to find a particular element

File structureaccess: different time (record location & access mechanism position) : 58일

quite time-consuming relative to access to main memory

numbers of access to secondary storage required to perform a requested operation

Page 11: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 11

Disk

Blockthe smallest amount of data that can be transferred between secondary memory and primary memory in one access

Blocking factorthe number of records per block

Bufferthe space allocated in main memory to hold the contents of a block

Page 12: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 12

Two Types of Disk Drives

Movable-head disk drivehas one read/write head for each recording surface

access time =

seek time (move arms to cylinder) +

head-activation time (select track) +

rotation delay (select record) + transfer time

Fixed-head disk drivehas one read/write head for each track of each recording surface

access time =

head-activation time + rotation delay + transfer time

Page 13: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 13

File Structure Selection Factors

Nature of operations to be performed

Characteristics of storage media to be used

Volume and frequency of transactions to be

processed

Response time requirements

Page 14: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 14

File Design Summary

FILEDESIGN

PROBLEM

Data characteristics

Usage characteristics

Storage characteristics

Performancecriteria

File organizations

Page 15: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 15

Data Characteristics

Record Length

Record format : fixed or variable

Maximum record length

Primary key and its value distribution

Average number of records with given secondary key

value

Logical structure of data

Page 16: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 16

Usage Characteristics

Frequency of query

Frequency of update

Growth expected

Volatility of data values

Batch versus interactive access

Random versus sequential access

Record ordering needed

Response time required

Variety of types of transactions

Priorities of requirements

Page 17: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 17

Storage Characteristics

Type of storage devices available

Block sizes

Average random access times

Average sequential access times

Cost of storage

Available file organization methods

Available access methods

Page 18: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 18

Performance Factors

Expected and worst case response times

Expected and worst case update times

I/O access requirements

Storage space requirements

Complexity of required support

Maintenance requirements

Availability of required support

Page 19: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 19

Basic Hardware Parameters

Parameter name Unit Code Function

Seek time ms s Mechanical delay

Latency ms r Rotational delay

Transfer char./ms t Block transfer

Bulk transfer rate char./ms t Sequential transfer

Block size char. B Fixed transfer unit

Blocking factor Bfr Records per block

Page 20: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 20

Quantitative Measures of Performance (storage & time)

amount of storage required for a record or a file

time to read an arbitrary record from the file

time to read the next record within the file

time to insert a record into the file

time to update a record in the file

time to delete a record from the file

time for exhaustive reading of the entire file

time for reorganization of the file

Page 21: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 21

File System Environment

Checkingapplication

Mortgageloan

application

Savingsapplication

File SystemInstallment

loanapplication

Mortgageloan

data file

Installmentloan

data file

Savingsaccountdata file

Checkingaccountdata file

Page 22: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 22

Checkingaccountdata file

Addressinformation common to

the four applications

Mortgage loan data file

Installmentloan data file

Savingsaccountdata file

File System Environment

Page 23: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 23

DBMS Environment

To create a database

1. Database management system (DBMS)

2. Database design

conceptual schema, internal schema, external schema

3. Collection of source-data files

4. Collection of database creation or loading program

Page 24: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 24

DBMS Environment

User

1. Suitable application program

2. Proper external schema

Page 25: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 25

Checkingapplication

Savingsapplication

Installmentloan

application

Mortgageloan

application

DatabaseManagement

System Database

DBMS Environment

Page 26: Chapter 0. 화일구조와성능평가 - Gunadarma Universitybwahyudi.staff.gunadarma.ac.id/Downloads/files/13791/file_all.pdf · Chapter 0. 화일구조와 ... stored data information

File Processing (0) Konkuk University (DB Lab.) 26

DBMS, File System, Disk Manager

DBMS

FileSystem

Diskmanager

Storeddatabase

Request

Request

Storedrecord

Storedpage

Disk I/Ooperation

Storedrecordreturned

Storedpagereturned

Data readfrom disk