0% found this document useful (0 votes)
2 views4 pages

Link

The document discusses the differences between ISAM and B+ Tree indexes, highlighting that ISAM is static and suitable for static tables with minimal updates, while B+ Trees are dynamic and better for databases with frequent modifications. It also explains indexing in DBMS, detailing methods such as ordered indices, primary indexing (dense and sparse), and clustering indexes, which enhance database performance by reducing disk access. Examples illustrate how indexing improves search efficiency in database queries.

Uploaded by

Tatparya Rudra
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)
2 views4 pages

Link

The document discusses the differences between ISAM and B+ Tree indexes, highlighting that ISAM is static and suitable for static tables with minimal updates, while B+ Trees are dynamic and better for databases with frequent modifications. It also explains indexing in DBMS, detailing methods such as ordered indices, primary indexing (dense and sparse), and clustering indexes, which enhance database performance by reducing disk access. Examples illustrate how indexing improves search efficiency in database queries.

Uploaded by

Tatparya Rudra
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/ 4

Check the below link few DBMS questions are covered

https://skphd.medium.com/dbms-questions-and-answers-41f7e9d79f12

Unit-5

1. Compare ISAM and B+ Tree indexes. Explain briefly their differences in handling Search,
Insert and Delete, and discuss when you would use ISAM and when you would use B+ Tree
index.
Solution:
ISAM (Indexed Sequential Access Method) and B+ Tree indexes differ primarily in their
structure and how they handle data modifications. ISAM, a static index, is better suited for
static tables with minimal updates, while B+ Tree, a dynamic index, is more efficient for
databases with frequent insertions, deletions, and updates
ISAM:
●​ Structure: ISAM uses a multi-level index where the data file is ordered by the index
search key. The index is a static structure, meaning it doesn't change when the data
file is updated.
●​ Search: Searching in ISAM is typically faster because the index file is smaller than
the data file. The index allows the system to quickly locate the relevant data block.
●​ Insert/Delete: Insertions and deletions in the data file do not affect the ISAM tree
layers. However, ISAM can become less efficient when data file updates lead to many
overflow chains, according to Actian Documentation.
●​ When to Use: ISAM is best used for static tables (with few updates) where no
overflow chains exist, and for smaller tables where fewer disk operations are needed
to access data.
B+ Tree:
●​ Structure: B+ Trees are dynamic, self-balancing multi-level indexes. All keys are
stored in the leaf nodes, and internal nodes only contain keys for navigation. The tree
structure is designed to minimize disk I/O during search, insertion, and deletion.
●​ Search: B+ Trees offer fast search operations because all keys are located in the leaf
nodes, allowing for quick access to the desired data.
●​ Insert/Delete: B+ Trees provide efficient insert and delete procedures. The
underlying data file can grow or shrink dynamically, and the tree can be adjusted to
maintain its balance.
●​ When to Use: B+ Trees are preferred for databases with dynamic data, frequent
updates, and where efficient range searching and sequential access are needed
Key Differences Summarized:
Feature ISAM B+ Tree

Structure Static Dynamic, self-balancing

Data Data and keys in all nodes Keys in internal nodes, data in leaf
Storage nodes

Updates Less efficient with updates and More efficient with insertions and
deletions deletions

When to Static tables, small tables Dynamic databases, frequent update


Use

2. What is indexing in DBMS? Explain the methods of indexing with example?

Solution:
Indexing is a technique for improving database performance by reducing the number of disk
accesses necessary when a query is run. An index is a form of data structure. It’s used to
swiftly identify and access data and information present in a database table.

Structure of Index

●​ The search key is the database’s first column, and it contains a duplicate or copy of
the table’s candidate key or primary key. The primary key values are saved in sorted
order so that the related data can be quickly accessible.
●​ The data reference is the database’s second column. It contains a group of pointers
that point to the disk block where the value of a specific key can be found.

Methods of Indexing
Ordered Indices
To make searching easier and faster, the indices are frequently arranged/sorted. Ordered
indices are indices that have been sorted.

Example
Let’s say we have a table of employees with thousands of records, each of which is ten bytes
large. If their IDs begin with 1, 2, 3,…, etc., and we are looking for the student with ID-543:
●​ We must search the disk block from the beginning till it reaches 543 in the case of a
DB without an index. After reading 543*10=5430 bytes, the DBMS will read the
record.
●​ We will perform the search using indices in the case of an index, and the DBMS
would read the record after it reads 542*2 = 1084 bytes, which is significantly less
than the prior example.

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.

Dense Index
Every search key value in the data file has an index record in the dense index. It speeds up the
search process. 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. A pointer to the actual
record on the disk and the search key are both included in the index records.

Sparse Index
Only a few items in the data file have index records. Each and every item points to a certain
block. Rather than pointing to each item in the main database, the index, in this case, points
to the records that are present in the main table that is in a gap.
Clustering Index
●​ An ordered data file can be defined as a clustered index. Non-primary key columns,
which may or may not be unique for each record, are sometimes used to build indices.
●​ In this situation, we’ll join two or more columns to acquire the unique value and
generate an index out of them to make it easier to find the record. A clustering index
is a name for this method.
●​ Records with comparable properties are grouped together, and indices for these
groups are constructed.

Example
Assume that each department in a corporation has numerous employees. Assume we utilise a
clustering index, in which all employees with the same Dept_ID are grouped together into a
single cluster, and index pointers refer to the cluster as a whole. Dept_Id is a non-unique key
in this case.

3.

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