0% found this document useful (0 votes)
1 views22 pages

DBMS5

The document provides an overview of database management systems, focusing on indexing and file organization. It discusses various types of indexes, including primary, secondary, and clustering indexes, as well as the differences between ISAM and B+ tree structures. Additionally, it covers the performance implications of indexing and the costs associated with different file operations.

Uploaded by

shinchanm1809
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views22 pages

DBMS5

The document provides an overview of database management systems, focusing on indexing and file organization. It discusses various types of indexes, including primary, secondary, and clustering indexes, as well as the differences between ISAM and B+ tree structures. Additionally, it covers the performance implications of indexing and the costs associated with different file operations.

Uploaded by

shinchanm1809
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Database ManagementSystems

5.14
UNIT
CLOUD SERVICE
PROVIDERS

(Important Formulae)
Transaction Menagement (3) Indexing : Indexing refers to the process of
findinga particular record in a file usingone
Transactions or more index or (indexes) or storing a record
indexing in any order (randomly on the disk)
Overview of storage and
Data on externalstorage Indexing
File organization and indexing
. Index data structures
- Comparison of file organization
Tree - structured indexing Hash based Tree based
Indexing Indexing
- Intuition for tree indexes
- Indexed sequentialaccess method (4) ISAM : ISAM stands for Indexed sequentiai
(1SAM) Access Method
B+ Tress: Dynamic Index Structure, (5) B+ tress: B* -tree index structure
Search, Insert, Delete represents a balanced tree satisfying the
Hash - Based Indexing: following properties
- Static hashing (i) Allpaths from root to node follow the same
’ Extendible hashing length
’ Linear hashing (ii) Each node that is not a root or leaf has
between n/2 and n children
’ Extendible vs linear hashing
(1) Index: n-I
(iii) A leaf node had between and a-1 values
in database, an index is a data structure that 2
improves the speed of data retrieval
operations on adatabase table
(2) Types of indexes: There are 3 types of
indexes
Primary index
() Secondary index
(ii) Clustering index

Warning :
XeroxlPhotocopying of this book ls a CRIMINAL Act. Anyone found guilty ls LIABLE to face LEGAL proceedings
Database Management Systems
Answers
152
Short Questions with
alternatives for what
main to store
Q1. Write a short notes on Data on external There are three an index :
entry in
storage ? as a data
Adata entryk* is an actual data reCord (with
Ans (1)
search key k)
A DBMS stores vast guantities of data and Adata entryis a <krid> pair, where id is the
the data must persist across program executions. (2) recordid of a datarecord with search key valkue k.
Therefore, data is stored on extermal storage devices Adata entry is a <k, rid.-list> pair, where
such as disks and tapes, and fetched into main (3) record ids of data
memory as needed for processing. The unit of
is a list of
rid-list
with search key
value k. records
information readfrom written to disk is a page Q4. Define an index. Whát are the different
The size of a page isa DBMS parameterand typical
values are 4kb or 8ktb The cost of page /O (input kinds of indexes ?
from disk to main memory and output from Ans : In database, anindex is a data structure that
memory to disk) dominates the cost of typical improves the speed of data retrieval operations
database operations, and database systems are
in databases ,
carefully optimized to minimize the cost. The a database table. Indexes indey i
following points are important to keep in mind. analogous to indexes in text book. The called'
field of the file
(1) Disks are the most important external storage usuallyspecified on one is a fileot
devices. indexing field. One form of an index
(2) Tapes anre sequential access devices access entries containing field value and pointer
to record
devicesand force usto read data one page after which is ordered by field value. The index file ie
the other. They are mostly used to archieve data the term used to describe the records.
that isnot needed on a regular basis Types of indexes:
(3) Each reord in a fle has a unique identifier In DBMS, there are three types of indexces
called a record id, or rid for short (i) Primary index
Q2. What is file organizations and indexing ? (ii) Secondary index
Ans : (iüü) Clustering index
File Organization : (1) Primary index :
File organization is a mechanism of An index that is defined based on ordering
physically arrangingor organizing the records of a key field of an ordered file is called
file onto secondary storage devices such as primary index. Primary indices are two
magnetic disk, tapes or CD-ROM. types (1) Dense Index (2) sparse index.
Afile can be created, destroyed and have (ii) Secondary index :
An index that is defined based on non
records inserted into and deleted from it.
ordering field of the data file is called
Indexing: secondary index.
An index is a data structure that organizes
data records on disk to optimize certain kinds of (i1) Clustering index :
retrieval operations. An index allows us to An index defined on the ordering a file of an
efficientiy retrieve all records that satisfy search ordered file is called clustering index.
condition on the search key fields of the index. We Q5. Give the properties of indexes?
can aiso create additional indexes on a given Ans:
collection of data records, each with a different The properties of indexed are as follows :
search key to speed up search operations that are (1) Indexed enhance the performance level ot
not efficientiy supported by the file organization the databases.
used to store the date records. (2) Theycan retrieve the records in a particular
Q3. What is data entry and what are the alterna sequence order.
tives that to store as a data entry in a index? (3) They are capable of addressing the
Ans : requirements of the application program.
The term data entry to refer to the records (4) They consume less time to locate the file records
storedinan index file. A data entrywith search (5) They eliminate the need to analyze each enty
key value k, denoted as k*, contains enough during the query execution.
with
information to locate one or more data records (6) They increase the speed of accessing ao
search key value k, we can efficiently search an records.
then use
index to find the desired data entries and (7) They can perform binary search on variable
records.
these to obtain data length file records.
Warning: Xerox/Photocopying of this book is a CRIMINAL.Act. Anyone found guilty is LIABLE to face LEGAL proceedings
Database Management Systems
5.3
is the difference between a primary
index and a secondary index ?
Q6. What
Ans

Primany index Secondary index


econds are of fixed 1. It provides a secondary means of
1 It is an ordered file whose
length with two fields accessing a file for which some primary
access already exists
Onv based on the prmary kev. the
3 The total number of entries in the index is 2. May be based on candidate key or
in the secondary key
same as the number of disk blocks
ordered data file 3. It has a large number of entries due to
Primanv index is a king of nondense (sparse) duplication.
index. 4. Secondary index is a kind of dense index
There mav be at must one primary index for 5. There may be more than one secondary
a file indexes for the same file
Needs les storage space 6. Needs more storage space and longer
search time

07 Give the difference between ISAM and Bt - tree indexes ?


Ans

