DBMS Concepts

DBMS Tutorial Components of DBMS. Applications of DBMS The difference between file system and DBMS. Types of DBMS DBMS Architecture DBMS Schema Three Schema Architecture. DBMS Languages.

DBMS ER Model

ER model: Entity Relationship Diagram (ERD) Components of ER Model. DBMS Generalization, Specialization and Aggregation.

DBMS Relational Model

Codd’s rule of DBMS Relational DBMS concepts Relational Integrity Constraints DBMS keys Convert ER model into Relational model Difference between DBMS and RDBMS Relational Algebra DBMS Joins

DBMS Normalization

Functional Dependency Inference Rules Multivalued Dependency Normalization in DBMS: 1NF, 2NF, 3NF, BCNF and 4NF

DBMS Transaction

What is Transaction? States of transaction ACID Properties in DBMS Concurrent execution and its problems DBMS schedule DBMS Serializability Conflict Serializability View Serializability Deadlock in DBMS Concurrency control Protocols

Difference

Difference between DFD and ERD

Misc

Advantages of DBMS Disadvantages of DBMS Data Models in DBMS Relational Algebra in DBMS Cardinality in DBMS Entity in DBMS Attributes in DBMS Data Independence in DBMS Primary Key in DBMS Foreign Key in DBMS Candidate Key in DBMS Super Key in DBMS Aggregation in DBMS Hashing in DBMS Generalization in DBMS Specialization in DBMS View in DBMS File Organization in DBMS What Is A Cloud Database What Is A Database Levels Of Locking In DBMS What is RDBMS Fragmentation in Distributed DBMS What is Advanced Database Management System Data Abstraction in DBMS Checkpoint In DBMS B Tree in DBMS BCNF in DBMS Advantages of Threaded Binary Tree in DBMS Advantages of Database Management System in DBMS Enforcing Integrity Constraints in DBMS B-Tree Insertion in DBMS B+ Tree in DBMS Advantages of B-Tree in DBMS Types of Data Abstraction in DBMS Levels of Abstraction in DBMS 3- Tier Architecture in DBMS Anomalies in Database Management System Atomicity in Database Management System Characteristics of DBMS DBMS Examples Difference between Relational and Non-Relational Databases Domain Constraints in DBMS Entity and Entity set in DBMS ER Diagram for Banking System in DBMS ER Diagram for Company Database in DBMS ER Diagram for School Management System in DBMS ER Diagram for Student Management System in DBMS ER Diagram for University Database in DBMS ER Diagram of Company Database in DBMS Er Diagram Symbols and Notations in DBMS How to draw ER-Diagram in DBMS Integrity Constraints in DBMS Red-Black Tree Deletion in DBMS Red-Black Tree Properties in DBMS Red-Black Tree Visualization in DBMS Redundancy in Database Management System Secondary Key in DBMS Structure of DBMS 2-Tier Architecture in DBMS Advantages and Disadvantages of Binary Search Tree Closure of Functional Dependency in DBMS Consistency in Database Management System Durability in Database Management System ER Diagram for Bank Management System in DBMS ER Diagram for College Management System in DBMS ER Diagram for Hotel Management System in DBMS ER Diagram for Online Shopping ER Diagram for Railway Reservation System ER Diagram for Student Management System in DBMS Isolation in DBMS Lossless Join and Dependency Preserving Decomposition in DBMS Non-Key Attributes in DBMS Data Security Requirements in DBMS DBMS functions and Components What is Homogeneous Database? DBMS Functions and Components Advantages and Disadvantages of Distributed Database Relational Database Schema in DBMS Relational Schema Transaction Processing in DBMS Discriminator in DBMS

Advantages of B-Tree in DBMS

A self-balancing search tree is the B-Tree. It is assumed that everything is in the main memory in most other self-balancing search trees (such as AVL and Red-Black Trees).

We must consider the vast amount of data that won't fit in the main memory to comprehend the utilization of B-Trees. Data is read from the disc in blocks when the number of keys is high. Disc access time is very long compared to the access time to main memory. Reducing the amount of disc accesses is the primary goal of employing B-Trees. Most tree operations, such as search, insert, delete, max, min, etc., call for O(h) disc accesses, where h is the tree height. By packing as many keys as you can into each B-Tree node, the size of B-Trees is maintained to a minimum.

Example

Assume that one disc read operation is required to reach one B tree node. A B-tree of order 101 and height three may hold 100 million items.

With a maximum of three disc reads, any item can be accessible.

Since all the leaves are at the same level, a B tree is also known as a multi-way search tree and is a type of multilevel indexing.

The root of a tree grows, not the leaf.

B-tree properties

A B-tree satisfies the following properties –

  • A node (not a leaf node) has one less number of keys than its children (these keys split the children's keys like a binary search tree).
  • A trunk has at least one key, up to a maximum of (m-1) keys. So the root has at least two up to m children.
  • A node has as many children as its number of keys plus one.
  • In contrast to Binary Search Tree, the B-Tree expands and contracts from the root. Binary Search Trees shrink as well as grow downhill.

Note: Non-leaf nodes are called internal nodes (nodes with children). Leaf nodes are called external nodes (nodes that have no children).

Example

 A B-tree of degree 3 (i.e., a node can have up to 3 children) satisfies the following properties –

  • A root has at least one and, at most, two keys. Therefore, the heart has at least two and at most three children.
  • 5 Each non-root node (not leaf node) has at least one and at most two keys. So there are at least two children and a maximum of 3 children.

Note: Duplicate strong values are not allowed.

Advantages of B-Tree

B-trees use all the above ideas. Specifically, the B-tree:

  • The B-Tree works well compared to a hash table since it enables ordered sequential access.
  • Similar to how a binary tree supports it, it allows iterations over objects. If necessary, the things are arranged via iterations in the appropriate order (ascending or descending).
  • Millions of objects can be kept in the tree, and its flat form makes it simple and quick to navigate the data.
  • The cost of deleting a record from a table when millions of records can add up since the table may need to be rewritten. However, if the complete data set is used or B-Tree is utilized to handle sequential access to the table.
  • Use hierarchical indexes to minimize disk reads.
  • Use partially complete blocks to speed up inserts and deletes.
  • Use a recursive algorithm to keep the index balanced.
  • Additionally, B-trees minimize waste by ensuring interior nodes are at least half full. 
  • A B-tree can handle any number of insertions and deletions.
  • BST accesses fewer memory locations during a search than B-tree, but these accesses are more expensive because each access is more likely to cause a cache miss.
  • B-trees go to more locations overall, but these accesses are less expensive because there are fewer cache misses.
  • Recordings can be recalled with the same number of disk accesses.
  • The tree's height remains balanced and is lower than the B tree.
  • Data stored in a B+ tree can be accessed sequentially and directly.
  • Keys are used for indexing.
  •  Searches are faster because data is stored only in leaf nodes.
  • The cost of accessing the disc is high while querying tables on a computer, yet the amount of data transferred is unimportant. Therefore, minimizing disc access is our goal.
  • We are aware that we cannot increase a tree's height. Therefore, we want the tree to be as short as possible.
  • Using a B-tree, which has more branches and hence a shorter height, is the solution to this problem. Access time decreases as branching and depth grow.