SlideShare une entreprise Scribd logo
1  sur  17
FILES ORGANIZATION
PRESENTED BY :
KU MAN YI B031210161
MOHAMMAD SAFAR A/L SHARIFF MOHAMED B031210227
ADAM RIDHWAN BIN SUKIMAN B031210083
SOO BOON JIAN B031210199
MUHAMMAD ZULKHAIRI BIN ZAINI B031210140
FILE ORGANIZATION
For understanding
 File/Table
 Record/Row
 Field/Column/Attribute
THE PILE
 A form of file organization where data are collected in
the same order they arrived
 This organization simply accumulate mass of data and
save it
 Each field is self-describing, includes a field name and a
value. Length of each field is determined as shown
 Implicitly indicated by delimiters
 Explicitly included as subfield or
 Done by default for that particular field type
 Records may have different fields and there is no visible
structure. Hence, record access is through exhaustive
search where all record or the entire file is examined
 This type of file uses space efficiently and is updated
easily. However, retrieval of a single record could be
tedious
THE PILE ORGANIZATION
Variable-length records Delimiter
Delimiter
Delimiter
Delimiter
Delimiter
Delimiter
Variable-length records
Variable-length records
Variable-length records
Variable-length records
THE SEQUENTIAL FILE
 Most common form of file structure
 Fixed format are used for records and records are of the
same length
 Field names and lengths are attributes of the file
 One particular field (usually first field) is referred to as
the key field :-
 Uniquely identifies the record
 Records are stored in key sequence
 Alphabetical order or numerical order depending on the key field
 It is the simplest structure and easy to implement in any
device. However, in the worst case scenario, accessing
a single record takes a long time.
THE SEQUENTIAL FILE ORGANIZATION
1
2
…….
n-1
n
Key Field Attributes
THE SEQUENTIAL FILE ORGANIZATION
 To enable a sequential form of records, new
records are placed in a log file or transaction file.
Then, a batch update is performed to merge the log
file with the master file to produce a new file with
the correct key sequence
1 2 n-1 n
…
Record
Terminators
THE INDEXED SEQUENTIAL FILE
 A file management system that allows records to be
accessed either sequentially (in the order they were
entered) or randomly (with an index)
 A secondary set of hash tables known as indexes is
created that contains pointers to the main file
 In indexed sequential file, records are organized in
sequence based on key fields
 Each file has an index to support random search
 Overflow file is added such as each record in
overflow file is located by following a pointer from
its predecessor record in main file
DESCRIPTION
 As an example:-
 Firstly, a single level of indexing is used. Hence, the
index is a simple sequential file.
 Each record in the index file consists of:-
 Key field(same as key field in the main file)
 Pointer to the main file
 To find a specific field, the index file is searched for
matching key values
 Then, the pointer indicates the record having the
matching key values as depicted by figure below
 This reduces the average search length
 There is an addition to the organization where each record in
the main file contains an additional field which is a pointer to
the overflow file
 When a new record is added, it is added into the overflow file.
The record in main file which is immediately before the new
record in a logical sequence to be inserted is updated to
contain a pointer to the new record in the overflow file
 However, if the record before the new record in logical
sequence is itself in the overflow file, then the pointer in that
record is updated
 The processing of entire file sequentially involves processing
of records of main files sequentially until the pointer to the
overflow file is found, then accessing is continued in the
overflow file until a null pointer is encountered
 Secondly, we visualize the organization using multiple levels
of indexes
 The lowest level of index points to the main file, whereas the
index files sitting on the level above points to the index file
below it
 Hence, the efficiency in access is greatly increased and
average length of search is greatly reduced as conveyed in
figure below
THE INDEXED FILE
 Uses multiple indexes for different key fields which
may be the subject of a search
 Record accessibility are through their indexes
 May contain an exhaustive index that contains one
entry for every record in the main file. The index
itself is organized in the sequential form for ease of
searching
 May contain a partial index. It contains entries to
records where the desired field exists
THE INDEXED FILE ORGANIZATION
Primary file
Exhaustive PartialExhaustive
Index Attributes
Pointer
Indicator
THE DIRECT/HASHED FILE
 This file management system that access directly any
block of a known address.
 A key field is required for each record.
 Uses hashing on the key value.
 No concept of sequential ordering implemented.
 Such examples are:-
 Directories
 Pricing table
 Schedules
 Name lists
 It is used where rapid access is required, where fixed-
length records are used and where records are
accessed one-at-a-time.
 The concept of hashing can be shown as below.
THE DIRECT/HASHED FILE IMPLEMENTATION
HASHING METHODS
 Direct method
 The key is the address
 a key value might be between 1-100. The address of a certain
records will be the same as the key.
 Subtraction method
 Subtract certain amount of numbers from the key
 a key value might start with 1001 and ends with 1100. A simple
hashing function could subtract 1000 from the key to determine
the address.
 Modulo-division method
 Key value is divided by the size of records.
 the remainder becomes the address of the key.
 Digit-extraction method
 Selected digits are extracted from the key
 As an example:- a field has 10 digits. The hashing function only
extracts the first 2 digits and the last digit and use them as
address.