ISAM B+ - tree
1 SAM (ndexed sequential Access Method) 1. B+ -ree is a dynamic indexingstructure
is a staticindexing structure. 2. Applicable for dynamic files
2 Appicable for static files 3. The leaf pages are allocated randomly
3. The leaf pages are allocated sequentially 4. Due to dynamic size of B+ - trees,
4. Due to static size of ISAM, overflow chains overflow chains may frequently occur
may rarely occur 5. Leaf as well as index level pages can be
5. Oniy leaf pages can be modified modified
6. Scanning is done more efficiently 6. Scahning is done les effienty
7 Insertions lead to long overflow chains 7. Insertions are handled elegantly without
8. The number of nodes to be examined is overflow chains
equal to B+ tree plus the number of The number of nodes to be examined is
overfiow pages equal to the height of tree
9. The pertormance of ISAM is less efficient 9. The perfomance of B+ -trees is more
10 Locking over head of ISAM is less efficient
10. Locking overhead of B+ trees is more

Q8. Differentiate between sparse and dense indices ?


Ans :

Sparse indice Dense indice


1. Index entry is available for only 1. Index entry is available for every
few of the search key values search key value in the file.
2. The index size of the dense index 2. The index size of the sparse index is
is smaller
larger
3. It is applicable only when the 3. It is applicable in either case
relation is present in sorted order
of search key
4.. It is
5. complex
It consume more
4 It is simple
time 5. It consume less time
6. It locate the
records indirectly 6. It locates the records directly
Warning:
Xerox/Photocopying9 of this book is a
CRIMINAL Act. Anyone found guilty is LIABLE to face LEGAL proceedings
5.4

Database Managenent Syatems unclustered


