0% found this document useful (0 votes)
7 views50 pages

DBMS Unit-3

The document outlines the syllabus for a Database Management System course, focusing on storage strategies and data organization. It details various types of storage, including primary, secondary, and tertiary storage, as well as RAID configurations and file organization methods. Additionally, it discusses the implications of different file organization techniques on data access and management.

Uploaded by

subhambidhans
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)
7 views50 pages

DBMS Unit-3

The document outlines the syllabus for a Database Management System course, focusing on storage strategies and data organization. It details various types of storage, including primary, secondary, and tertiary storage, as well as RAID configurations and file organization methods. Additionally, it discusses the implications of different file organization techniques on data access and management.

Uploaded by

subhambidhans
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/ 50

DATABASE MANAGEMENT SYSTEM

(BCSPC4020)

UNIT-III , 3rd Semester CSE (R-20)


Lecture – 1 Introduction to DBMS

SYLLABUS

UNIT:3 (10 Hours)


Network and Object Oriented Data models, Storage
Strategies: Detailed Storage Architecture, Storing Data,
Magnetic Disk, RAID, Other Disks, Magnetic Tape, Storage
Access, File & Record Organization, File Organizations &
Indexes, Order Indices, B+ Tree Index Files, Hashing Data
Dictionary.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 2


DBMS Storage Structure

Storage System in DBMS


A database system provides an ultimate view of the stored data.
However, data in the form of bits, bytes get stored in different
storage devices.
Types of Data Storage
For storing the data, there are different types of storage options
available. These storage types differ from one another as per the
speed and accessibility. There are the following types of storage
devices used for storing the data:
Primary Storage
Secondary Storage
Tertiary Storage
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 3
DBMS Storage Structure

Storage System in DBMS

• Primary Storage − The memory storage that is directly accessible to the CPU comes under this
category. CPU's internal memory (registers), fast memory (cache), and main memory (RAM) are directly
accessible to the CPU, as they are all placed on the motherboard or CPU chipset. This storage is typically
very small, ultra-fast, and volatile. Primary storage requires continuous power supply in order to maintain its
state. In case of a power failure, all its data is lost.

• Secondary Storage − Secondary storage devices are used to store data for future use or as
backup. Secondary storage includes memory devices that are not a part of the CPU chipset or
motherboard, for example, magnetic disks, optical disks (DVD, CD, etc.), hard disks, flash drives, and
magnetic tapes.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 4


DBMS Storage Structure

Storage System in DBMS

• Tertiary Storage − Tertiary storage is used to store huge volumes of data. Since such storage
devices are external to the computer system, they are the slowest in speed. These storage devices are
mostly used to take the back up of an entire system. Optical disks and magnetic tapes are widely used
as tertiary storage.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 5


DBMS Storage Structure

Storage System in DBMS


• Memory Hierarchy
A computer system has a well-defined hierarchy of memory. A CPU
has direct access to it main memory as well as its inbuilt registers. The
access time of the main memory is obviously less than the CPU speed.
To minimize this speed mismatch, cache memory is introduced. Cache
memory provides the fastest access time and it contains data that is
most frequently accessed by the CPU.

Note: The memory with the fastest access is the costliest one. Larger
storage devices offer slow speed and they are less expensive,
however they can store huge volumes of data as compared to CPU
registers or cache memory.
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 6
DBMS Storage Structure

Magnetic Disks

Hard disk drives are the most common secondary storage devices in present computer systems. These are
called magnetic disks because they use the concept of magnetization to store information. Hard disks
consist of metal disks coated with magnetizable material. These disks are placed vertically on a spindle. A
read/write head moves in between the disks and is used to magnetize or de-magnetize the spot under it. A
magnetized spot can be recognized as 0 (zero) or 1 (one).

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 7


DBMS Storage Structure

Magnetic Disks

Hard disks are formatted in a well-defined order to store data


efficiently. A hard disk plate has many concentric circles on it,
called tracks. Every track is further divided into sectors. A sector on
a hard disk typically stores 512 bytes of data.

11/23/2022
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 8 8
DBMS Storage Structure

Magnetic Tape

In magnetic tape only one side of the ribbon is used for


storing data. It is sequential memory which contains thin
plastic ribbon to store data and coated by magnetic oxide.
Data read/write speed is slower because of sequential
access. It is highly reliable which requires magnetic tape
drive for writing and reading data.
The width of the ribbon varies from 4mm to 1 Inch and it has
storage capacity 100 MB to 200 GB.