Contenu connexe

Tendances

Overview of Storage and Indexing ...
Overview of Storage and Indexing                                             ...Overview of Storage and Indexing                                             ...
Overview of Storage and Indexing ...Javed Khan
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Treesagar yadav
 
File organization
File organizationFile organization
File organizationGokul017
 
File organisation in system analysis and design
File organisation in system analysis and designFile organisation in system analysis and design
File organisation in system analysis and designMohitgauri
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashingsathish sak
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexingraveena sharma
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMSVrushaliSolanke
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting AlgorithmsPranay Neema
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsDrishti Bhalla
 
Physical database design(database)
Physical database design(database)Physical database design(database)
Physical database design(database)welcometofacebook
 
FILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMSFILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMSAbhishek Dutta
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
database recovery techniques
database recovery techniques database recovery techniques
database recovery techniques Kalhan Liyanage
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)Home
 

Tendances (20)

Overview of Storage and Indexing ...
Overview of Storage and Indexing                                             ...Overview of Storage and Indexing                                             ...
Overview of Storage and Indexing ...
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
File organization
File organizationFile organization
File organization
 
Indexing Data Structure
Indexing Data StructureIndexing Data Structure
Indexing Data Structure
 
File organisation
File organisationFile organisation
File organisation
 
File organization
File organizationFile organization
File organization
 
File organisation in system analysis and design
File organisation in system analysis and designFile organisation in system analysis and design
File organisation in system analysis and design
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
 
Selection sorting
Selection sortingSelection sorting
Selection sorting
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Isam
IsamIsam
Isam
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
 
Hashing
HashingHashing
Hashing
 
Physical database design(database)
Physical database design(database)Physical database design(database)
Physical database design(database)
 
FILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMSFILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMS
 
Memory management
Memory managementMemory management
Memory management
 
database recovery techniques
database recovery techniques database recovery techniques
database recovery techniques
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)
 

Similaire à File Organization

File System in Operating System
File System in Operating SystemFile System in Operating System
File System in Operating SystemMeghaj Mallick
 
File organization in database
File organization in databaseFile organization in database
File organization in databaseAfrasiyab Haider
 
File organization in database
File organization in databaseFile organization in database
File organization in databaseAfrasiyab Haider
 
lecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptxlecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptxpeter1097
 
File Types in Data Structure
File Types in Data StructureFile Types in Data Structure
File Types in Data StructureProf Ansari
 
Lecture #1 Introduction
Lecture #1 IntroductionLecture #1 Introduction
Lecture #1 IntroductionRico
 
Lecture #1 Introduction
Lecture #1 IntroductionLecture #1 Introduction
Lecture #1 IntroductionDon Bosco BSIT
 
MARUTHI_INVERTED_SEARCH_presentation.pptx
MARUTHI_INVERTED_SEARCH_presentation.pptxMARUTHI_INVERTED_SEARCH_presentation.pptx
MARUTHI_INVERTED_SEARCH_presentation.pptxMaruthiRock
 
Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systemsdonny101
 
FIle Organization.pptx
FIle Organization.pptxFIle Organization.pptx
FIle Organization.pptxSreenivas R
 
DATA PROCESSING NOTE ON INDEXING
DATA PROCESSING NOTE ON INDEXINGDATA PROCESSING NOTE ON INDEXING
DATA PROCESSING NOTE ON INDEXINGdavid22266
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 

Similaire à File Organization (20)

File System in Operating System
File System in Operating SystemFile System in Operating System
File System in Operating System
 
File organization in database
File organization in databaseFile organization in database
File organization in database
 
File organization in database
File organization in databaseFile organization in database
File organization in database
 
File organisation
File organisationFile organisation
File organisation
 
lecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptxlecture 2 notes indexing in application of database systems.pptx
lecture 2 notes indexing in application of database systems.pptx
 
Files
FilesFiles
Files
 
Files
FilesFiles
Files
 
DBMS (UNIT 5)
DBMS (UNIT 5)DBMS (UNIT 5)
DBMS (UNIT 5)
 
File Types in Data Structure
File Types in Data StructureFile Types in Data Structure
File Types in Data Structure
 
Storage struct
Storage structStorage struct
Storage struct
 
Lecture #1 Introduction
Lecture #1 IntroductionLecture #1 Introduction
Lecture #1 Introduction
 
Lecture #1 Introduction
Lecture #1 IntroductionLecture #1 Introduction
Lecture #1 Introduction
 
Ardbms
ArdbmsArdbms
Ardbms
 
MARUTHI_INVERTED_SEARCH_presentation.pptx
MARUTHI_INVERTED_SEARCH_presentation.pptxMARUTHI_INVERTED_SEARCH_presentation.pptx
MARUTHI_INVERTED_SEARCH_presentation.pptx
 
Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systems
 
Chapter 12.pptx
Chapter 12.pptxChapter 12.pptx
Chapter 12.pptx
 
FIle Organization.pptx
FIle Organization.pptxFIle Organization.pptx
FIle Organization.pptx
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
DATA PROCESSING NOTE ON INDEXING
DATA PROCESSING NOTE ON INDEXINGDATA PROCESSING NOTE ON INDEXING
DATA PROCESSING NOTE ON INDEXING
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