indices?
Q9, DIfferentlate between clustered and Unclusteredindice
ordering
whichthe
Ans:, organizationinsameasthe
Clustered indce 1. Afile recordis not someindex
ofdata data entriesinclustered
I. Afle organization in which the ordering of orderingof severedun
be
data records is same as the ordering of data Therecan file.
2.. indexedona data dataentries pointto
entrBes in some index is called clustered index qualifying retrieve
on a leadto
Z. There can beonv one clustered index The ridin
3. distinctpages which
data file a modification
data entries point to a severalpages
3, The rid in gualifving record which lead to data
additionand clusterirdex
Contiguouscollection of 4. The isnot_loOweras effective
t retieve only few pages modification process 0s process iscost
and Unclusteredindex
4 The data addition 5
slower to
is relatively expensive
5. Clustered indexthe file is updated.
maintain when
compared ? collection
organizations are organizations on a
Q10. How the file several basicfile Composite key and
operations for according to are the
Ans :
ofsome simple indexed are organized
organization that we consider
the costs that the file
and
We compare
records. We assume specified on these fields..
the
employee are
of selection operations
tnat allthe heap file
following. ordered employee records, or
File of randomly records sorted on <age,sal>
File of employee with search key
<age.sal>
Clustered B* tree file on <age.sal>
unclustured B+ tree index
Heap fièl with an <age.sal>
an un clustered hash index on
Heap file with
there:
weconsider are
The operations
(1) Scan;
selection
(2) Search with equality
selection
(3) Search with range
Insert a record
(4)
Delete a record
(5)
comparison of l/O costs?
Q11. Give the
Insert Delete
Ans :
Scan
Equality Search Range Search .Search + D
File Type 0.5 BD BD 2D
Search + BD
Heap BD Search + BD
Dlog2B Dlogz + #
Sorted BD
Matching pages Search D
Dlog- 1.5B Dlogr5 1.5B + # Search + D
Clustered 1.5 BD
Matching pages
Search +2D
Uncustered BD(R +0.15) D(1log-0 0.15B) D(log0 0.15B + #|D(3+log-0.15B)
Tree index
Matching records
BD 4D Search + 2D
Unclustered BD(R+0.125) 2D
Has index

model of heap file ?


Q12. Write ashort note on cost
Ans:
Scan:
The cost is B(D+RC) because we must t retrieve each of Bpages taking time D per page andfor
taking time cper record.
each page, process R records

Warning:Xerox/Photocopying of this book is aCRIMINAL Act. Anyone found gullty is LIABLE to face proceedings
LEGAL
Database Management Systems

selection: record exists and the distribution values


equality half the file assuming the page to see
wlth
Search we must scan
retrieved data page, we must check allrecords on the
average
On uniform.Foreach
fielldis B(D+ RC)
search The costis 0.5
record.
inthedesired selection: and
range qualifying recotds could appear anywhere in the file,
because
Searchwith file must be scanned exists. The cost is B(D+RC)
entire qualifying records
The how
not,know fetch the last page in
we do
inserted at the end of the file, we must
always
records are is 2D+C
page back. The cost
Insert:
assumethatt write the
We record and
add,the back we
thefile.
the page and write the modified page
the record from deletions, the
Delete: the record, remove reclaim the free space createdby
find
We must attemptis made to
compact the file to
no C+D.
aSSumethatt searchingplus ?
cost of of disk structure
onstisthe performanceimplications
O13.Listthe
structure:
Ans: implication ofdisk operate on it.
Performance the DBMS to
in memory tor memory is a block
m Data must be transfer between disk and main Reading or writing a disk
block
The unit for data block is transferred.
0
is needed the entire
#a single item on a block
operator of data:
is called on I/0 varies, depending on the location
write a block
The time to read or rotational delay+
transfer time.
= seek time +
Access time
noteson ISAM?
Q14.Write a short the
The data entries of the 1SAM index are in
Ans :
sequential access method. systems
some leaf page. Database physical
ISAM stands for indexed pages chained to
additional overflow to the
boundaries correspond closely and facilitates
leaf pages of the tree and pages so that page completely static
carefuly organize the layout ofstorage device. The ISAM structure is
characteristics of the underlying
diagram of indexed sequential access method data
The following is the
such low leveloptimization.
structure.

Leaf pages
Overflow page Primary pages
Fig : ISAM Index Structure
proceedings
Warning :Xerox/Photocopying guitty is LIABLE to face LEGAL
of this book is a CRIMINAL Act. Anyone found
Database Management:Systems
Q15. Write a short notes on B'- trees ?
Ans:
B* -tree index structure following properties:
represents a balanced tree satisfyingtgthe
(i) Allpaths from root to node follow the same length
(iü) Cach node that is not aroot or leaf has between Gand n chilaren
n-1
(ii) A leaf node has between and n-1 values

Structure of B' tree


much difficult to multi
B* - tree refers to multi level index, but its structure is very
Sequentialfile. The structure of typical node of a B* - tree is shown below. level index
P K, P, K Ps Ko.. Pat Kni Pn
Fig : Node of B tree
In the above figure K, K, represents search key values and P Pz...represents pointer to
records or bucket of records.
organizations:
Q16. Differentiate between seguentialfile and indexed sequential file
Ans :
Sequential File Organizations Indexed Sequential File Organization
1 In sequential file organization records 1. In indexed sequential file
are stored in sequential access organization often rcords are stored
in direct access devices
storage devices
2. In this required records are being 2. In this, desired records are searched
accesed by searching from either sequential or randomly
beginning of the file end of the file
tillthe reoords is found
3. This organization is economically low 3. This organization is very expensive
4. Accessing speed is very less 4. Accessing speed is more
5. Time consumption is more 5 Time consumption is very less

Q17. What is static hashing?


Ans :
The pages containing the date can be viewed as a collection of buckets, with one primary page
and possible additional overflowpages per bucket. Afile consists of buckets 0through N-1 with one
primary page per bucket initially.
Instatic hashing technique the records are stored in fixed number of small storage units called
buckets. Abucket is a small disk block that can hold one or more records. Ahas function 'h' is used to
map any search key ki to one of the buckets B:

h (key) mod N 1

key h

N-1

Overflow pages
Primary bucket pages
Fig: Static Hashing
Warning: Xerox/Photocopying of this book is a CRIMINAL Act. Anyone found guity is IABLE to face LEGALproceodings
Database Management Systems
hashing ?
5.7
Write a short
notes on extendible
Q18.
Ans: dynamic hashing technique that is capable of dividing the buckets as
Extendible hashing is athem as it shrinks. This requires reorganization of buckets in hash table.
and rejoining
database grows
feature of extendible hashing is that it reduces the performance overhead of hashing
An
important
performs reorganization only on one bucket ata time.
t
becauseit of extendible hash
general structure
The fiqure below shows the
dË Bucket 1

00...
01..
dT
10..
Bucket 2
11....

dg
Bucket 3

111....
Bucket
Address
Table

Bucket 'n'

Q19. Write a short notes on linear hashing?


Ans :
Linear hashing :
hashing, this technique does not
Linear hashing is a dynamic hashing technique unlike extendible
.h...........where each function has a
use a directory. Instead it used a value of hash function h.,h,
range that is double of its predecessor
Hi(value) =h(value)mod(2N)
hashing ?
Q20. Write a short notes on the relation between extendible and linear
Ans:
hashing,we have a directory
lo understand the relationship between linear hashing and extendible we add directory element
n inear hashing with elements 0 to N-1. The first split is at bucket 0 and so
element
n principle we may imagine that the entire directory has been doubled at this point, because
on. The second split
e same as element N+1, elemnent 2 is the same as element N+2 and so
dccurs at bucket 1, now directory element N+1 becomes significant and is added. At the end of the
tound, all the original Nbuckets are split, and the directory is doubled in size.

Warning: Xerox/Photocopying of this book is a CRIMINAL Act. Anyone found guilty is IABLE to face LEGAL proceedings
Database Management Systems 5.8
Questions with Answers
5.1
Essay
ATA EXTERNAL
ON STORAGE
Q1. Explain data on external storage?
Ans:
A DBMS stores vast quantities of data, and the data must persist across program executions.
is stored storano dovices such as disks and tapes, and tetched into mai
on ovtonalThe
memory asdata
Tnerefore, needed for processing. unit of information read from or written to disk is a page. The
size of a page is a DBMS parameter, and typical values are4kb or 8kb. The cost of page l/O (input from
dIsk tomain memorv and output fron memoy to disk) dominates
the costof typical database operatione
this cost. While the details of how files t
dhd database systems are carefully ontimizedto minimize utilized are covered, the following poin
Tecords are physicallv stored ondisk and how main memorv is
are important to keep in mind.
They allow us to retrieve any page at
DISkS are the mOst importantexternal stora ge devices.
the older that they are stored physicall,
fIxed cost per page. However if we read several pages insame
reading the pages in a random order.
the cost canbe much less than the cost of
after the other. They aro
lapes are sequential access devices and force us to read data one page
mostBv used to archieve datathat is not needed on a regular basis.
An rid has the
Each record in a file has a unigue jdentifier called a record id, or rid for short.
rid
property that we can identify the disk address of the page containing the record by using the
Data is read
software
into memory for processing and written to disk for persistent storage by a layer of
called buffer manager when the files and access methods layer needs to process a page.
fetches the
it asks buffer manager to fetch the page, specifying the pages rid. The buffer manager
page from disk if it is not already in memory.
Q2. Expiain the memory hierarchy ?
Ans :
Memory in a computer system is arranged in hierarchy. At the top, we have primary storage,
which consists of cache and main memory and provides very fast access to data. Then comes secondary
storage. which consists of slower devices such as magnetic disks. Tertiary storage is the slowest class of
storage devices.
CPU

CACHE

Primary Storage
MAIN MEMORY
Request for data

MAGNETIC DISK
Secondary Storage

Data satistying
request TAPE
Tertiary Storage
Fig: The memory Hierarchy

Magnetic Disks:
Magnetic disks support direct access to a desired location and are widely used for database
'applications. A DBMS provides seamless access to data on disks, applications need not Worryabout
or disk.
whetherdata is in main memory
Warning: Xerox/Photocopying of this book is a CRIMINAL Act. Anyone found guilty is LIABLE to face LEGAL proceedings
Database Management Systems
called disk blocks, A disk block is a contiguous sequence of bytes
5.9 stored on disk in units from a disk. Blocks are arranged in concentric rings
Datais
which data is written to
a disk and read
in The set of all tracks with the same diameter is called a cylinder.
andunit on one or more platters. array of disk heads, one per recorded surface, is
calledtracts, dividedinto arch, çalled sectors. An computer. It implements commands to
is disk drive to the
Eachtrack unit. Adisk controllerinterfaces a transferring data to and from the disk surfaces.
movedas a sector by movingthe arm asssembly and
write a
for when data is written to sector
and stored with the sector.
read or computed
check.sumis
main memory takes approximately the same time.
A to any desired location in a disk block
disk is more complicated. The tine to access
access
While direct access a location on
determiningthe time to Seek time is time taken move the disk heads to the track on which a desired
components. block to rotate under the disk head.
waiting time for the desiredblock
has several
located. Rotational delay is the one the head is positioned.
write the data in the
blockis
time is the time to actually read or
Transfer time.
seek time + rotational delay + transfer
Access time =
management?
note on disk space
08 Write a detailed
Ans:
Management :
Disk Space isthe component of mini
space manager manages space on disk. Disk space manager also performs
The disk
of the allocation and de allocation of pages within a database. It context of a
hase that takes care file layer within the
torm disk and provides a logical
rOads and writes a pages to and
database managerment system.
accessed
contiguousblocks to hold the data that is frequently
The sequence of pages are stored as sequentially accessing disk block. This capability must also
This is advantageous for
in seguential order. DBMS by the disk spae manager.
be providedto the higher layers of the layers to
underlying hardware details and make the higher
The disk space manager hides all the
think of data as collection pages.
Handling of free blocks: grow or shrink
space manager keeps track of the space on the disk. The database may
The disk disk space
insertion or deletion operations are performed on it. To manage the disk space, the deletion
when the are on which disk blocks. The
as which pages
manager will keep track of used disk block as well
operation on the disk may create 'holes'
There are two ways to detemine block usage
(1) Using a list of free blocks
(2 Using bitmap
(1) Using a list of free blocks :
located they are added to the list for the future
Inthis method, whenever the blocks are deal the disk which points to the first block on
reference. The pointer is stored in known location on
the free list.
(2) Usingbitmap :
bit will help into determining whether the
bitmap maintains one bit for each disk block. Thissequence of blocks on disk very fast. This is
Dlock is free or not, which identifies and allocates
very difficult to implementwith the linked list.
PRIMARY & SECONDARY INDEXES
é FiLE ORGANIZATION AND INDEXING-CLUSTER INDEXES,
Q4. Explain about fixed length records?
Ans:
record slots are uniform and
uall records on the page are quaranteed to be of the same length, occupied by records and
are
earanged consecutively within a page. At anyinstant some slots

Warning : to face LEGAL proceedings


of this book 0s a CRIMINAL Act. Anyone found guilty is LIABLE
Xerox/Photocopying
Database Management Systems locate an empt. 5.10
others are un into the page, we must the record slot
place the recordoccupied.
is insertedWhen
a record is inserted
an emptyslot and place and
main issues are how we into the page, we
keep track of empty
must locate
slots and how we locate all records on a there. The
page. Tho
alternatives hinge on how we handle the deletion of record.
The first whenever a records is deleted
the last record alternative is to store records in the fist Nslots, allows us to locate the its we
on the page into the
page by a simple offset
vacated slot. This format
appear together at the end
move.
of the page.record on a
this approach does notcalculation.
alternative is Locating work
to handlerecords
and all empty slots
if there are external references to theper record that is moved. The
slot, to keep track of
However
second.
information. deletions by using
on the an arrayscanning
page requires the bit array find slots whose free
of bits, one
bit isslot
on
when a record is deleted it bit is length
turned off. The two alternatives for storing fixed records are
illustrated.
Packed Unpacked, Bitmap
Siot 1 Slot 1,
Slot 2 -Slot 2
Siot N Slot N

Free Space

N 1|M.
Page Header
Number of records Numbers of Slots
Fig: Alternative Page Organizations for fixed length records
The sioted page organization described for variable length records. It can also be used for fixed
iength records. It becomes attractive. If we need to move records around on a page for reasons ther
than keeping track of space frud bydeleted.
Q5. Expiain about variable length records ?
Ans :
Variabie length file organization isaway of arranging variable length records within a file. Basically,
variabie length records are the records of multiple sizes. In constraints to fixed - length records, variable
length records incur some overhead while performing insertion and deletion
of different between the space created after deleting the operation. This is because
record and the space required for in_erting the
record variabie length file organization is used for organizing the databases that store
greater than the disk block. In general variable length records include data where size is
a record consistingof.
Multiple records type in a file
(üi) Record types in which it is possible to define variable length fields
(iii) Record types in which it is possible to reverse thesame field
multiple times.
Slotted- page structure is a technique employed for implementing
structure is basically used for organizing records in ablock. Slotted page variableof lenath records. This
placed at the beginning of every individual block. This header stores the consists a header which is
information regarding.
(i) Total number of records entries present in the header
(ii) End of free space within the block

(ii) Arraythat contains entriesspecitying the location and size of the record

CRIMINAL Act. Anyone


Warning : Xerox/Photocopying of this book is a found guilty is LIABLE to face proceedings
LEGAL
Database Management Systems
5.11
Records
Block header

Size entries Free


Space R1 Rg .****** |Rn2 Rnt Rn
Lovation

Fig: Slotted page structure


indices?
different kinds of
s Defieean index? What are
kinds of retrieval
Ans:
that organizes data recordson disk tooptimize certain
Aindex is adata structure
operations.
(or)
retrieval operations on a
structure that improves the speed of data
Ib database an index is a data
detabase table.

Typesofindices :
types of indices:
In DBMS. there are three
Primary index
(u) Secondary index
(iüi) Clustering index
(i) Primary index;
field of an ordering file is called primary index. It
An index that is defined based on ordering key an ordered file consisting of two fields. Primary
follows the same ordering as that of the file. It is index.
indices are of two types i) Dense index ii) sparse index
record for every search key value in the file. The
(a) Dense index : Dense index has an index pointer to the first data record with that search key.
record contains the search key value and a
record for only some of the search key values in
(b) Sparse index : Sparse index has an index sequentially according to search key value.
the file. It isused when records are arranged
() Secondary index :
data file is called secondary index.
An index that is defined based on non ordering field of the on a key field is sometimes called a
Secondary index has different ordering than the one of the files. It record in the data file.
Secondary key. The key field is guaranteed to have unique value for each
(ii) Clustering index :
Clustering index
An index defined on the ordering file of an ordered file is called clustering index.
the data file can have
nas the same orderingas the one of the file. In cltstering index, ordering field of
Some values for several records in the file.
e What is primary and secondary indexes? Explain them with a suitable examples?
Ans :
Primary Index :
rOr topic primary index refer Q.No - 6Q Consider an example of primary index shown in the
abie. This table is specified on the ordered key attribute of the file and index contains two fields such as
index entry and apointer to the primary key field of the file.
Warning : Xerow Photocopying of this book is a CRIMINAL Act. Anyone found guity is LIABLE to face LEGAL proceedings
Database Management Systems 5.12
A-217 Brighton 750
Greatest Record Block Number Downtown 500
Number A-101
Downtown 600
40 A-110
A Miances 700
80 A-215 400
A-102 Peryridge
160 C |A-201 Perryridge 900
250 D A-218 Perryridge 700
Redwood 700
A-222
In order to search a row with key RoundHill 350
willrefer the first entryin the glven table "50', we
which is
A-305

