Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
DATA BASE MANAGEMENT SYSTEM (DBMS)
Presentation on :
BY Group2 (CSE - A - 18) :
Aditya Jha 07
Chayan Sharma 21
Gaurav Kumar Gupta 24
Palaque Sharma 54
Based on
Non-volatile
Data is stored on spinning magnetic disk
Data survives power failure
Reads are roughly as fast as main memory
Data is read optically from a spinning disk, using a laser
Data must be moved from disk to main memory for access, and written back for storage
writes are slow (few microseconds)
Read and write speed is slow
Much slower access than main memory.
Cache
Main Memory
Decreasing Access time
Flash Memory
Cost and Fastness increase's
Magnetic Disk
Optical Disk
Magnetic Tape
Databases are stored in file formats, which contain records. At physical level, the actual data is
stored in electromagnetic format on some device. These storage devices can be broadly
categorized into three type:-
Databases are stored in file formats, which contain records. At physical level, the actual data is stored in electromagnetic format on some device
RAID or Redundant Array of Independent Disks, is a technology to connect multiple secondary storage devices and use them as a single storage media.
Advantages over Raid 0
Advantages over Raid 1
Advantages over Raid 2
To recover data in a damaged disk, compute XOR of bits from other disks (including parity bit disk)
Advantages over Raid 3
Block stripping: an entire block of data is written onto data disks and then the parity is generated and stored on a different disk
Advantages over Raid 4
The parity bits generated for data block stripe are distributed, rather than on different disks.
Advantages over Raid 5
File:
A file is a collection of data stored in one unit, identified by a filename.
File Organization:
It refers to the logical relationships among various records
or
Means of identification and access to any required data
or
Storing the files in certain order is called file Organization.
1.Pipe File Method:
New records are stored without breaking Sequence
Easiest Method:
Files are sorted one after another in sequential manner
New record Simply place at EOF
2.Sorted File Method:
New records initially inserted at end then sort the record
Two Different types:
1.Pipe File Method
2.Sorted File Method
Initially inserted at end
Records are sorted
2.
Simple, Easy and Cheap Storage
Fast and efficient
(for large amount of data)
1.
2.
Takes More time & space for storage
Time Wastage:As we have to follow sequence
1.
Advantages:
1. Faster fetching and retrieving of records
2. Best Suited when huge number of data need to be
loaded.
Disadvantages:
1. Unused memory block problem
2. Inefficient for large data
Works with Data blocks:
1.Records are Inserted at the end of the
file into data blocks
2.No sorting is required
New Records goes to vacant Blocks
Advantages:
1.Tree traversal is easier and faster.
2. Easy to search records.
3. No restriction on B+ tree size
It uses tree like structure to store records:
1.Key-Indexing: Primary key is use to sort
record
2.Similar to Binary Search Tree but can have more than two children.
Disadvantages:
1. Insufficient for static tables
*As its leaf nodes is balanced, searching is easy
*From the leaf node at end we can traverse to all data.
In this two or more related tables/records are stored within same file know as clusters
=>Lowers the cost of searching and retrieving various records in diff. files
2.Provides efficient result
1.Used when frequent joining of table required
Low Performance for large database
3
Types
What is Index ?
Pointer stores address of disk block.
Search Key - attribute to set of attributes used to look up records in a file
Types of Indices?
Ordered indices: keys are stored in sorted order
Hash indices: search keys are distributed uniformly across “buckets” using a “hash function”.
Primary Indices
Secondary Indices
Clustering Indices
If primary index does not fit in memory, access becomes expensive.
Solution: treat primary index kept on disk as a sequential file and construct a sparse index on it
For a huge database structure, it can be almost next to impossible to search all the index values
through all its level and then reach the destination data block to retrieve the desired data.
Hashing
is an effective technique to calculate the direct location of a data record on the disk without using
index structure.
Bucket
Hash Function
There are 10 buckets,
The binary representation of the ith character is assumed to be the integer i.
The hash function returns the sum of the binary representations of the characters modulo 10
E.g.
h(Music) = 1 h(History) = 2
h(Physics) = 3 h(Elec. Eng.) = 3
An ideal hash function is uniform, i.e., each bucket is assigned the same number of search-key values from the set of all possible values
Ideal hash function is random, so each bucket will have the same number of records assigned to it irrespective of the actual distribution of search-key values in the file
Bucket overflow can occur because of
Insufficient buckets
Skew in distribution of records.
This can occur due to two reasons:
multiple records have same search-key value
chosen hash function produces non-uniform distribution of key values
Overflow chaining – the overflow buckets of a given bucket are chained together in a linked list.
Static Hashing
Dynamic Hashing
In static hashing, when a search-key value is provided, the hash function always computes the same address
One solution: periodic re-organization of the file with a new hash function
Expensive, disrupts normal operations
Better solution: allow the number of buckets to be modified dynamically
If initial number of buckets is too small, and file grows, performance will degrade due to too much overflows.
If space is allocated for anticipated growth, a significant amount of space will be wasted initially (and buckets will be underfull).
If database shrinks, again space will be wasted.
Good for database that grows and shrinks in size.
Allows the hash function to be modified dynamically
Hashing can be used not only for file organization, but also for index-structure creation.
Strictly speaking, hash indices are always secondary indices