11/23/2022
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 9 9
DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID, or “Redundant Arrays of Independent Disks” is a technique which makes use of a combination of
multiple disks instead of using a single disk for increased performance, data redundancy or both.

Why data redundancy?


Data redundancy, although taking up extra space, adds to disk reliability. This means, in case of disk failure, if
the same data is also backed up onto another disk, we can retrieve the data and go on with the operation. On
the other hand, if the data is spread across just multiple disks without the RAID technique, the loss of a single disk
can affect the entire data.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 10


DBMS RAID STRUCTURE

Key evaluation points for a RAID System


Reliability: How many disk faults can the system tolerate?
Availability: What fraction of the total session time is a system in uptime mode, i.e. how available is the system
for actual use?
Performance: How good is the response time? How high is the throughput (rate of processing work)? Note that
performance contains a lot of parameters and not just the two.
Capacity: Given a set of N disks each with B blocks, how much useful capacity is available to the user?
RAID is very transparent to the underlying system. This means, to the host system, it appears as a single big disk
presenting itself as a linear array of blocks. This allows older technologies to be replaced by RAID without
making too many changes in the existing code.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 11


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)

RAID 0
In this level, a striped array of disks is implemented. The data is broken down into blocks and the blocks
are distributed among disks. Each disk receives a block of data to write/read in parallel. It enhances the
speed and performance of the storage device. There is no parity and backup in Level 0.
There is no duplication of data. Hence, a block once lost cannot be recovered.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 12


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID 1
RAID 1 uses mirroring techniques. When data is sent to a RAID controller, it sends a copy of data to all the
disks in the array. RAID level 1 is also called mirroring and provides 100% redundancy in case of a failure.
1 disk failure can be handled for certain, because blocks of that disk would have duplicates on some other
disk. Only half space of the drive is used to store the data. The other half of drive is just a mirror to the
already stored data.

In this level, one extra drive is required per


drive for mirroring, so the expense is higher.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 13


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID 2
RAID 2 records Error Correction Code using Hamming distance for its data, striped on different disks.
Like level 0, each data bit in a word is recorded on a separate disk and ECC codes of the data words are
stored on a different set disks. Due to its complex structure and high cost, RAID 2 is not commercially
available.
RAID-2 consists of bit-level striping using a Hamming Code parity.

This level uses one designated drive


to store parity.
It uses the hamming code for error
detection.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 14


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID 3
 RAID-3 consists of byte-level striping with a dedicated parity.
RAID 3 stripes the data onto multiple disks. The parity bit generated for data word is stored on a different
disk. This technique makes it to overcome single disk failures.
In case of drive failure, the parity drive is accessed, and data is reconstructed from the remaining devices.
Once the failed drive is replaced, the missing data can be restored on the new drive.

In this level, data is regenerated using


parity drive.
It contains high data transfer rates.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 15


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID 4
In this level, an entire block of data is written onto data disks and then the parity is generated and stored on
a different disk. Note that level 3 uses byte-level striping, whereas level 4 uses block-level striping. Both
level 3 and level 4 require at least three disks to implement RAID.

RAID 4 consists of block-level stripping with a parity disk.


Instead of duplicating data, the RAID 4 adopts a parity-
based approach.

This level allows recovery of at most 1 disk failure due to


the way parity works. In this level, if more than one disk
fails, then there is no way to recover the data.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 16


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)

RAID 5
It consists of block-level striping with Distributed parity
RAID 5 writes whole data blocks onto different disks, but the parity bits generated for data block stripe are
distributed among all the data disks rather than storing them on a different dedicated disk.

This level is cost effective and provides high performance.


In this level, disk failure recovery takes
longer time as parity has to be calculated
from all available drives.

It is used to make the random write performance better.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 17


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID 6
It contains block-level stripping with Double parity bits.
RAID 6 is an extension of level 5. In this level, two
independent parities are generated and stored in
distributed fashion among multiple disks. Two parities
provide additional fault tolerance. This level requires at
least four disk drives to implement RAID.
In this level, drives required should be multiple of 2.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 18


DBMS RAID STRUCTURE

RAID (Redundant Arrays of Independent Disks)


RAID 10
This level performs RAID 0 to strip data and RAID 1 to
mirror. In this level, stripping is performed before
mirroring.
In this level, drives required should be multiple of 2.

