SlideShare a Scribd company logo
File Structures(Part 2)
BY:SURBHI SAROHA
Syllabus
• Secondary key Retrieval:
• Inverted and multiuser files
• Indexing Using Tree Structures:
• B-trees
• B+trees
Secondary key Retrieval
• Secondary Key is the key that has not been selected to be the primary key.
However, it is considered a candidate key for the primary key.
• Therefore, a candidate key not selected as a primary key is called secondary
key.
• Candidate key is an attribute or set of attributes that you can consider as a
Primary key.
• Note: Secondary Key is not a Foreign Key.
Example
Student_ID Student_Enr
oll
Student_Na
me
Student_Age Student_
Email
096 9122717 Manish 25 aaa@gmai
l.com
055 9122655 Manan 23 abc@gmai
l.com
067 9122699 Shreyas 28 pqr@gmai
l.com
Example
Let us see an example −
Cont….
• Above, Student_ID, Student_Enroll and Student_Email are the candidate keys.
• They are considered candidate keys since they can uniquely identify the student
record.
• Select any one of the candidate key as the primary key. Rest of the two keys would
be Secondary Key.
• Let’s say you selected Student_ID as primary key,
therefore Student_Enroll and Student_Email will be Secondary Key (candidates
of primary key).
Inverted and multiuser files
• A database consist of a huge amount of data. The data is grouped within a table in RDBMS,
and each table have related records. A user can see that the data is stored in form of tables,
but in acutal this huge amount of data is stored in physical memory in form of files.
• File – A file is named collection of related information that is recorded on secondary
storage such as magnetic disks, magnetic tables and optical disks.
• What is File Organization?
File Organization refers to the logical relationships among various records that constitute
the file, particularly with respect to the means of identification and access to any specific
record. In simple terms, Storing the files in certain order is called file Organization. File
Structure refers to the format of the label and data blocks and of any logical control
record.
Cont….
• Types of File Organizations –
• Various methods have been introduced to Organize files. These particular methods have
advantages and disadvantages on the basis of access or selection . Thus it is all upon the
programmer to decide the best suited file Organization method according to his requirements.
Some types of File Organizations are :
• Sequential File Organization
• Heap File Organization
• Hash File Organization
• B+ Tree File Organization
• Clustered File Organization
Indexing Using Tree Structures:
• B-trees
• B-Tree is a self-balancing search tree. In most of the other self-balancing search trees
(like AVL and Red-Black Trees), it is assumed that everything is in main memory. To understand
the use of B-Trees, we must think of the huge amount of data that cannot fit in main memory.
When the number of keys is high, the data is read from disk in the form of blocks. Disk access
time is very high compared to the main memory access time. The main idea of using B-Trees is
to reduce the number of disk accesses. Most of the tree operations (search, insert, delete, max,
min, ..etc ) require O(h) disk accesses where h is the height of the tree. B-tree is a fat tree. The
height of B-Trees is kept low by putting maximum possible keys in a B-Tree node. Generally, the
B-Tree node size is kept equal to the disk block size. Since the height of the B-tree is low so total
disk accesses for most of the operations are reduced significantly compared to balanced Binary
Search Trees like AVL Tree, Red-Black Tree, ..etc.
Time Complexity of B-Tree:
• Sr. No. Algorithm Time Complexity
• 1. Search O(log n)
• 2. Insert O(log n)
• 3. Delete O(log n)
Properties of B-Tree:
• All leaves are at the same level.
• A B-Tree is defined by the term minimum degree ‘t’. The value of t depends upon disk block size.
• Every node except root must contain at least (ceiling)([t-1]/2) keys. The root may contain minimum 1 key.
• All nodes (including root) may contain at most t – 1 keys.
• Number of children of a node is equal to the number of keys in it plus 1.
• All keys of a node are sorted in increasing order. The child between two keys k1 and k2 contains all keys in
the range from k1 and k2.
• B-Tree grows and shrinks from the root which is unlike Binary Search Tree. Binary Search Trees grow
downward and also shrink from downward.
• Like other balanced Binary Search Trees, time complexity to search, insert and delete is O(log n).
B+trees
• The B+ tree is a balanced binary search tree. It follows a multi-level index
format.
• In the B+ tree, leaf nodes denote actual data pointers. B+ tree ensures that
all leaf nodes remain at the same height.
• In the B+ tree, the leaf nodes are linked using a link list. Therefore, a B+
tree can support random access as well as sequential access.
Structure of B+ Tree
• In the B+ tree, every leaf node is at equal distance from the root node. The
B+ tree is of the order n where n is fixed for every B+ tree.
• It contains an internal node and leaf node.
Cont…
Internal node
• An internal node of the B+ tree can contain at least n/2 record pointers except the root
node.
• At most, an internal node of the tree contains n pointers.
• Leaf node
• The leaf node of the B+ tree can contain at least n/2 record pointers and n/2 key values.
• At most, a leaf node contains n record pointer and n key values.
• Every leaf node of the B+ tree contains one block pointer P to point to next leaf node.
•
Thank you