File Organization

  • 1. FILES ORGANIZATION PRESENTED BY : KU MAN YI B031210161 MOHAMMAD SAFAR A/L SHARIFF MOHAMED B031210227 ADAM RIDHWAN BIN SUKIMAN B031210083 SOO BOON JIAN B031210199 MUHAMMAD ZULKHAIRI BIN ZAINI B031210140
  • 2. FILE ORGANIZATION For understanding  File/Table  Record/Row  Field/Column/Attribute
  • 3. THE PILE  A form of file organization where data are collected in the same order they arrived  This organization simply accumulate mass of data and save it  Each field is self-describing, includes a field name and a value. Length of each field is determined as shown  Implicitly indicated by delimiters  Explicitly included as subfield or  Done by default for that particular field type  Records may have different fields and there is no visible structure. Hence, record access is through exhaustive search where all record or the entire file is examined  This type of file uses space efficiently and is updated easily. However, retrieval of a single record could be tedious
  • 4. THE PILE ORGANIZATION Variable-length records Delimiter Delimiter Delimiter Delimiter Delimiter Delimiter Variable-length records Variable-length records Variable-length records Variable-length records
  • 5. THE SEQUENTIAL FILE  Most common form of file structure  Fixed format are used for records and records are of the same length  Field names and lengths are attributes of the file  One particular field (usually first field) is referred to as the key field :-  Uniquely identifies the record  Records are stored in key sequence  Alphabetical order or numerical order depending on the key field  It is the simplest structure and easy to implement in any device. However, in the worst case scenario, accessing a single record takes a long time.
  • 6. THE SEQUENTIAL FILE ORGANIZATION 1 2 ……. n-1 n Key Field Attributes
  • 7. THE SEQUENTIAL FILE ORGANIZATION  To enable a sequential form of records, new records are placed in a log file or transaction file. Then, a batch update is performed to merge the log file with the master file to produce a new file with the correct key sequence 1 2 n-1 n … Record Terminators
  • 8. THE INDEXED SEQUENTIAL FILE  A file management system that allows records to be accessed either sequentially (in the order they were entered) or randomly (with an index)  A secondary set of hash tables known as indexes is created that contains pointers to the main file  In indexed sequential file, records are organized in sequence based on key fields  Each file has an index to support random search  Overflow file is added such as each record in overflow file is located by following a pointer from its predecessor record in main file
  • 9. DESCRIPTION  As an example:-  Firstly, a single level of indexing is used. Hence, the index is a simple sequential file.  Each record in the index file consists of:-  Key field(same as key field in the main file)  Pointer to the main file  To find a specific field, the index file is searched for matching key values  Then, the pointer indicates the record having the matching key values as depicted by figure below  This reduces the average search length
  • 10.
  • 11.  There is an addition to the organization where each record in the main file contains an additional field which is a pointer to the overflow file  When a new record is added, it is added into the overflow file. The record in main file which is immediately before the new record in a logical sequence to be inserted is updated to contain a pointer to the new record in the overflow file  However, if the record before the new record in logical sequence is itself in the overflow file, then the pointer in that record is updated  The processing of entire file sequentially involves processing of records of main files sequentially until the pointer to the overflow file is found, then accessing is continued in the overflow file until a null pointer is encountered  Secondly, we visualize the organization using multiple levels of indexes  The lowest level of index points to the main file, whereas the index files sitting on the level above points to the index file below it  Hence, the efficiency in access is greatly increased and average length of search is greatly reduced as conveyed in figure below
  • 12.
  • 13. THE INDEXED FILE  Uses multiple indexes for different key fields which may be the subject of a search  Record accessibility are through their indexes  May contain an exhaustive index that contains one entry for every record in the main file. The index itself is organized in the sequential form for ease of searching  May contain a partial index. It contains entries to records where the desired field exists
  • 14. THE INDEXED FILE ORGANIZATION Primary file Exhaustive PartialExhaustive Index Attributes Pointer Indicator
  • 15. THE DIRECT/HASHED FILE  This file management system that access directly any block of a known address.  A key field is required for each record.  Uses hashing on the key value.  No concept of sequential ordering implemented.  Such examples are:-  Directories  Pricing table  Schedules  Name lists  It is used where rapid access is required, where fixed- length records are used and where records are accessed one-at-a-time.  The concept of hashing can be shown as below.
  • 16. THE DIRECT/HASHED FILE IMPLEMENTATION
  • 17. HASHING METHODS  Direct method  The key is the address  a key value might be between 1-100. The address of a certain records will be the same as the key.  Subtraction method  Subtract certain amount of numbers from the key  a key value might start with 1001 and ends with 1100. A simple hashing function could subtract 1000 from the key to determine the address.  Modulo-division method  Key value is divided by the size of records.  the remainder becomes the address of the key.  Digit-extraction method  Selected digits are extracted from the key  As an example:- a field has 10 digits. The hashing function only extracts the first 2 digits and the last digit and use them as address.