greater number than '50' and go to the block 'B'.


then we can search '50 on the block Theabove figure shows asequential filo
account records taken from our
Secondary Index :
For answer topic secondary index refer
example. banking
question 6Q for example consider secondary index The sequential file organizaion allowe
consist of two values, index field and points to the records to be read in sorted order: that can
block of file. be useful for display purposes.

Secondary Block Number


For insertion,we apply the followingrules:
’ Locate the record in the file that comes
attribute value
20 A
before the record to be inserted in
search-key order.
30 B
45 C
lf there is a free record with in the same
block as this record, insert the new record
50 D
there. Otherwise insert the new record
in an overflow block.
Secondary index attribute can have duplicate
values which needs an entry to be created for each ’ The following figure shows the file after
of them. The index is generally ordered according insertion of record.
to the attribute even though the file is not ordered,
so that index can be searched quickly.
A-217 Brighton 750
Q8. List serveral of organizing records in a |A-101 Downtown 500
file ? Explain briefly sequential file or A-110 Downtown 600
ganization file organization? A-215 Miances 700
Ans : A-102 Perryridge 400
|A-201 Perryridge 900
Organizing Records in a file: A-218 Peryridge| 700
|A-222 Redwood 700
Several ways of organizingrecords in a file are:
A-305 RoundHil 350
(a Sequential file Organization
Heap file Organization
A-888 -Northtown 800
(c) Hashing file Organization
Sequential file Organization :
A sequential file is designed for efficient Q9. Explain Clustering File Organization
processing of records in sorted order based briefly?
on some search key. A search key is any Ans :
attribute or set of attributes; it need not be Clustering File Organization :
the primary key, or even a super key.
To permit fast retrieval of records in search relationMany relational database systems store each
in a separate file, so that they can take
key order, we chain together, records by full
pointers.
advantage of the file system that the operating
system provides. Usually tuples of a relation can
The pointer in each record points to the next be represented as fixed
record in search-key order. length records.
This simple implementation of a
database system is will suited torelational
low cost
database implementations.
CRIMINAL.Act. Anyone found guilty is
Warning:Xerox/Photocopying of this baok is a LIABLE to face LEGAL procaedings
Database Management Systems
storing many 5.3.1
HASHBASED INDEXING
6.13 advantage of following SQL
To see the onefile, consider Q11. Explainin detail about static hashing?
relationsin database. Ans :
Select bank
account_number, Custormername.
queryfor In static hashing when a search key value is
the
street,Customer city. provided, the has function always conputes
hash function
Customer same address. For example, if mod 4
fromdepositor,customer shallgenerate only 5 values. The
Customer_name = is used, then it shall always be same for that
Where depositor. output address remains
Customer. Customer name. function. The number of buckets provided
customer unchanged at all times.
depositor and
Consider the following figures.
relations asshown in Database
Customer_name account number,
A-102 C++
Hayes
A-220
Hayes 100 Java
A503
Hayes A-305
|Hayes Andriod
101
(a) Depositor relation Hash
jos
Customer_street Customer
city 102
Customer name VB
Main Brooklyn
Hayes Stamford 103
Tumer Putnam HTML
(b)Customer relation
Perl
Main Brookem
Hayes
Hayes A-102
Hayes A-220
Operation :
Hayes A-503 Insertion :
Putnam Stamford entered using
Tumer
When a record is required to be
Tumer A-305 computes the bucket
static hash, the function in record will be
(c) Clustering file structure address for search key k, where the
stored.
Hayes Main Brooklem Bucket address = h(k)
Hayes A-102
A-220 Search :
| Hayes retrieved the same
Hayes A-503 When a record needs to be
retrieve the address
Tumer Putnam Stamford hash function can be sued to
stored.
|Tumer A-305 of the bucket where data is
(4) Clustering file stru cute with pointer chaine Delete :
deletion
This is simply a search followed by
5.3 INDEXx DATA STRUCTURES HASH BASED, operation.
TREE BASED DATA STRUCTURES
Update :
will be
Q10. Explain in detail about the two baslc ap Data record marked up for update record
proaches for organlzing data enteries? function and then
searched using static hash
Ans : in that address is updated.
Indexing : Suppose we have to insert some records into
thefile. But the data bucket address generate by
The process of findinga particular record in
a Me using one or more index (or) (indexes) or the hash function is full for the data already exists
data. This
storing a record in anyorder. in that address. How do we insert the
situation in the static hashing is called bucket
Indexing overflow. This is one of the critical situations/
drawback in this method. Where willwe save the
There
data in this case we cannot lase the data.
situation.
Hash based Tree based are various methods to overcome this
Most common are listed below.
Warrilng g:Xorox/Photocopyig of this book is a CRIMINAL Act. Anyone found guilty ls LIABLE to face LEGAL
proceedings
Database Management Systeme
Closed hashing :
address and link it
5.14
In this method we
data bucket. These
methods
introduce a new data bucket with same
the bucket overflow are called closed hashing or
after the fu
hashing.
Open hashing:
offovercoming
overtlo
record,
In this available data block is used to enter the new
method, next
ting on the older one. This methodis caled openhashing or linear probing. instead o
Quadratlc problng: old and new
This is similarfunction
to lineartoprobing. there the difference betweenthe
linear. We use quadratic determineButthe newbucket address. buchet is
Double hashing:
This is also another method oflinear probing. Here the difference is fixed like in
probing but this fixed differences is calculated by using another hash function. Hence the linearis name
double hashing,.
Q12. Explain in detail about extendible hashing ?
Ans :
Extendible hashing is a dynamic hashing technique that is capable of dividing the buckets a:
database grows and rejoining them as it shrinks. This requires reorganization of buckets in hash table
An important feature of extentible hashing is that it reduces the performance overhead of hashine
because it performs reorganization only one bucket at a time
In extendible hashing, the hash fånction '" is chosen such that it has sufficient qualities of
unitormity and randomness. And it is capable of generating values over a large range, often known as
b-bit binary integer. The value of b is usually 32. Therefore, it can create 232.i.c more than 4 billion
buckets. However allbuckets are not created at once, instead they are created on demand as records
are inserted into hash table.
Infact all the b bits of the hash value are not used, instead only few (say d-bits) are used i.e, 'd
lies between 0 to 'b'. these 'd' bits are used as an offset that point to another table containing
bucket
address note that 'd' value increases and decreases as the size of database grows and shrinks.

00 Bucket 1
01
10

11....
Bucket 2

d3
Bucket 3
111.
Bucket
Address
Table

Bucket 'n

Flg: General Structure of extend ible hash


Let us see an example to understand this method.
Considerthere are three records R1, R2 and KR4 are in the talbe.
100100. 010110 and 110110 respectively. This method of storing These records generate addresses
considers only part of this address -
esneciallyonly first one bit to store the data. So it tries to load three of then at address 0 and 1.
H(R1)-’ 100100
H(R2) -’ 010110
H(R3) -’ 110110
Warning:Xerox/Photocopylng of thls book is a CRIMINAL Act. Anyone found guilty ls LIABLE to faco
LEGAL procoedings
Database Management Systems
when allNR initial buckets are split.
Buckets 0 to next - 1 have been split, next
is level. In the
to N, yet to split current number
5.15
R,
middle of a round.
Buckets split in this
R round if h level (search

Bucket to split key value) is in this range,


must use hlevel (search
key value) to decide if
R.
is no Next

R3 here? There entry in is 'split irnage'


happen to has to grow Bucket that bucket
What will R3. The bucket So
space for
accommodate R3. it changes existed at the
begining of this
buckket bit, and then
dynamicallyto rather than 1 round; this is the

address have 2
bits
datato have 2
bit address. range of

the existing R3
updatesthe accomandate
it tries to h-level 1
Then it
H(R1)’ 100100
H(R2) -’ 010110 'Split image' buckets
created (through splitting
110110 of the buckets) in this round.
H(R3)’
00

R NR
01 M
LINEAR HASHING SEARCH:
R
10
To find bucket for data entry k, find h,vel.1
(k): .if h, (k) in range 'Next to N', K belong or
here else, r could belong to bucket h,t to(k)find
R,
11
(k) +Np, must apply h,., (k)
and R? bucket h,
Now we can see
that address of R' R3is out.
address and
reflect the new Simple formulation:
are changed to of the data
increase, it
also inserted. As the size buckets, if no buckets 2N.
existing
tries to insert in the (1) Next

are available, the number of bits is increased to


increasing the buckets.
consider larger and hence N.. N,
data can be stored
If we delete any record and if thethe bucket size. It
with lesser buckets, it shrinks above.
does the opposite of what we have seen
This is how a dynamic hashing works. Initially only
generated by the hash function (K)
partial index/address the number of
m = h,
is considered to store the data. As If m >= M m = m N,
data increases and there is a need for more bucket, LH insert :
larger part of the index is consider to store the data.
Find bucket by applying hlevel-1 /hlevel:
Q13. Explain in detailabout linear hashing ? If bucket to insert into is full
Ans :
This is another dynamic hashing scheme an add overflow page and insert data entry
alternative to extendible hashing. Linear hashing split next bucket and increment next
handles the problem of long overflow chains can choose any criterion to trigger split
without using a directory and handles duplicates. since buckets are split round- robin,
Use a farmily of hash functions h0,h1,h2.. Long overflow chain don't develop :
hl(key) =h(key) mod(2N): Doubling of directory in extendible hashing
N=initial # buckets is similar, switching of hash functions is
'h' is some hash
function implicit in how the # of bits examined is
If N=2do, for some do . hi increased.
consists of
applyingh and looking at he last dibits , where Example of linear hasing :
d=d0+i, h,., double range of hi. On split, h,.) is used to
re-distribute
Directory avoided in
overflowpages and choosinglinear hashing using
bucket
entries.
robin splitting proceeds in 'rounds'to split round Level = 0, N = 4
round ends
Warning :Xerox/Photocopying of this book ls a CRIMINAL Act. Anyone found guilty is IABLE to face LEGAL proceedings
Database Management Systems
h Primary pages
net 0
000 100 32* 44* 36
data Entry r
wlth nr) 5
00 01
Primary page