Since RAID 10 does not need to manage parity like


RAID 5 does, it can typically offer quicker data reading
and writing as well.
 If a single disc fails, RAID 10 can provide faster
reconstruction of that data; again, this is due to the lack of
parity checks.
RAID 10 is a better choice for database
implementations (as well as hosting servers) due to its
superior overall performance and fault tolerance.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 19


DBMS Storage Structure

File Organization

The File is a collection of records. Using the primary key, we can access the records. The type and frequency of
access can be determined by the type of file organization which was used for a given set of records.
File organization is a logical relationship among various records. This method defines how file records are mapped
onto disk blocks.
File organization is used to describe the way in which the records are stored in terms of blocks, and the blocks are
placed on the storage medium.
The first approach to map the database to the file is to use the several files and store only one fixed length record
in any given file. An alternative approach is to structure our files so that we can contain multiple lengths for records.
Files of fixed length records are easier to implement than the files of variable length records.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 20


DBMS Storage Structure

File Organization
Objective of file organization
It contains an optimal selection of records, i.e., records can be selected as fast as possible.
To perform insert, delete or update transaction on the records should be quick and easy.
The duplicate records cannot be induced as a result of insert, update or delete.
For the minimal cost of storage, records should be stored efficiently.

Types of file organization:


File organization contains various methods. These particular methods have pros and cons on the basis of access
or selection. In the file organization, the programmer decides the best-suited file organization method according to
his requirement.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 21


DBMS Storage Structure

File Organization

Types of file organization are as follows:

Sequential file organization


Heap file organization
Hash file organization
B+ file organization
Indexed sequential access method (ISAM)
Cluster file organization

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 22


DBMS Storage Structure

Sequential File Organization


This method is the easiest method for file organization. In this method, files are stored sequentially. This
method can be implemented in two ways:
1. Pile File Method:
It is a quite simple method. In this method, we store the record in a sequence, i.e., one after another.
Here, the record will be inserted in the order in which they are inserted into tables.
In case of updating or deleting of any record, the record will be searched in the memory blocks. When
it is found, then it will be marked for deleting, and the new record is inserted.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 23


DBMS Storage Structure

Sequential File Organization

Insertion of the new record:


Suppose we have four records R1, R3 and so on upto R9 and R8 in a sequence. Hence, records are
nothing but a row in the table. Suppose we want to insert a new record R2 in the sequence, then it will be
placed at the end of the file. Here, records are nothing but a row in any table.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 24


DBMS Storage Structure

Sequential File Organization

2. Sorted File Method:


In this method, the new record is always inserted at the file's end, and then it will sort the sequence in
ascending or descending order. Sorting of records is based on any primary key or any other key.
In the case of modification of any record, it will update the record and then sort the file, and lastly, the
updated record is placed in the right place.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 25


DBMS Storage Structure

Sequential File Organization

Insertion of the new record:


Suppose there is a preexisting sorted sequence
of four records R1, R3 and so on upto R6 and
R7. Suppose a new record R2 has to be
inserted in the sequence, then it will be inserted
at the end of the file, and then it will sort the
sequence.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 26


DBMS Storage Structure

Sequential File Organization

Pros of sequential file organization


It contains a fast and efficient method for the huge amount of data.
In this method, files can be easily stored in cheaper storage mechanism like magnetic tapes.
It is simple in design. It requires no much effort to store the data.
This method is used when most of the records have to be accessed like grade calculation of a student, generating
the salary slip, etc.
This method is used for report generation or statistical calculations.
Cons of sequential file organization
It will waste time as we cannot jump on a particular record that is required but we have to move sequentially
which takes our time.
Sorted file method takes more time and space for sorting the records.
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 27
DBMS Storage Structure

Heap file organization


It is the simplest and most basic type of organization. It works with
data blocks. In heap file organization, the records are inserted at the
file's end. When the records are inserted, it doesn't require the sorting
and ordering of records.
When the data block is full, the new record is stored in some other
block. This new data block need not to be the very next data block, but
it can select any data block in the memory to store new records. The
heap file is also known as an unordered file.
In the file, every record has a unique id, and every page in a file is of
the same size. It is the DBMS responsibility to store and manage the
new records.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 28


DBMS Storage Structure

Heap file organization


Insertion of a new record
Suppose we have five records R1, R3, R6, R4 and R5 in a heap and suppose we want to insert a new record R2 in a
heap. If the data block 3 is full then it will be inserted in any of the database selected by the DBMS, let's say data
block 1. If we want to search, update or delete the data in
heap file organization, then we need to traverse the
data from staring of the file till we get the
requested record.
If the database is very large then searching,
updating or deleting of record will be time-
consuming because there is no sorting or ordering
of records. In the heap file organization, we need
to check all the data until we get the requested

11/23/2022 record.
DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 29
DBMS Storage Structure

Heap file organization

Pros of Heap file organization


It is a very good method of file organization for bulk insertion. If there is a large number of data
which needs to load into the database at a time, then this method is best suited.
In case of a small database, fetching and retrieving of records is faster than the sequential record.
Cons of Heap file organization
This method is inefficient for the large database because it takes time to search or modify the record.
This method is inefficient for large databases.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 30


DBMS Storage Structure

Hash File Organization


Hash File Organization uses the computation of hash function on some fields of the records. The hash
function's output determines the location of disk block where the records are to be placed.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 31


DBMS Storage Structure

Hash File Organization


When a record has to be received using the hash
key columns, then the address is generated, and the
whole record is retrieved using that address.
In the same way, when a new record has to be
inserted, then the address is generated using the hash
key and record is directly inserted. The same process
is applied in the case of delete and update.
In this method, there is no effort for searching and
sorting the entire file. In this method, each record will
be stored randomly in the memory.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 32


DBMS Storage Structure

B+ File Organization

B+ tree file organization is the advanced method of an indexed sequential access method. It uses a tree-like
structure to store records in File.
It uses the same concept of key-index where the primary key is used to sort the records. For each primary key, the
value of the index is generated and mapped with the record.

The B+ tree is similar to a binary search tree


(BST), but it can have more than two children. In
this method, all the records are stored only at
the leaf node. Intermediate nodes act as a
pointer to the leaf nodes. They do not contain
any records.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 33


DBMS Storage Structure

B+ File Organization

The above B+ tree shows that:


There is one root node of the tree, i.e., 25.
There is an intermediary layer with nodes. They do not store the actual record. They have only pointers to
the leaf node.
The nodes to the left of the root node contain the prior value of the root and nodes to the right contain
next value of the root, i.e., 15 and 30 respectively.
There is only one leaf node which has only values, i.e., 10, 12, 17, 20, 24, 27 and 29.
Searching for any record is easier as all the leaf nodes are balanced.
In this method, searching any record can be traversed through the single path and accessed easily.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 34


DBMS Storage Structure

B+ File Organization

Pros of B+ tree file organization


In this method, searching becomes very easy as all the records are stored only in the leaf nodes and
sorted the sequential linked list.
Traversing through the tree structure is easier and faster.
The size of the B+ tree has no restrictions, so the number of records can increase or decrease and the B+
tree structure can also grow or shrink.
It is a balanced tree structure, and any insert/update/delete does not affect the performance of tree.
Cons of B+ tree file organization
(Minor) disadvantage of B+ trees: – extra insertion and deletion overhead, space overhead. and n
children.
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 35
DBMS Storage Structure

Indexing in Databases
Indexing is a way to optimize the performance of a database by
minimizing the number of disk accesses required when a query is
processed.
It is a data structure technique which is used to quickly locate and
access the data in a database.
Indexes are created using a few database columns.
The first column is the Search key that contains a copy of the primary key or candidate key of the table.
These values are stored in sorted order so that the corresponding data can be accessed quickly.
Note: The data may or may not be stored in sorted order.
The second column is the Data Reference or Pointer which contains a set of pointers holding the address of
the disk block where that particular key value can be found.
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 36
DBMS Storage Structure

Indexing in Databases

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 37


DBMS Storage Structure

Indexing in Databases

Ordered Indices

In this, the indices are based on a sorted ordering of the values.


These are generally fast and a more traditional type of storing mechanism.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 38


DBMS Storage Structure

Indexing in Databases

Primary Index:

Primary indexing refers to the process of creating an index based on the table’s primary
key.
These primary keys are specific to each record and establish a 1:1 relationship between
them.
The searching operation is fairly efficient because primary keys are stored in sorted
order.
There are two types of primary indexes: dense indexes and sparse indexes.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 39


DBMS Storage Structure

Indexing in Databases

Dense Index:
For every search key value in the data file, there is an index record.
This record contains the search key and also a reference to the first data record with that
search key value.

