0% found this document useful (0 votes)
12 views6 pages

Indexing Notes Dbms

Uploaded by

omjee9473
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)
12 views6 pages

Indexing Notes Dbms

Uploaded by

omjee9473
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/ 6

Chapters v a8 Categories v

HTML CSS Javascript Python Java C C++ PHP Scala C:)


SQL

DBMS - Indexing

We know that data is stored in the form of records. Every record has a key field, which
helps it to be recognized uniquely.
Indexing is a data structure technique to efficiently retrieve records from the database
files based on some attributes on which the indexing has been done. Indexing in
database systems is similar to what we see in books.
following
Indexing is defined based on its indexing attributes. Indexing can be of the
types -

I Primary Index Primary index is defined on an ordered data file. The data file
primary key of the
is ordered on a key field. The key field is generally the
relation.
Secondary index may be generated from a field which is
a
Secondary Index
record, or a non-key with
candidate key and has a unique value in every
duplicate values.
Clustering index is defined on an ordereddata file.
The data
Clustering Index
file is ordered on a non-key field.

Ordered Indexing is of two types

Dense Index

Sparse Index

Dense lndex
database, This
there is an index record for every search key value in the
In dense index, space to store index records
itself, Index
faster but requires more
makes searching the disk,
search key value and a pointer to the actual record on
records contain
1/7
https://www.tutorialspoint.com/dbms/dbms_indexing.htm
Page Iof 5

Page 2 of 7
China China Beijing 3,705,386
Canada Canada Ottawa 3,855,081
Russia Russia Moscow 6,592,735
USA USA Washington 3,718,691
Advertisement

F
Product anoary February March
Reglon Sales Rep Status
2Laptop 200 150 180 Noitt Jon Doecthve
$Mouse 300 500SoHuth
4 Monitor
ane Smith Acthe
150 120East Mark Le0tnactive
Keyboad 180 220 190 West Emma Ray Active

18

20

Sparse lndex
In sparse index, index records are not created for every search key. An index record here
contains a search key and an actual pointer to the data on the disk. To search a record,
we first proceed by index record and reach at the actual location of the data. If the data
we are looking for is not where we directly reach by following the index, then the system
starts sequential search until the desired data is found.

China China Beijing 3,705,386


Russia Canada Otawa 3,855,081
USA Russia Moscow 6,592,735
USA Washington 3,718,691

Multilevel Index
Index records comprise search-key values and data pointers. Multilevel index is stored
on the disk along with the actual database files. As the size of the database grows, so
in the
does the size of the indices. There is an immense need to keep the index records
1/

2/7
https://www.tutorialspoint.com/dbms/dbms_indexing.htm
hmLMLUIIUSUUL IL
Page I of 5
main memory s0 as to speed Page 3 of 7
2large size index up the search operations.
cannot be kept in memory which If single-level index is
used, then
leads to multiple disk
accesses.
Data Blocks

Inner Index

Outer Index
Inner Index Data Blocks

it

Inner Index
Outer Index
Data Blocks

Inner Index

Data Blocks

Multi-levelIndex helps in breaking down the index into several smaller indices in order to
make the outermost level so small that it can be saved in a singledisk block,which can
easily be accommodated anywhere in the main memory.

B* Tree
AB* tree is a balanced binary search tree that follows a multi-level index format. The
leaf nods of a B* tree denote actual data pointers. B* tree ensures that all leaf nodes
remain at the same height, thus balanced. Additionally, the leaf nodes are linked using a
link list; therefore, a Bt tree can support random access as well as sequential access.

Structure of B Tree
B* tree is of the order n where
Every leaf node is at equal distance from the root node. A
nis fixed for every B* tree.
ntamp Ordering
ENCtL CO5DFORTSP
Page 4 of 7

A B
D E G H
ulti Internal nodes
Usec
date
whi
Internal (non-leaf) nodes contain
at least [n/21 pointers,
At most, an internal except the root node.
In node can contain n
pointers.
WC
Leaf nodes -

Leaf nodes contain at least [n/2]


I record pointers and [n/2] key values.
At most, a leaf node can
contain n record pointers and n key
values.
Every leaf node contains one block pointer P
to point to next leaf node and forms
a linked list.

B Tree Insertion

B trees are filled from bottom and


each entry is done at the leaf node.
If aleaf node overflows

Split node into two parts.


Partition at i = 1(m+1),2.
First i entries are stored in one node.
Rest of the entries (i+1 onwards) are
moved to a new node.
th key is duplicated at the parent of the leaf.

If anon-leaf node overflows

Split node into two parts,


Partition the node at i = [(m+1),2].
Entries up to i are kept in one node.
I Rest of the entries are mOved to a new node.

htps://www.tutorialspoint.com/dbms/dbms_indexing.htm
Page 5 of 7
B Tree Deletion

B tree entries are


deleted at the leaf nodes.
The target entry is searched and
deleted.

Mult IIf it is an internal node, delete and replace


with the entry from the left
Use position.
dat
wt After deletion, underflow is tested,
In
W
If underflow occurs,distribute the entries from the nodes left to it.
If distribution is not possible from left, then

Distribute from the nodes right to it.

If distribution is not possible from left or from right, then

Merge the node with left and right to it.

TOP TUTORIALS

Python Tutorial

Java Tutorial

C++ Tutorial

C Programming Tutorial
C# Tutorial
PHP Tutorial

R Tutorial
HTML Tutorial

CSS Tutorial

JavaScript Tutorial
SQL Tutorial

TRENDING TECHNOLOGIES

5/7
Cloud Computing Tutorial
Amazon Web Services
Microsoft Azure TutorialTutorial
Page 6 of 7

Git Tutorial
Ethical Hacking Tutorial
Docker Tutorial
Multivers Kubernetes Tutorial
used in DSA Tutorial
data iter Spring Boot Tutorial
while pre SDLC Tutorial
In this a
Unix Tutorial
works.

Multive CERTIFICATIONS
Business Analytics Certification
In MVTO, Java & Spring Boot
Transactic Advanced Certification
Data Science
AdvancedCertification
There are Cloud Computing And
DevOps
Advanced Certification In
Business Analytics
Artificial Intelligence And
Tit Machine Learning
de DevOps Certification
Game Development Certification
Ve Front-End Developer Certification
un
AWS Certification Training
Or Python Programming Certification
the
COMPILERS &EDITORS
Online Java Compiler
Online Python Compiler
Online Go Compiler
Online C Compiler
Online C++ Compiler
Online C# Compiler
Online PHP Compiler
Online MATLAB Compiler
Online Bash Compiler
Online SQL Compiler
i
Online Html Editor

https/www.tutorialspoint.com/dbms/dbms_indexing.htm

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy