0% found this document useful (0 votes)
35 views

File Structures: ÷ Öof Ú Êëov F

File Structures File Structures File Structures File Structures

Uploaded by

Mohamed Taha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

File Structures: ÷ Öof Ú Êëov F

File Structures File Structures File Structures File Structures

Uploaded by

Mohamed Taha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

File Structures

OF Ov
f

OF fjj b

N .
z M.Folk and B.Zoellick, File Structures, Addison
Wesley.
z E. Horowitz, S. Sahni, and S. Anderson-Freed,
Fundamentals of Data Structures in C, Computer
Science Press.

OF fjj b

Chapter 1 - 1

Chapter 1 - 1

N
z File Structures + Advanced Data Structures

File N .
FileN , I/O Processing, Access Method
External Sorting
Indexing
Hashing, Heap Structures
Search Structures: AVL Tree, 2-3 Trees, B-Tree,

z Not Includes
Dynamic Programming, Divide-And-Conquer
NP-Hard and NP-Complete Problems,

OF fjj b

Chapter 1 - 2

N
1

r N :'

Indexing

File System Call

10

AVL Tree, 2-3, 2-3-4

Storage Device

11

Red-Black Tree, B-Tree (1)

Buffering, Blocking

12

B-Tree (2)

Field, Record, Page

13

B-Tree (3)

External Sorting(1)

14

Hashing (1)

External Sorting(2)

15

Hashing (2)

OF fjj b

16

N F

&

Chapter 1 - 3

Chapter 1 - 2

Chapter 1

Introduction to File
Structures
OF fjj b

Chapter 1 - 4

1. The Heart of File Structure Design


z Motivation

Disks are slow.


RAM : 120 nanoseconds
Disk : 10 ~ 30 milliseconds
DiskN 
Enormous capacity at much less cost than RAM
Non-volatile storage device

z Goal
Accessing to all the capacity without making our
applications spend a lot of time waiting for the disk

OF fjj b

Chapter 1 - 5

Chapter 1 - 3

2. A Short History of File Structure


Design
z General goal of research in file structures
One access to the disk. Ideal
Only two or three trips to the disk. Practical
Grouping information for fewer trips

9 File N ' ( File /6 bN J )

OF fjj b

Chapter 1 - 6

z History
Sequential file in tape device
Direct access of disk using index
Simple index ( sequentially stored )
Tree structured index
Binary search tree, AVL tree
B-tree, B+-tree: logkN access
Hashing
Extendible, dynamic hashing
Multi-key access method
Spatial access method: R-tree, K-D-B tree

OF fjj b

Chapter 1 - 7

Chapter 1 - 4

3. A Conceptual Toolkit:
File Structure Literacy
z File structure r b'Nf  .
Sequential Access Method
Indexed Sequential Access Method
Direct Access Method

z Disk I/O r j j  .

Buffering
Blocking
Bucket Concept
Splitting & Merging

OF fjj b

Chapter 1 - 8

z  
TN .: : jj
R G zr RV  ~  &
j package N  ^

OF fjj b

Chapter 1 - 9

Chapter 1 - 5

4. Bj Jr {N
z & Jr

b fj Jr ~ Jr
&, &

z N Jr

& Jr  , {,  J
& Jr r

z Bj
Jr

& Jr  fj
 s

OF fjj b

Chapter 1 - 10

z Jr

\V 2R ' Jr
 , , & Jr
s 

z  Jr

   \ ^
{, {, , \ & J 
{, , N J 

z j Jr

&/N/ Jr R ' Jr
R bV 2R

OF fjj b

Chapter 1 - 11

Chapter 1 - 6

2~ J 2~ 2~
[

1.1]  Bj
Jr

2~ J . b
[ 1.2] & Jr J
 ~.  jz 2~ J .  
[ 1.3]  . & Jr J
OF fjj b

Chapter 1 - 12

j: j:

[ 1.4] 2~ z& & Jr J

2~ J

Inventory Master File Maintenance Audit Listing


Update
Code
A
C
A
A
D
C
C
A
C

Product
Code

Quantity
On Hand

Quantity
On Order

Reorder
Point

DR1112
DR2000
DR3814
DR3914
DR4000
GR5000
GR5014
SA3012
SA4310

400
350
239
150

50

400

0
0

200
50

100
100
125

25

45
110

Page1

------ACTION-----Addition
Change -- Qty on hand
Addition
Addition
Deletion
Change -- Qty on order
Change -- Reorder point
Addition
Change -- Qty on hand

[ 1.5]   N  N
OF fjj
b

Chapter 1 - 13

Chapter 1 - 7

Inventory Master File Maintenance Error Listing


Update
Code

Product
Code

D
C
A
X
Y
A
D

Quantity
On Hand

DR3000
GR5013
HM1032
HM1308
SA3014
SA4201
SD1103

Quantity
On Order

Page1
Reorder
Point

100
125

75

50

30

------ERROR MESSAGE-----Invalid Delete -- Master Not On File


Invalid Change -- Master Not On File
Invalid Add -- Master Already On File
Invalid Update code
Invalid Update code
Invalid Add -- Master Already On File
Invalid Delete -- Master Not On File

1.6]   N

OF fjj b

Inventory

Master

File

Chapter 1 - 14

Listing

Page1

Product
Code

Quantity
On Hand

Quantity
On Order

Reorder
Point

DR1015
DR1112
DR2000
DR3814
DR3914
GR2001
GR3034
GR5000
GR5014
HM1032
HM1308
SA3012
SA4201
SA4310
SA5012

25
400
350
239
150
74
25
500
45
123
75
100
50
125
3

0
50
25
0
0
10
10
100
0
0
0
25
0
0
0

30
400
375
200
50
80
30
525
45
120
102
110
30
100
5

1.7] & JrN

OF fjj b

Chapter 1 - 15

Chapter 1 - 8

Inventory Master File Listing of Records With


Quantity On Hand BELOW Recorder Point
Product
Code

Quantity
On Hand

DR1015
HM1308
SA5012

Quantity
On Order

25
75
3

Page 1

Reorder
Point

0
0
0

30
120
5

1.8] & Jr R s N

OF fjj b

Chapter 1 - 16

Transactions Read
Adds
Processed
Invalid
Changes
Processed
Invalid
Invalid Update Codes
Master Records Read
Master Records Written

OF fjj b

578
461
446
15
87
79
8
1
28,406
28,825

1.9]  JrN
Chapter 1 - 17

Chapter 1 - 9

You might also like