18 10 30buckot
page
010 10 14
011 11
Add A3 Level 0

h1 Overflow pages
Primary pages
000 100 32*

001 01 9 25* 5
010 10 14° 18* 10 30*

011 11 31* 35* 7* 11 43*

100 00 46 36

Level0

h ho Primary pages Overflow page's


000 100 32
001 01 9 25

010 10 66* 18* 10* 34*

011 11 31* 35* 7* 11* 43*

100 00 44* 36*

101 01 5 37" 29*

110 10 14* 30* 22*

Add 50 Level =1

h1 h
Primary pages Overflow pages
000 , 100 32*

001 01 9 25*
010 10 66* 18 10
34°50
011 11 31* 35* 7 11

100 00 44 36°

101 01 5 37 29*

110 10 14 30* 22*

111 11 31 7

Warning: Xerox/Photocopylng of this book ls a CRIMINAL Act. Anyone found guilty is


LIABLE to face LEGAL proceedings
Database Management Systems
5.179
BASED INDEXING
$.3.2 TREE
in detailed about Implementing Heap
Flles?
Q14. Explain
Ans :
and the only guarantee is that one
The daBa in the pages of a heap tile iS not ordered in any way,
retrieve all records in the file by
repeated requests for the nextrecord. Every record in the file has a
can afile is of the same size
nigue rd, and every page in
Sunported operations on a heap include create and destroy files, insert a record, delete a record with
get a record with a given rid,
and scan allIrecords in the file. To get or delete a witha given rid,
agiven rid, must beable to findthe id of the page containingthe record, given the id of the record.
notethat we
Linked ist of pages :
list of pages. The DBMS can
Ono possibility is to maintain aheap files as a double linked
remember where the first page is located by maintaining atable containing pairs of <heap.file_name,
disk. We call the first page of the file the header page.
pagetabiee> in a known location on
created by deleting a record from
An important task is to maintain information about empty slots
free space within a page and how to
the heap file. This task has two distinct parts, how to keep track of
free space
keep track of pages that have some

