SlideShare a Scribd company logo
1 of 31
Download to read offline
NEHRUREVATHY
DEPT
. OF BCA
DATABASE MANAGEMENT SYSTEM
Any Queries:nehrurevathy@gmail.com
Three primary methods:
1.sequential storage
2.creating index table for data
3.direct/hashed key storage
1.sequential storage
Each row is stored in a predefined order.
Uses:
-- data retrieval is always in a fixed order.
--contains a lot of common data.
--backup for transferring data to a different db.
Drawbacks:
1.finding an arbitrary row is much slower.
2.deletion is fast and efficient but the
problem occurs when you want to inserta
new row.
8 SUDHARCHANAN
9 YOKESH
ID NAME
1 AGASH
2 AJITH Insert a new data with the name of
3 HARISH
naresh.
4 MUGESH
5 DINESH
6 MANOJ
7 LOGESH
Step1:Read each row.
Step2:Decide if this row comes before the
new row,
- - - I f so,store it in a new table.
Step3:Reach the insertion point,save the new
row of data.
Step4:Append the rest of the data to the end
of the new table.
To add a row of data,the db has to retrieve
every row in the table.
Operations for inserting a new row into a
table:
Sort the name and insert the new
row(naresh).
Copy the top of the table to a newtable.
Store the new data row (10 Naresh).
Copy the rest of the data.
ID NAME
1 AGASH
2 AJITH
5 DINESH
3 HARISH
6 MANOJ
4 MUGESH
10 NARESH
7 LOKESH
8
9
SUDHARC
H
YOKESH
ANAN
Problems of sequential tables can be solved
by using a indexes.
Use of pointers:
--when data is stored,it is stored atsome
location.
--This location is identified by address.
-- A variable that points to this address is
called a pointer.
--Physical pointers used to provide fast
access to data.
Drawbacks:
-- db is tied to a specific disk drive.
--Data must be stored in the same physical
location.
Backup restoring
Move the db to a new drive
DATA
KEY V
ALUE ADDRESS
POINTER
ADDRESS
Data can be stored in
one location.
key value can be
stored in a different
location.
When the db retrieves
the key value,it follows
the pointer to retrieve
the associated data.
Faster access to data.
Sorts and stores the key value from the
original table along with a pointer to the rest
of the data in each row.
USES:
--Fast random and sequential accessto
tables.
-- DB system can search the index and use
the pointers to retrieve the desireddata.
Address ID Name
A11 1 K
A22 2 B
A32 3 G
A42 4 A
A47 5 L
A58 6 W
A63 7 V
A67 8 U
A78 9 R
A83 10 S
ID Pointer
1 A11
2 A22
3 A32
4 A42
5 A47
6 A58
7 A63
8 A67
9 A78
10 A83
Name Pointer
K A11
B A22
G A32
A A42
L A47
W A58
V A63
U A67
R A78
S A83
Indexed for ID and
Name
Sorted index can be searched rapidly.
If you search a file sequentially,use N+1/2
data look ups to find the desired row.
Binary Search:keeps splitting the data set in
half until it findsthe desired data.
Example:
To find the entry for Perin.start at the
midpoint 14 /2=7 and the 7th entry is Manoj.
NAME
AGASH
AJITH
DINESH
HARISH
KARTHICK
LOKESH
MANOJ
MUKESH
NARESH
PERIN
PRATHI
RATHAKRISHNAN
SURENDHAR
YOKESH
Since Perin comes after Manoj,you have
eliminated first half of the entries in the
table.
NAME
AGASH
AJITH
DINESH
HARISH
KARTHICK
LOKESH
MANOJ
Name
MUKESH
NARESH
PERIN
PRATHI
RATHAKRISHNAN
SURENDHAR
YOKESH
Now divide the remaining entries
in half to find the new mid point
7/2=3.5=>4.
Now Perin comes before Prathi,so
remaining entries.
Repeat this process until you find
the desired value.
requires four lookup steps to
find the entry for Perin.
Drawbacks:
If the index is stored sequentially then it
faces the same difficulties with inserting a
new row as the sequential approach.
Indexes are defined when a new row of data
is added to the table,every index is to be
modified.
Steps to select an indexed columns:
1. To index only the columns that require
random searches.
2.Index the columns used in the JOIN
condition.
3. To test your application with large amount
of simple data and heavy usage.
4. A good analyser can monitor usage,
- - - identifyproblems.
--- suggest which columns should be
indexed.
To solve a insert problem,indexes can
generally based on linked list instead of
sequential index list.
With a linked list,
---Any data element can be stored
separately.
A pointer is then used to link to the next data
item.
An index element – 3 parts:
1.Key Value
2.A pointer to the associated data element.
3.A pointer to the next index element.
Advantage:
Insertion and deletion of data can be made
easily and rapidly.
Eaton B71 ***B14 A58
B29
B14 Eles B71 A97
New element keep the B14
address
Farris B38 A63
B71
Inserting a new key row into a linked list
requires three basic steps:
1.Store the data and store the index element
keeping the address of each.
2.Find the point in the index to insert the
new row using a binary search.
3.Change the link pointers.
Link the elements into a tree.
Each element contains:
--key value.
--pointer to the rest of thedata.
-- two link pointers.
< key Data <=
Two links:
1.Left Pointer– lower values.
2.Right Pointer- value greater than or to the value
in the node.
Root Node - highest node on the tree.
Bottom Node – called as leaves end of the tree
branches.
The number of nodes between the root and the leaves
are called the depth of the tree.
Set the degree m and m is usually an odd
number.
-- The degree represents the maximum
number of children that can fall below
any node.
Every node (except the root) must have between
m/ 2 and m children.
All leaves are at the same level or depth.
All key values are displayed on the bottom
leaves.
A non-leaf nodes with n children will contain n-1
key values.
Leaves are connected by pointers.
Advantage:
--provides a guaranteed level of performance
for access to the data.
-- fast sequential retrieval.
--ability to add or delete elements from the
tree.
Store all the key values in numbered storage
location.
Key value is converted to a storage location
number and is divided by a prime number.
Example:
Consider 100 elements with key values
ranging from 100 to 999.
-- 101 is the prime number.
--divide each key value by the prime number
and look at the remainder.
528 key value
23
remainder
Location number
528 key value will be s.tored in location number 23
If two keys have the same remainder,one is
stored in an overflow location.
711
310
528
Overflow /collisions
Uses:
1.fast for finding and storing randomdata.
2.The key value is immediately converted
into a storage location.
Drawbacks:
1.no sequential retrieval of data.
2.more time to reorganize the table.
3.decide the space that will be needed before
you collect the data.
THANK YOU