More Related Content

What's hot

File organization 1
File organization 1File organization 1
File organization 1
Rupali Rana
 
Importance of Normalization
Importance of NormalizationImportance of Normalization
Importance of Normalization
Shwe Yee
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
sathish sak
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
IBM
 
Comandos utilizados en sql
Comandos utilizados en sqlComandos utilizados en sql
Comandos utilizados en sqlByron Eras
 
Ficheros con organización relativa directa
Ficheros con organización relativa directaFicheros con organización relativa directa
Ficheros con organización relativa directaFportavella
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
BaivabiNayak
 
Sql DML Lenguaje de manipulación de datos
Sql DML Lenguaje de manipulación de datos Sql DML Lenguaje de manipulación de datos
Sql DML Lenguaje de manipulación de datos josecuartas
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
Megha yadav
 
Indexacion Y Asociacion
Indexacion Y AsociacionIndexacion Y Asociacion
Indexacion Y Asociacion
juliangalvez
 
Indices en oracle
Indices en oracleIndices en oracle
Sql Server Basics
Sql Server BasicsSql Server Basics
Sql Server Basics
rainynovember12
 
MySQL Transactions
MySQL TransactionsMySQL Transactions
MySQL Transactions
Reggie Niccolo Santos
 
Fundamentos de Bases de Datos - Introducción
Fundamentos de Bases de Datos - IntroducciónFundamentos de Bases de Datos - Introducción
Fundamentos de Bases de Datos - Introducción
Manuel Padilla
 
Introduction to DBMS and SQL Overview
Introduction to DBMS and SQL OverviewIntroduction to DBMS and SQL Overview
Introduction to DBMS and SQL Overview
Prabu U
 
Data models
Data modelsData models
NORMALIZACIÓN
NORMALIZACIÓN  NORMALIZACIÓN
NORMALIZACIÓN
Jorge Paredes Toledo
 

What's hot (20)

File organization 1
File organization 1File organization 1
File organization 1
 
Importance of Normalization
Importance of NormalizationImportance of Normalization
Importance of Normalization
 
Lenguaje SQL
Lenguaje SQLLenguaje SQL
Lenguaje SQL
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 
Comandos utilizados en sql
Comandos utilizados en sqlComandos utilizados en sql
Comandos utilizados en sql
 
Ficheros con organización relativa directa
Ficheros con organización relativa directaFicheros con organización relativa directa
Ficheros con organización relativa directa
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
 
Sql DML Lenguaje de manipulación de datos
Sql DML Lenguaje de manipulación de datos Sql DML Lenguaje de manipulación de datos
Sql DML Lenguaje de manipulación de datos
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Indexacion Y Asociacion
Indexacion Y AsociacionIndexacion Y Asociacion
Indexacion Y Asociacion
 
Indices en oracle
Indices en oracleIndices en oracle
Indices en oracle
 
Sql Server Basics
Sql Server BasicsSql Server Basics
Sql Server Basics
 
Oracle archi ppt
Oracle archi pptOracle archi ppt
Oracle archi ppt
 
MySQL Transactions
MySQL TransactionsMySQL Transactions
MySQL Transactions
 
Fundamentos de Bases de Datos - Introducción
Fundamentos de Bases de Datos - IntroducciónFundamentos de Bases de Datos - Introducción
Fundamentos de Bases de Datos - Introducción
 
Introduction to DBMS and SQL Overview
Introduction to DBMS and SQL OverviewIntroduction to DBMS and SQL Overview
Introduction to DBMS and SQL Overview
 