Data Data Linked list of


page page pages with
Header fYee space

Page

Data Linked líist of


Data
page page full pages

length records
Fig: Alte rnative Page Organizations for fixed
lfa new page isrequired, it isobtained bymaking arequest to the disk space manager and then
from the heap file, it is removed from the
added to the list of pages in the file. lf a page is to be deleted
list and disk space manager is lock to de allocate it.
Q15. Explain heap file unclustured has index?
Ans :
clustered tree indexes we assume that each data
Heap file with un clustered hash index:As for un in out analysis, and for
static hashing
entry is one tenth the size of a data record. We consider only
Simplicity we assume that there are nooverflow chains.

In astatichashed file, pages are kept at about 80 percent occupancy. This as achieved by adding
percent full, when records are initially loaded into
a new pageto a bucket when each existingpage is 80
to store data entries is therefore 1.25 times the
iasnea file structure. The number of pages required that is 1.25 (0.10B) =0.125B. The number of
humber of pages when the entries are densely packed, relative size and occupancy.
data entries that fit on pages is 10(0.80R) =8R taking into account the
Scan:
As tor an un clustered tree index, all data entries can
be retrieved in expensively, at a cost of
VoB|D+8RC) I/Os, the cost of this step is BR(D+C). This is prohibitively expensive and further
Tesults are unordered. So no one ever scans a hash index.
Search with equality selection :
is equality conditions
Ihis operation is supported very efficient for matching selections, that
cost of identifying the page that
Waed tor each field in the composite key <age,sal>. The
Warning : XeroNPhotocopying of this book is a CRIMINAL Act. Anyone found gulty is LJABLS to face LEGAL proceedings
Database Management Systems
contains
costs D. Ifqualifying data of just one page,
Assumingthat this bucket consists records
we entries is H. scanning half the on the
ot scanning theassumeisthat we find the data entry after is therefore H+2D+4RC, which page,
than the page
0-5(8R)C=4RC.
cost for a tree index. The total cost is the cos
even retrievingoo,it
Search with range selectlon:
record in
The hash
heap file, at acost of structure offers no help, and the entire heap file of employee the
Insert :
2D+C. The additional cost is H+ZUT employee
C
We must first, the record in the employee heap file, at cost 2D + the
heap file. The additionalcostinsert
is. H + 2D + C. employee
Delete :
We need to locate the data record in the employee file and the data entry in the
search step costs H+ 2D + 4RC. Now, we need to write out the modified pages on the index index,
and
the
data file, at a cost of 2D. the
5.4 CoMPARISION OF FILE ORGANIZATIONS
Q16. Compare various file organizations?
Ans:

The comparison of heap sorted and hashed files is done based on the definitions and operations perfomed on
those files.
Heap Files Sorted Files Hashed Files
1. records can be 1. Records are stored in 1. Record should be placed
placed anywhere in sequential order to hash according
the file function 2. The cost of scanning is
2. the cost of scanning 2. The cost of scanning is 1.25B(D +RC)
is B(D +RC) B(D+RC) 3. Selection is based on the
3. selection is specified 3. Equality selectin is search key
on acandidate key specified on the sorted 4. The cost of searching
4. the lost of searching field with equality selection is
with equality 4. The cost of searching with H +D+0.5RC
selection is 0.5
equality selection is 5. The entire file must be
B(D+RC) DlogzB+Clog:B
5. the entire file must be 5. Range selection is on the
scanned and the range
Scanned.for search selection ison the search
sort field. The cost= cost key. The cost is 1.25
with range selection. of search + cost of
The cost is B(D+RC) B(D+RC)
6. Records are inserted retrieving the satisfied set 6. Appropriate page must
of records
at the end of the file. 6. Find the correct position be located modifed and
The cost is 2D+C then written back
with the sorted field and
7. Search for the record cost=cost of search
insert the record at corect
then remove it from +C+D
position cost= 2(0.5 7. Fist the record is
the page and write B(D+RC) + B(D+RC)
the modified page 7. Search the record, remove searched, removed from
back for sirnplicity that recod and write the the page and then
cost = search cost
modified page back. modified page is written
+C+D Cost=cost of search back cost=cost of search
+B(D+RC) +C+D.

Warning : XeroxPhotocopying of this book is a CRIMINAL.Act. Anyone found guilty is LJABLE to face LEGAL procoodings
Database Management Systems
sequential, direct index file sequential to be organization?
5.19 Differentiate between
o17.
Direct File Organization Indexed sequential File organization
Ans: Sequential File Organization In direct file organization 1 In indexed sequential file
sequentialfile records are stored in direct organizations often
oganization records are.
1. In access storage devices records are stored in direct
sequentialaccess (DASD) example:Magnetic access devices. Example:
stored indevices example:
storage disks (Hard Disks) Magnetic disks (Hard
Magnetic tapes (Audio Inthis required records are Disk)
Cassettes) searched randomly using 2 In this desired records are
are being searched either
2 In this records
acoessed by searching keys.
sequentially or randomly
3. Before processing the
the file
from beginning of
the file till
transactions it is not 3. Before processing
to the end of necessary to sort the transactions even though
records is found. sequential access is used
Before processing the records stored in memory. there is no need to sort
transactions, records must 4 Accessingspeed is more
compared to sequential records.
either
be sorted in access and less when 4 Accessingspeed is more
ascending or descending compared to indexed when compared with both
order. sequential access. sequential access and
Acoessing speed is very direct access since index is
4
both 5 The organization is more
less compared to expensive compared to sued.
direct and indexed
sequential file organization sequential access and less 5 This organization is very
expensive compared to expensive compared to
5 This organization is
economically low direct access. both.sequential access and
compared to both direct 6 Timeconsumption isless direct access since it
access and indexed when compared with requires special software.
sequential access. sequential file organization 6 Time consumption is very
6. Time consumption is more and more compared to less compared to both
compared to both indexed sequential fle sequential file organization
sequential and indexed organization. and direct file
sequential file organization organization.
5.5 INDEXES & PERFORMANCE TUNING; INTUTIONS FOR TREE INDEXES
Q18. What is the intention behind tree structured indexes ?
Ans :
Consider afile of students records sorted bygpa. To answer a range selection such as "Find all
sudents with a gpa higher than 3.0" we must identify the first such student by doing a binary search of
he tle andthen scan the file from that point on. If the file is large, the initial binary search can be quite
expensive, since cost of proportional to the number of pages fetched.
As for any index 3 alternatives for data
entries K
(@ Data record with key value K
(ü) <k,rid of data
(iü) <k, list of
record with search key value k>
rids of data records with search key k>
notce is orthogonal to indexing technique used to locate data entries k
ee structured indexing technigues support both range' searches and equality
searches
Index entry

|P |KPK P, Pm

Fig: Format of an Index Page

War ing Xerox/Photocopying of this book is aCRIMINAL Act. Anyone found guilty is LIABLE to face LEGAL proceedings
Database Management Systeme
We refer 10 palrs of the form or just entries
asindex entriesnumber
when
the b.20 s
clear. Note that each index page <key.polnter>
polnter more thanthe of keys, each
key cont
servesext n
contents of thecontains spointed to by the polnters to its
a separator for the one left and right
The simple index file data pages
structure
Index file
(KKJ KN

Data file
Pagen

Flg: One level Index structure


5.6 INDEXED SEQUENTIAL ACCESS METHODS
Q19. Explain in detall about ISAM ?
Ans :
ISAM stands for Indexed Sequential Access Method. The data entries of the ISAM index are in
the leaf pages of tree and additional overflow pages changed to some leaf page. Database systems
carefully organize the layout of pages so that page boundaries correspond closely to the physical
characteristics of the underlying storage device. The 1SAM structure is completely static and facilitate
such low level optimizations
Non - leaf
pages

Overflow
pages

Leaf pages
Primary pages
Fig: ISAM indeX structure
Each tree node is a disk page, and all the data resides in the leaf pages. This
index that uses alternative corresponds to an
(1) For data entries, in terms of the alternatives, we can create an
index alternative.
(2) By sorting the data records in a separate file and storing <key,rid> pairs in
ISAM index the leaf pages of the
The non - leaf level pages are then allocated. If
so that more entries are inserted intoa leaf than will fit there aare several inserts to the file subsequentiy
onto singe page, additional pages are needed
because the index structure is static. These additional pages are allocated from an overflowarea. The
allocation of pages is shown below.
Data pages
Index pages
Over flowpages
Fig : Page Allocation in ISAM
Thebasic operation of insertion, deletion and search are allquite straight forward Eor
selection search, we start at root node & determine which sub tree aneguality
to search by comparing the valuein
Warning :Xerox/Photocopying of this book ls a CRIMINAL Act. Anyone found gulty ls
LIABLE to tace LEGAL procoedings
Database Management Systems
kev valuesin the node. For a range query the stating point
givenrecord with the then retrieved sequentially. For insert and deletes the
5.21 field of the data pages
searchlevelis determined and search and the record is inserted or deleted with overflow pages
the data deeterminedfor a
inthe pageis
appropriate
addedis necessary.
DYNAMIC INDEX S TRUCTURE
TREES : A
5.7 B trees ?
ExplainB*
O20.
witha variable but often large nåmber, of children per node. A B* tree
Ans: n-arraytree either a leaf or a node with two or more
AB* tree internal nodes and leaves. The root may be
is an
root. structure which is widely used, is a balanced tree in which the internal
consists of a tree search Since the tree structure grows and
B' nodes contain the data entries.
children. The and the leaf where the set
nodes direct
the search
not feasible to allocate the leaf pages sequentially as in ISAM,
dynamically, it is all leaf pages efficiently we have to link them using page
shrinks
pages was static. To retrievelinked list. We can easily traverse the sequence of leaf pages
them into a doubly
leat
of primary
pointers. By organizing
in their direction.
Index entries.
(To direct search)

Index file

Data entring
("Sequence set"')

Fig: Structure of a B+ Tree

The main goal of B+ tree is:


Sorted intermediary and leaf nodes.
Fast traversal and Quick search
Nooverflow pages
B+ tree index structure represents a balanced tree satisfying the following properties
All paths from root to node follow the same length.
n
Each node that is not a root or leaf has between and n children

(u) A leaf node has betuoon -l and n-1 values the following are some of the main character tics of
2
a B+ tree:

Operations (insert,delete) on thetree keep it balanced


ninimum occupancy of 50 percent is guaranteed for each node except the root if the deletion
algorithn discussed in selection 10.6 is implemented.
Searching for arecordIrequires just atraversal from the root tothe appropriat leaf. We refer to
the length of a path from the root to a
leaf.
Q21. Explain insertion, deletion, search operati ons on B* tree by taking a sample example ?
Ans :

we willSearching arecord in B* tree: Suppose we want to search .65 in the below B* tree structure. First
fetch for
we find the intermediary node which will direct to the leaf node that can contain record for
65.50
3rd leaf node branch between 50 &75 nodes in the intermediary node. Then we will be redirected to the
we have to at the end. Here DBMS will perform sequential search to find 65. Suppose instead of 65,
search for 60. of this book ls a CRIMINAL Act. Anyone found guiltyis LIABLE to face LEGAL proceedings
Narning : Xerox/Photocopying
Database Management Systeme

75 80 90 95
50 55 65 70
10 15 20 25 30 3540

Insertion in B+ Tree :
Suppose we have to insert a record 60 in below structure. It will go to 3rd leaf node after 55.
Since it it is balanced tree and that leaf nodeis already full. We can'tinsert the record there, but it
should be inserted there without affecting the fill factors balance and order. So the only option there is
to split the leaf node but how to split the nodes

5565 70 75 80 9095
5 10 15 20 25 3035 40 50

Ihe 3 leaf node should have values (50.55.60.65.70) and its current root node is 50 we will ent
the leaf node in the middle so that its balance is not altered. So we can group (50,55) and (60,65,701
into 2 leaf nodes. If these two has to be leaf nodes.the intermediary node can't branch from 50.
should ordered to it then we can have pointers to new leaf node.
255060 75

|5 10 15 20 25 30 39 40 |50 ||55 75 80 9095

60 65 70

DELETE IN B* TREE:
Suppose we have to delete 60 from the above example we have to remove 60 from 4th leaf
as well as from the intermediary node too. If we remove from node
intermediary
B+ tree rules. So we need to modify it have a balance tree. After node, the tree will not satisty
deleting 60 from above B+ tree and
re-arranging nodes, it will appear as below

25||5075

|510 1520 25 30 35 40 50 55 60 65 75 80 90 95
Suppose we have to delete 15 from
delete 15from that node. There is no needabove tree. We will transverse to the 1st leaf node
for any re and simply
appear in the intermediary node arrangement as the tree is balanced and 15 do not

23|s0||75

|5 10 20 25 30 35 40 50 55 60 65
75 80 90

Warning: XeroxlPhotocopying of this book ls a CRIMINAL.Act. Anyone found


gulty l IABLE to face
LEGAL procoedlngs

You might also like