More Related Content

What's hot

Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structureMahmoud Alfarra
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy TutorialAfzal Badshah
 
Data Structure using c language for beginners
Data Structure using c language for beginners Data Structure using c language for beginners
Data Structure using c language for beginners Vinayak SofTech
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Introduction of Data Structure
Introduction of Data StructureIntroduction of Data Structure
Introduction of Data StructureMandavi Classes
 
Linked list (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1DrSudeshna
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueGhaffar Khan
 
SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query OptimizationBrian Gallagher
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure pptNalinNishant3
 
computer notes - Linked list
computer notes - Linked listcomputer notes - Linked list
computer notes - Linked listecomputernotes
 
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARIntroduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARBHARATH KUMAR
 
Chapter 1( intro &amp; overview)
Chapter 1( intro &amp; overview)Chapter 1( intro &amp; overview)
Chapter 1( intro &amp; overview)MUHAMMAD AAMIR
 
Java Linked List Tutorial | Edureka
Java Linked List Tutorial |  EdurekaJava Linked List Tutorial |  Edureka
Java Linked List Tutorial | EdurekaEdureka!
 
Data structure week y 4
Data structure week y 4Data structure week y 4
Data structure week y 4karmuhtam
 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechniclavparmar007
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data StructureA. N. M. Jubaer
 

What's hot (20)

Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structure
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutorial
 
Data structures
Data structuresData structures
Data structures
 
Data Structure using c language for beginners
Data Structure using c language for beginners Data Structure using c language for beginners
Data Structure using c language for beginners
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Data structures 1
Data structures 1Data structures 1
Data structures 1
 
Introduction of Data Structure
Introduction of Data StructureIntroduction of Data Structure
Introduction of Data Structure
 
Linked list (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
 
SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query Optimization
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
computer notes - Linked list
computer notes - Linked listcomputer notes - Linked list
computer notes - Linked list
 
Linked List
Linked ListLinked List
Linked List
 
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARIntroduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
 
Chapter 1( intro &amp; overview)
Chapter 1( intro &amp; overview)Chapter 1( intro &amp; overview)
Chapter 1( intro &amp; overview)
 
Binary tree
Binary treeBinary tree
Binary tree
 
Java Linked List Tutorial | Edureka
Java Linked List Tutorial |  EdurekaJava Linked List Tutorial |  Edureka
Java Linked List Tutorial | Edureka
 
Data structure week y 4
Data structure week y 4Data structure week y 4
Data structure week y 4
 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data Structure
 

Similar to Database Indexing and Storage Methods

ds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfKamranAli649587
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
CS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdfCS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdfraji175286
 
Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testspriyanshukumar97908
 
B TREE ( a to z concept ) in data structure or DBMS
B TREE ( a to z concept ) in data structure  or DBMSB TREE ( a to z concept ) in data structure  or DBMS
B TREE ( a to z concept ) in data structure or DBMSMathkeBhoot
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structuresDurgaDeviCbit
 
Data Structures_Linked List
Data Structures_Linked ListData Structures_Linked List
Data Structures_Linked ListThenmozhiK5
 
Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)pushpalathakrishnan
 
DS_LinkedList.pptx
DS_LinkedList.pptxDS_LinkedList.pptx
DS_LinkedList.pptxmsohail37
 
DS Module 03.pdf
DS Module 03.pdfDS Module 03.pdf
DS Module 03.pdfSonaPathak5
 
Unit 4 data storage and querying
Unit 4   data storage and queryingUnit 4   data storage and querying
Unit 4 data storage and queryingRavindran Kannan
 

Similar to Database Indexing and Storage Methods (20)

Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
 
ds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdf
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
single linked list
single linked listsingle linked list
single linked list
 
Linkedlists
LinkedlistsLinkedlists
Linkedlists
 
CS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdfCS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdf
 
Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and tests
 
B TREE ( a to z concept ) in data structure or DBMS
B TREE ( a to z concept ) in data structure  or DBMSB TREE ( a to z concept ) in data structure  or DBMS
B TREE ( a to z concept ) in data structure or DBMS
 
Data structure
 Data structure Data structure
Data structure
 
Linked list.docx
Linked list.docxLinked list.docx
Linked list.docx
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
 
module 3-.pptx
module 3-.pptxmodule 3-.pptx
module 3-.pptx
 
B+ trees and height balance tree
B+ trees and height balance treeB+ trees and height balance tree
B+ trees and height balance tree
 
Data Structures_Linked List
Data Structures_Linked ListData Structures_Linked List
Data Structures_Linked List
 
Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)
 
