Uploaded by feedovertrick

Module 1 - Data Organization

advertisement
DATA
ORGANIZATION
DATA ORGANIZATION
•
Companies store vast quantities of data
•
There must be a means of saving and retrieving that
data efficiently
•
Data organization is designed to facilitate the storage
an retrieval of specific data items.
1
DATA ORGANIZATION COMPONENTS
DATA ORGANIZATION TERMS
2
FILE ORGANIZATION
• Describes the access method for locating a record in a file.
• Each organization provides different efficiencies
• Types of file organization
• Sequential
• Direct
• Indexed
(sequential and non-sequential)
SEQUENTIAL RECORD ACCESS
3
SEQUENTIAL RECORD ACCESS
•
Records are ordered physically one after another
based on the key field.
•
Useful when processing several records at one time.
•
Can use a sequential or binary search or some other
search technique.
•
Example: processing bills at end of the month.
DIRECT RECORD ACCESS
4
DIRECT RECORD ACCESS
• Records stored at a particular location of a disk.
• Location of records are determined by hashing.
• Hashing
- an algorithm to convert the key field location
into a physical or logical address on the disk.
• Useful when processing specific records.
• Example: Accessing a customer’s current bill.
SEQUENTIAL VERSUS DIRECT ACCESS
Indexed
Supports both
Sequential
Useful for accessing
several records at once
Direct
Useful for accessing a
specific record
5
INDEXED RECORD ACCESS
• In addition to the data, an index is maintained to identify the
location of a specific record.
•
Index: A table that lists the value of a field in each record
in a file and the record’s address.
• Two types
•
Indexed Sequential
•
Indexed Non-sequential
INDEXED RECORD ACCESS
6
INDEXED SEQUENTIAL RECORD ACCESS
• A compromise between sequential and direct access.
• Stores records on the disk in physically sequential order.
• Also maintains an index (often a simpler block index.
• Can be accessed either directly or sequentially.
• Example: the telephone book
INDEXED NON-SEQUENTIAL RECORD ACCESS
• Record are not stored in any predefined order.
• Must maintain a full index (inverted index)
• Often used for accessing records in a relational database.
• Example: Books in a library.
7
ACTIONS ON A DATABASE RECORD
• Create a new record (also called Insert)
• Read data from an existing record
• Update data on an existing record
• Delete an existing record
END
8
Download