The total number of records present in the index


table and the main table are the same in this
case. It requires extra space to hold the index
record.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 40


DBMS Storage Structure

Indexing in Databases
Sparse Index:
The index record appears only for a few
items in the data file. Each item points to a
block as shown.
To locate a record, we find the index
record with the largest search key value less
than or equal to the search key value we
are looking for.
We start at that record pointed to by the index record, and proceed along with the pointers in the
file (that is, sequentially) until we find the desired record.
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 41
DBMS Storage Structure
Main file
P.K -- -- --
Primary Indexing 1
2 B-1
.
Anchor attribute Index file Block Pointer .
The main file is sorted 11
. B-2
Primary key is used as anchor P.K B.P .
attribute(search key) 1 21
11 . B-3
It’s an example of sparse indexing .
21
No of entries = no of blocks acquired in .

….
. B-4
index file by the main memory. 91 .
91
No of access required = log 2n+1 .
.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 42


DBMS Storage Structure

Indexing in Databases
Clustering index
Clustering index is defined on an ordered data file. The data file is ordered on a non-key field.
In some cases, the index is created on non-primary key columns which may not be unique for each
record. In such cases, in order to identify the records faster, we will group two or more columns
together to get the unique values and create index out of them.
This method is known as the clustering index. Basically, records with similar characteristics are
grouped together and indexes are created for these groups.
For example, students studying in each semester are grouped together. i.e. 1st Semester students,
2nd semester students, 3rd semester students etc.. are grouped.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 43


DBMS Storage Structure

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 44


DBMS Storage Structure

Clustered index

Clustered index sorted according to first name (Search key)


This is a type of Clustered Indexing where the data is sorted according to the search key
and the primary key of the database table is used to create the index.
It is a default format of indexing where it induces sequential file organization. As primary
keys are unique and are stored in a sorted manner, the performance of the searching
operation is quite efficient.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 45


DBMS Storage Structure

Clustered Indexing
Main file

N.K -- -- --
Non-key attribute Index file Block Pointer 1
1
1 B-1
The main file is sorted(on a non-key N.K B.P 2
attribute) 1 3
2 4
There will be one entry for each unique 4
3 B-2
value of the non key attribute. 5
4 5
If no. of block acquired by index file is n, 5 6
6 6
then block access required will be ≥ log2n+1 . B-3
.
.
11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 46
DBMS Storage Structure

Non-clustered or Secondary Indexing


In secondary indexing, to reduce the size of mapping, another level of indexing is introduced. In this method,
the huge range for the columns is selected initially so that the mapping size of the first level becomes small.
Then each range is further divided into smaller ranges. The mapping of the first level is stored in the primary
memory, so that address fetch is faster. The mapping of the second level and actual data are stored in the
secondary memory (hard disk).
We can have only dense ordering in the non-clustered index as sparse ordering is not possible because data
is not physically organized accordingly.
It requires more time as compared to the clustered index because some amount of extra work is done in
order to extract the data by further following the pointer. In the case of a clustered index, data is directly
present in front of the index.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 47


DBMS Storage Structure

For example : If you want to find the record


of roll 111 in the diagram, then it will search
the highest entry which is smaller than or
equal to 111 in the first level index. It will get
100 at this level.

Then in the second index level, again it does


max (111) <= 111 and gets 110. Now using
the address 110, it goes to the data block
and starts searching each record till it gets
111.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 48


DBMS Storage Structure

Main file
Secondary Indexing
S.K -- -- --
The main file is un-sorted Anchor attribute Index file Block Pointer 1
27
S.K B.P B-1
Can be done on key as well as non-key .
1 3
attribute. 2 91
Called secondary because normally one 3 .
. B-2
4
indexing is already done. 2
5
It’s an example of dense indexing. 5
6
.
No of entry in index file = no of entry in .
B-3
6
main file. .

….
.
91

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 49


QUESTIONS
1. Describe about the RAID structure withQuestions a labeled diagram.
2. What are inference rules for functional dependencies? Discuss the Armstrong’s Inference rules.
Use Armstrong’s axioms to prove the soundness of the decomposition rule.

1. Explain “Query optimization”.


2. What are primary and secondary keys?
3. Define functional dependencies .
4. Why BCNF is known as relaxed form of 3NF?
5.

11/23/2022 DEPARTMENT OF CSE, GIET UNIVERSITY, GUNUPUR 50

You might also like