Data models
Data modelsData models
Data models
 
Sql
SqlSql
Sql
 
NORMALIZACIÓN
NORMALIZACIÓN  NORMALIZACIÓN
NORMALIZACIÓN
 

Similar to File Structures(Part 2)

B+ tree
B+ treeB+ tree
chapter 6.1.pptx
chapter 6.1.pptxchapter 6.1.pptx
chapter 6.1.pptx
Tekle12
 
Tree Introduction.pptx
Tree Introduction.pptxTree Introduction.pptx
Tree Introduction.pptx
RahulAI
 
Database Management System-Module-IV(part-1).pptx
Database Management System-Module-IV(part-1).pptxDatabase Management System-Module-IV(part-1).pptx
Database Management System-Module-IV(part-1).pptx
AiswaryaMohan31
 
DATA-STRUCTURES.pptx
DATA-STRUCTURES.pptxDATA-STRUCTURES.pptx
DATA-STRUCTURES.pptx
RuchiNagar3
 
B+tree Data structures presentation
B+tree Data structures presentationB+tree Data structures presentation
B+tree Data structures presentation
Muhammad Bilal Khan
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
 
Data structures
Data structuresData structures
Data structures
MADHAVASAIYENDUVA
 
Data structure(Part 2)
Data structure(Part 2)Data structure(Part 2)
Data structure(Part 2)
SURBHI SAROHA
 
Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
Kami503928
 
Main MeMory Data Base
Main MeMory Data BaseMain MeMory Data Base
Main MeMory Data BaseSiva Rushi
 
DBMS-Unit5-PPT.pptx important for revision
DBMS-Unit5-PPT.pptx important for revisionDBMS-Unit5-PPT.pptx important for revision
DBMS-Unit5-PPT.pptx important for revision
yuvivarmaa
 
tree-160731205832.pptx
tree-160731205832.pptxtree-160731205832.pptx
tree-160731205832.pptx
MouDhara1
 
3620121datastructures.ppt
3620121datastructures.ppt3620121datastructures.ppt
3620121datastructures.ppt
SheejamolMathew
 
Mca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graphMca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graph
Rai University
 
Bca ii dfs u-3 tree and graph
Bca  ii dfs u-3 tree and graphBca  ii dfs u-3 tree and graph
Bca ii dfs u-3 tree and graph
Rai University
 
FILE ORGANIZATION.pptx
FILE ORGANIZATION.pptxFILE ORGANIZATION.pptx
FILE ORGANIZATION.pptx
Kavya990096
 
Counted B Tree,Van Emde.pptx
Counted B Tree,Van Emde.pptxCounted B Tree,Van Emde.pptx
Counted B Tree,Van Emde.pptx
VashisthZatakia
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
Sowmya Jyothi
 

Similar to File Structures(Part 2) (20)

B+ tree
B+ treeB+ tree
B+ tree
 
chapter 6.1.pptx
chapter 6.1.pptxchapter 6.1.pptx
chapter 6.1.pptx
 
Tree Introduction.pptx
Tree Introduction.pptxTree Introduction.pptx
Tree Introduction.pptx
 
Database Management System-Module-IV(part-1).pptx
Database Management System-Module-IV(part-1).pptxDatabase Management System-Module-IV(part-1).pptx
Database Management System-Module-IV(part-1).pptx
 
DATA-STRUCTURES.pptx
DATA-STRUCTURES.pptxDATA-STRUCTURES.pptx
DATA-STRUCTURES.pptx
 
B+tree Data structures presentation
B+tree Data structures presentationB+tree Data structures presentation
B+tree Data structures presentation
 
A41001011
A41001011A41001011
A41001011
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Data structures
Data structuresData structures
Data structures
 
Data structure(Part 2)
Data structure(Part 2)Data structure(Part 2)
Data structure(Part 2)
 
Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
 
Main MeMory Data Base
Main MeMory Data BaseMain MeMory Data Base
Main MeMory Data Base
 
DBMS-Unit5-PPT.pptx important for revision
DBMS-Unit5-PPT.pptx important for revisionDBMS-Unit5-PPT.pptx important for revision
DBMS-Unit5-PPT.pptx important for revision
 
tree-160731205832.pptx
tree-160731205832.pptxtree-160731205832.pptx
tree-160731205832.pptx
 
3620121datastructures.ppt
3620121datastructures.ppt3620121datastructures.ppt
3620121datastructures.ppt
 
Mca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graphMca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graph
 
Bca ii dfs u-3 tree and graph
Bca  ii dfs u-3 tree and graphBca  ii dfs u-3 tree and graph
Bca ii dfs u-3 tree and graph
 
FILE ORGANIZATION.pptx
FILE ORGANIZATION.pptxFILE ORGANIZATION.pptx
FILE ORGANIZATION.pptx
 
Counted B Tree,Van Emde.pptx
Counted B Tree,Van Emde.pptxCounted B Tree,Van Emde.pptx
Counted B Tree,Van Emde.pptx
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
 

More from SURBHI SAROHA

Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2
SURBHI SAROHA
 
Management Information System(Unit 2).pptx
Management Information System(Unit 2).pptxManagement Information System(Unit 2).pptx
Management Information System(Unit 2).pptx
SURBHI SAROHA
 
Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)
SURBHI SAROHA
 
Management Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptxManagement Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptx
SURBHI SAROHA
 
Introduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptxIntroduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptx
SURBHI SAROHA
 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)
SURBHI SAROHA
 
DBMS (UNIT 5)
DBMS (UNIT 5)DBMS (UNIT 5)
DBMS (UNIT 5)
SURBHI SAROHA
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
SURBHI SAROHA
 
JAVA(UNIT 4)
JAVA(UNIT 4)JAVA(UNIT 4)
JAVA(UNIT 4)
SURBHI SAROHA
 
OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)
SURBHI SAROHA
 
OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)
SURBHI SAROHA
 
DBMS UNIT 3
DBMS UNIT 3DBMS UNIT 3
DBMS UNIT 3
SURBHI SAROHA
 
JAVA (UNIT 3)
JAVA (UNIT 3)JAVA (UNIT 3)
JAVA (UNIT 3)
SURBHI SAROHA
 
Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)
SURBHI SAROHA
 
DBMS (UNIT 2)
DBMS (UNIT 2)DBMS (UNIT 2)
DBMS (UNIT 2)
SURBHI SAROHA
 
JAVA UNIT 2
JAVA UNIT 2JAVA UNIT 2
JAVA UNIT 2
SURBHI SAROHA
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
SURBHI SAROHA
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1
SURBHI SAROHA
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
SURBHI SAROHA
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
SURBHI SAROHA
 

More from SURBHI SAROHA (20)

Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2
 
Management Information System(Unit 2).pptx
Management Information System(Unit 2).pptxManagement Information System(Unit 2).pptx
Management Information System(Unit 2).pptx
 
Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)
 
Management Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptxManagement Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptx
 
Introduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptxIntroduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptx
 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)
 
DBMS (UNIT 5)
DBMS (UNIT 5)DBMS (UNIT 5)
DBMS (UNIT 5)
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 
JAVA(UNIT 4)
JAVA(UNIT 4)JAVA(UNIT 4)
JAVA(UNIT 4)
 
OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)
 
OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)
 
DBMS UNIT 3
DBMS UNIT 3DBMS UNIT 3
DBMS UNIT 3
 
JAVA (UNIT 3)
JAVA (UNIT 3)JAVA (UNIT 3)
JAVA (UNIT 3)
 
Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)
 
DBMS (UNIT 2)
DBMS (UNIT 2)DBMS (UNIT 2)
DBMS (UNIT 2)
 
JAVA UNIT 2
JAVA UNIT 2JAVA UNIT 2
JAVA UNIT 2
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 

Recently uploaded

How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

File Structures(Part 2)

  • 2. Syllabus • Secondary key Retrieval: • Inverted and multiuser files • Indexing Using Tree Structures: • B-trees • B+trees
  • 3. Secondary key Retrieval • Secondary Key is the key that has not been selected to be the primary key. However, it is considered a candidate key for the primary key. • Therefore, a candidate key not selected as a primary key is called secondary key. • Candidate key is an attribute or set of attributes that you can consider as a Primary key. • Note: Secondary Key is not a Foreign Key.
  • 4. Example Student_ID Student_Enr oll Student_Na me Student_Age Student_ Email 096 9122717 Manish 25 aaa@gmai l.com 055 9122655 Manan 23 abc@gmai l.com 067 9122699 Shreyas 28 pqr@gmai l.com Example Let us see an example −
  • 5. Cont…. • Above, Student_ID, Student_Enroll and Student_Email are the candidate keys. • They are considered candidate keys since they can uniquely identify the student record. • Select any one of the candidate key as the primary key. Rest of the two keys would be Secondary Key. • Let’s say you selected Student_ID as primary key, therefore Student_Enroll and Student_Email will be Secondary Key (candidates of primary key).
  • 6. Inverted and multiuser files • A database consist of a huge amount of data. The data is grouped within a table in RDBMS, and each table have related records. A user can see that the data is stored in form of tables, but in acutal this huge amount of data is stored in physical memory in form of files. • File – A file is named collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tables and optical disks. • What is File Organization? File Organization refers to the logical relationships among various records that constitute the file, particularly with respect to the means of identification and access to any specific record. In simple terms, Storing the files in certain order is called file Organization. File Structure refers to the format of the label and data blocks and of any logical control record.
  • 7. Cont…. • Types of File Organizations – • Various methods have been introduced to Organize files. These particular methods have advantages and disadvantages on the basis of access or selection . Thus it is all upon the programmer to decide the best suited file Organization method according to his requirements. Some types of File Organizations are : • Sequential File Organization • Heap File Organization • Hash File Organization • B+ Tree File Organization • Clustered File Organization
  • 8. Indexing Using Tree Structures: • B-trees • B-Tree is a self-balancing search tree. In most of the other self-balancing search trees (like AVL and Red-Black Trees), it is assumed that everything is in main memory. To understand the use of B-Trees, we must think of the huge amount of data that cannot fit in main memory. When the number of keys is high, the data is read from disk in the form of blocks. Disk access time is very high compared to the main memory access time. The main idea of using B-Trees is to reduce the number of disk accesses. Most of the tree operations (search, insert, delete, max, min, ..etc ) require O(h) disk accesses where h is the height of the tree. B-tree is a fat tree. The height of B-Trees is kept low by putting maximum possible keys in a B-Tree node. Generally, the B-Tree node size is kept equal to the disk block size. Since the height of the B-tree is low so total disk accesses for most of the operations are reduced significantly compared to balanced Binary Search Trees like AVL Tree, Red-Black Tree, ..etc.
  • 9. Time Complexity of B-Tree: • Sr. No. Algorithm Time Complexity • 1. Search O(log n) • 2. Insert O(log n) • 3. Delete O(log n)
  • 10. Properties of B-Tree: • All leaves are at the same level. • A B-Tree is defined by the term minimum degree ‘t’. The value of t depends upon disk block size. • Every node except root must contain at least (ceiling)([t-1]/2) keys. The root may contain minimum 1 key. • All nodes (including root) may contain at most t – 1 keys. • Number of children of a node is equal to the number of keys in it plus 1. • All keys of a node are sorted in increasing order. The child between two keys k1 and k2 contains all keys in the range from k1 and k2. • B-Tree grows and shrinks from the root which is unlike Binary Search Tree. Binary Search Trees grow downward and also shrink from downward. • Like other balanced Binary Search Trees, time complexity to search, insert and delete is O(log n).
  • 11. B+trees • The B+ tree is a balanced binary search tree. It follows a multi-level index format. • In the B+ tree, leaf nodes denote actual data pointers. B+ tree ensures that all leaf nodes remain at the same height. • In the B+ tree, the leaf nodes are linked using a link list. Therefore, a B+ tree can support random access as well as sequential access.
  • 12. Structure of B+ Tree • In the B+ tree, every leaf node is at equal distance from the root node. The B+ tree is of the order n where n is fixed for every B+ tree. • It contains an internal node and leaf node.
  • 14. Internal node • An internal node of the B+ tree can contain at least n/2 record pointers except the root node. • At most, an internal node of the tree contains n pointers. • Leaf node • The leaf node of the B+ tree can contain at least n/2 record pointers and n/2 key values. • At most, a leaf node contains n record pointer and n key values. • Every leaf node of the B+ tree contains one block pointer P to point to next leaf node. •