DS_LinkedList.pptx
DS_LinkedList.pptxDS_LinkedList.pptx
DS_LinkedList.pptx
 
DS Module 03.pdf
DS Module 03.pdfDS Module 03.pdf
DS Module 03.pdf
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Linked List
Linked ListLinked List
Linked List
 
Unit 4 data storage and querying
Unit 4   data storage and queryingUnit 4   data storage and querying
Unit 4 data storage and querying
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 

Database Indexing and Storage Methods

  • 1. NEHRUREVATHY DEPT . OF BCA DATABASE MANAGEMENT SYSTEM Any Queries:nehrurevathy@gmail.com
  • 2. Three primary methods: 1.sequential storage 2.creating index table for data 3.direct/hashed key storage 1.sequential storage Each row is stored in a predefined order. Uses: -- data retrieval is always in a fixed order. --contains a lot of common data. --backup for transferring data to a different db.
  • 3. Drawbacks: 1.finding an arbitrary row is much slower. 2.deletion is fast and efficient but the problem occurs when you want to inserta new row.
  • 4. 8 SUDHARCHANAN 9 YOKESH ID NAME 1 AGASH 2 AJITH Insert a new data with the name of 3 HARISH naresh. 4 MUGESH 5 DINESH 6 MANOJ 7 LOGESH
  • 5. Step1:Read each row. Step2:Decide if this row comes before the new row, - - - I f so,store it in a new table. Step3:Reach the insertion point,save the new row of data. Step4:Append the rest of the data to the end of the new table.
  • 6. To add a row of data,the db has to retrieve every row in the table. Operations for inserting a new row into a table: Sort the name and insert the new row(naresh). Copy the top of the table to a newtable. Store the new data row (10 Naresh). Copy the rest of the data.
  • 7. ID NAME 1 AGASH 2 AJITH 5 DINESH 3 HARISH 6 MANOJ 4 MUGESH 10 NARESH 7 LOKESH 8 9 SUDHARC H YOKESH ANAN
  • 8. Problems of sequential tables can be solved by using a indexes. Use of pointers: --when data is stored,it is stored atsome location. --This location is identified by address. -- A variable that points to this address is called a pointer. --Physical pointers used to provide fast access to data.
  • 9. Drawbacks: -- db is tied to a specific disk drive. --Data must be stored in the same physical location. Backup restoring Move the db to a new drive
  • 10. DATA KEY V ALUE ADDRESS POINTER ADDRESS Data can be stored in one location. key value can be stored in a different location. When the db retrieves the key value,it follows the pointer to retrieve the associated data.
  • 11. Faster access to data. Sorts and stores the key value from the original table along with a pointer to the rest of the data in each row. USES: --Fast random and sequential accessto tables. -- DB system can search the index and use the pointers to retrieve the desireddata.
  • 12. Address ID Name A11 1 K A22 2 B A32 3 G A42 4 A A47 5 L A58 6 W A63 7 V A67 8 U A78 9 R A83 10 S ID Pointer 1 A11 2 A22 3 A32 4 A42 5 A47 6 A58 7 A63 8 A67 9 A78 10 A83 Name Pointer K A11 B A22 G A32 A A42 L A47 W A58 V A63 U A67 R A78 S A83 Indexed for ID and Name
  • 13. Sorted index can be searched rapidly. If you search a file sequentially,use N+1/2 data look ups to find the desired row. Binary Search:keeps splitting the data set in half until it findsthe desired data. Example: To find the entry for Perin.start at the midpoint 14 /2=7 and the 7th entry is Manoj.
  • 14. NAME AGASH AJITH DINESH HARISH KARTHICK LOKESH MANOJ MUKESH NARESH PERIN PRATHI RATHAKRISHNAN SURENDHAR YOKESH Since Perin comes after Manoj,you have eliminated first half of the entries in the table. NAME AGASH AJITH DINESH HARISH KARTHICK LOKESH MANOJ
  • 15. Name MUKESH NARESH PERIN PRATHI RATHAKRISHNAN SURENDHAR YOKESH Now divide the remaining entries in half to find the new mid point 7/2=3.5=>4. Now Perin comes before Prathi,so remaining entries. Repeat this process until you find the desired value. requires four lookup steps to find the entry for Perin.
  • 16. Drawbacks: If the index is stored sequentially then it faces the same difficulties with inserting a new row as the sequential approach. Indexes are defined when a new row of data is added to the table,every index is to be modified.
  • 17. Steps to select an indexed columns: 1. To index only the columns that require random searches. 2.Index the columns used in the JOIN condition. 3. To test your application with large amount of simple data and heavy usage. 4. A good analyser can monitor usage, - - - identifyproblems. --- suggest which columns should be indexed.
  • 18. To solve a insert problem,indexes can generally based on linked list instead of sequential index list. With a linked list, ---Any data element can be stored separately. A pointer is then used to link to the next data item.
  • 19.
  • 20. An index element – 3 parts: 1.Key Value 2.A pointer to the associated data element. 3.A pointer to the next index element. Advantage: Insertion and deletion of data can be made easily and rapidly.
  • 21. Eaton B71 ***B14 A58 B29 B14 Eles B71 A97 New element keep the B14 address Farris B38 A63 B71
  • 22. Inserting a new key row into a linked list requires three basic steps: 1.Store the data and store the index element keeping the address of each. 2.Find the point in the index to insert the new row using a binary search. 3.Change the link pointers.
  • 23. Link the elements into a tree. Each element contains: --key value. --pointer to the rest of thedata. -- two link pointers.
  • 24. < key Data <= Two links: 1.Left Pointer– lower values. 2.Right Pointer- value greater than or to the value in the node. Root Node - highest node on the tree. Bottom Node – called as leaves end of the tree branches. The number of nodes between the root and the leaves are called the depth of the tree.
  • 25. Set the degree m and m is usually an odd number. -- The degree represents the maximum number of children that can fall below any node. Every node (except the root) must have between m/ 2 and m children. All leaves are at the same level or depth. All key values are displayed on the bottom leaves. A non-leaf nodes with n children will contain n-1 key values. Leaves are connected by pointers.
  • 26. Advantage: --provides a guaranteed level of performance for access to the data. -- fast sequential retrieval. --ability to add or delete elements from the tree.
  • 27. Store all the key values in numbered storage location. Key value is converted to a storage location number and is divided by a prime number. Example: Consider 100 elements with key values ranging from 100 to 999. -- 101 is the prime number. --divide each key value by the prime number and look at the remainder.
  • 28. 528 key value 23 remainder Location number 528 key value will be s.tored in location number 23
  • 29. If two keys have the same remainder,one is stored in an overflow location. 711 310 528 Overflow /collisions
  • 30. Uses: 1.fast for finding and storing randomdata. 2.The key value is immediately converted into a storage location. Drawbacks: 1.no sequential retrieval of data. 2.more time to reorganize the table. 3.decide the space that will be needed before you collect the data.