SlideShare a Scribd company logo
1 of 44
Definition of RAID:
• RAID refers to redundancy array of the independent disk.
• It is a technology which is used to connect multiple secondary
storage devices for increased performance, data redundancy or
both.
• It gives you the ability to survive one or more drive failure
depending upon the RAID level used.
• It consists of an array of disks in which multiple disks are
connected to achieve different goals.
RAID is used to backup the data when a disk fails for some
reason.
RAID 0 implements data striping.
RAID 1 implements mirroring which creates redundant data.
RAID 2 uses Hamming code Error Detection method to correct
error in data.
RAID 3 does byte-level data striping and has parity bits for each
data word.
RAID 4 does block-level data striping.
RAID 5 has rotating parity across the disks.
RAID 6 has two parity which can handle at most two disk
failures.
•RAID level 0 provides data stripping, i.e., a data can place across multiple
disks.
•It is based on stripping that means if one disk fails then all data in the array
is lost.
•This level doesn't provide fault tolerance but increases the system
performance.
Disk 0
(C:)
Disk 1
(D:)
Disk 2
(E:)
Disk 3
(F:)
A B C D
E F G H
I J K L
M N O P
•This level is called mirroring of data as it copies the data from drive 1
to drive 2. It provides 100% redundancy in case of a failure.
Example:
The main advantage of RAID 1 is fault tolerance. In this
level, if one disk fails, then the other automatically
takes over
Disk 0
(C:)
Disk 1
(D:)
Disk 2
(E:)
Disk 3
(F:)
A A B B
C C D D
E E F F
G G H H
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.
• RAID 2 consists of bit-level striping using hamming code parity.
• Hamming (7, 4) code: It is a linear error-correcting code that encodes
four bits of data into seven bits, by adding three parity bits.
• In this level, each data bit in a word is recorded on a separate disk and
Error correction code (ECC) of data words is stored on different set disks.
• Due to its high cost and complex structure, this level is not commercially
used. This same performance can be achieved by RAID 3 at a lower cost
• Cons: It requires an additional drive for error detection.
• In this figure, we can observe one disk dedicated to parity.
• In this level, parity can be calculated using an XOR function.
• If the data bits are 0,0,0,1 then the parity bits is XOR(0,1,0,0) = 1.
• If the parity bits are 0,0,1,1 then the parity bit is XOR(0,0,1,1)= 0. That
means, even number of one results in parity 0 and an odd number of
one results in parity 1.
C1 C2 C3 C4 Parity
0 1 0 0 1
0 0 1 1 0
• Suppose that in the above figure, C2 is
lost due to some disk failure. Then using
the values of all the other columns and
the parity bit, we can recompute the data
bit stored in C2. This level allows us to
recover lost data.
•RAID 3 consists of byte-level striping with dedicated parity. In this level, the
parity information is stored for each disk section and written to a dedicated
parity drive.
•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 can be transferred in bulk. Thus high-speed data
transmission is possible.
Disk 0 Disk 1 Disk 2 Disk 3
A B C P(A, B, C)
D E F P(D, E, F)
G H I P(G, H, I)
J K L P(J, K, L)
•RAID 4 consists of block-level stripping with a parity disk.(fixed-length
storage units known as Blocks) 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.
•Level 3 and level 4 both are required at least three disks to implement
RAID.
Disk 0 Disk 1 Disk 2 Disk 3
A B C P0
D E F P1
G H I P2
J K L P3
•RAID 5 is a slight modification of the RAID 4 system. The only difference is that in RAID
5, the parity rotates among the drives.
•It consists of block-level striping with DISTRIBUTED parity.
•Same as RAID 4, this level allows recovery of at most 1 disk failure. If more than one
disk fails, then there is no way for data recovery.
Disk 0 Disk 1 Disk 2 Disk 3 Disk 4
0 1 2 3 P0
5 6 7 P1 4
10 11 P2 8 9
15 P3 12 13 14
P4 16 17 18 19
• •This level is an extension of RAID 5. It contains block-level stripping with 2
parity bits.
•In RAID 6, you can survive 2 concurrent disk failures.
•Suppose you are using RAID 5, and RAID 1. When your disks fail, you
need to replace the failed disk because if simultaneously another disk fails
then you won't be able to recover any of the data, so in this case RAID 6
plays its part where you can survive two concurrent disk failures before
you run out of options.
Disk 1 Disk 2 Disk 3 Disk 4
A0 B0 Q0 P0
A1 Q1 P1 D1
Q2 P2 C2 D2
P3 B3 C3 Q3
• There are different ways of storing data in the database.
•Storing data in files is one of them. A user can store the data in files in an
organized manner.
•These files are organized logically as a sequence of records and reside
permanently on disks. Each file is divided into fixed-length storage units
known as Blocks.
• These blocks are the units of storage allocation as well as data transfer.
•Although the default block size in the database is 4 to 8 kilobytes, many
databases allow specifying the size at the time of creating the database
instance.
There are two possible ways of representing the records:
4.3.1. Fixed-length records
4.3.2. Variable-length records
Fixed-length records means setting a length and storing the records into
the file.
If the record size exceeds the fixed size, it gets divided into more than
one block. Due to the fixed size there occurs following two problems:
1. Partially storing subparts of the record in more than one block requires
access to all the blocks containing the subparts to read or write in it.
2. It is difficult to delete a record in such a file organization because if the
size of the existing record is smaller than the block size, then another
record or a part fills up the block.
Variable-length records are the records that vary in size.
It requires the creation of multiple blocks of multiple sizes to store them.
• Indexes can be created using some database columns.
What is Indexing in DBMS?
Indexing is a technique for improving database performance by
reducing the number of disk accesses necessary when a query is
run.
•Search Key: The first column of the database is the
search key that contains a copy of the primary key or
candidate key of the table. The values of the primary
key are stored in sorted order so that the
corresponding data can be accessed easily.
•Data Reference: The second column of the database
is the data reference. It contains a set of pointers
holding the address of the disk block where the value
of the particular key can be found.
• Definition: If the index is created on the basis of the primary
key of the table, then it is known as primary indexing.
• These primary keys are unique to each record and contain
1:1 relation between the records.
• As primary keys are stored in sorted order, the performance of
the searching operation is quite efficient.
• It is classified into two types:
1. Dense index and
2. Sparse index.
• The dense index contains an index record for every search key value in
the data file. It makes searching faster.
• In this, the number of records in the index table is same as the number
of records in the main table.
• It needs more space to store index record itself. The index records have
the search key and a pointer to the actual record on the disk.
•In the data file, index record appears only for a few items. Each
item points to a block.
•In this, instead of pointing to each record in the main table, the index
points to the records in the main table in a gap.
• 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).
 The B+ tree is a balanced binary search tree. It follows a multi-level index
format.
 In the B+ tree, leaf nodes denote actual data pointers. B+ tree ensures that all
leaf nodes remain at the same height.
 In the B+ tree, the leaf nodes are linked using a link list. Therefore, a B+ tree
can support random access as well as sequential access.
 In a huge database structure, it is very inefficient to search all the index
values and reach the desired data.
 Hashing technique is used to calculate the direct location of a data
record on the disk without using index structure.
Two types
 1. Static hashing
 2. Dynamic hashing
 In static hashing, the resultant data bucket address will always be the In
static hashing, the resultant data bucket address will always be the same
 That means if we generate an address for EMP_ID =103 using the hash
function mod (5) then it will always result in same bucket address 3.
 Here, there will be no change in the bucket address.
 Hence in this static hashing, the number of data buckets in memory remains
constant throughout.
 In this example, we will have five data buckets in the memory used to store
the data.
 The dynamic hashing method is used to overcome the problems of static
hashing like bucket overflow.
 In this method, data buckets grow or shrink as the record increases or
decreases. This method is also known as Extendable hashing method.
 This method makes hashing dynamic, i.e., it allows insertion or deletion
without resulting in poor performance.
The last two bits of 2 and 4 are 00. So it will go into bucket B0.
The last two bits of 5 and 6 are 01, so it will go into bucket B1.
The last two bits of 1 and 3 are 10, so it will go into bucket B2.
The last two bits of 7 are 11, so it will go into B3.
Empid
26
0
30
0
9
21
23
1. Overview
2. Measures of Query Cost
3. Selection Operation
4. Sorting
5. Join Operation
6. Evaluation of Expressions
Basic Steps in Query Processing
1. Parsing and translation
2. Evaluation
3. Optimization
Query: Select book, title, price from book where price >30
Basic Steps in Query Processing (Cont.)
 1. Parsing and translation
translate the query into its internal form.
This is then translated into relational
algebra.
Parser checks syntax, verifies relations
 2. Evaluation
The query-execution engine takes a query-
evaluation plan, executes that plan, and
returns the answers to the query.
Basic Steps in Query Processing : 3. Optimization
 A relational algebra expression may have many equivalent expressions
 E.g., price>30 (book,titile,price(Book)) is equivalent to
book,titile,price (price>30 (Book))
 Query Optimization: Amongst all equivalent evaluation plans choose the one
with lowest cost.
 Cost is estimated using statistical information from the
database catalog
 e.g. number of tuples in each relation, size of tuples, etc.
2. Measures of Query Cost
 Cost is generally measured as total elapsed time for answering
query
 Many factors contribute to time cost
disk accesses, CPU cycles, or even transit time in
network communication
 Measured by
 Number of seeks
 Number of blocks read
 Number of blocks written
Cost to write a block is greater than cost to read a block
data is read back after being written to ensure that
the write was successful
Seek time is the time it takes for the
read/write heads to move from their
current position to the desired track
3. Selection Operation
Linear search can be applied
selection condition or
ordering of records in the file, or
availability of indices
binary search executed when data is stored
consecutively
when there is an index available,
4. Sorting- Quick sort is used
 We may build an index on the relation, and then
use the index to read the relation in sorted order.
May lead to one disk block access for each tuple.
 For relations that fit in memory, techniques like
quicksort can be used.
Join Operation
 Several different algorithms to implement joins
 Nested-loop join
 Block nested-loop join
 Indexed nested-loop join
 Merge-join
 Hash-join
 Choice based on cost estimate
Evaluation of Expressions
 Alternatives for evaluating an entire expression tree
 Materialization: generate results of an expression
whose inputs are relations or are already computed,
materialize (store) it on disk.
 Pipelining: pass on tuples to parent operations even as
an operation is being executed
CS 2212-  UNIT -4.pptx
CS 2212-  UNIT -4.pptx

More Related Content

Similar to CS 2212- UNIT -4.pptx

Main MeMory Data Base
Main MeMory Data BaseMain MeMory Data Base
Main MeMory Data BaseSiva Rushi
 
Data center core elements, Data center virtualization
Data center core elements, Data center virtualizationData center core elements, Data center virtualization
Data center core elements, Data center virtualizationMadhuraNK
 
disk structure and multiple RAID levels .ppt
disk structure and multiple  RAID levels .pptdisk structure and multiple  RAID levels .ppt
disk structure and multiple RAID levels .pptRAJASEKHARV10
 
DBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptxDBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptxJayendranath3
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organizationBishal Ghimire
 
Data Indexing Presentation-My.pptppt.ppt
Data Indexing Presentation-My.pptppt.pptData Indexing Presentation-My.pptppt.ppt
Data Indexing Presentation-My.pptppt.pptsdsm2
 
3 configuring basic and dynamic disks
3 configuring basic and dynamic disks3 configuring basic and dynamic disks
3 configuring basic and dynamic disksHameda Hurmat
 
Chapter 8 - Multimedia Storage and Retrieval
Chapter 8 - Multimedia Storage and RetrievalChapter 8 - Multimedia Storage and Retrieval
Chapter 8 - Multimedia Storage and RetrievalPratik Pradhan
 
Storage Media and File Organisation.pptx
Storage Media and File Organisation.pptxStorage Media and File Organisation.pptx
Storage Media and File Organisation.pptxhusainsadikarvy
 

Similar to CS 2212- UNIT -4.pptx (20)

Designing data intensive applications
Designing data intensive applicationsDesigning data intensive applications
Designing data intensive applications
 
Main MeMory Data Base
Main MeMory Data BaseMain MeMory Data Base
Main MeMory Data Base
 
Class2
Class2Class2
Class2
 
Data center core elements, Data center virtualization
Data center core elements, Data center virtualizationData center core elements, Data center virtualization
Data center core elements, Data center virtualization
 
RAID.ppt
RAID.pptRAID.ppt
RAID.ppt
 
disk structure and multiple RAID levels .ppt
disk structure and multiple  RAID levels .pptdisk structure and multiple  RAID levels .ppt
disk structure and multiple RAID levels .ppt
 
Raid in SNA
Raid in SNA Raid in SNA
Raid in SNA
 
DBMS RAID.pptx
DBMS RAID.pptxDBMS RAID.pptx
DBMS RAID.pptx
 
Raid
RaidRaid
Raid
 
DBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptxDBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptx
 
Raid and its levels
Raid and its levelsRaid and its levels
Raid and its levels
 
Raid 1 3
Raid 1 3Raid 1 3
Raid 1 3
 
DAS RAID NAS SAN
DAS RAID NAS SANDAS RAID NAS SAN
DAS RAID NAS SAN
 
Raid
RaidRaid
Raid
 
raid technology
raid technologyraid technology
raid technology
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organization
 
Data Indexing Presentation-My.pptppt.ppt
Data Indexing Presentation-My.pptppt.pptData Indexing Presentation-My.pptppt.ppt
Data Indexing Presentation-My.pptppt.ppt
 
3 configuring basic and dynamic disks
3 configuring basic and dynamic disks3 configuring basic and dynamic disks
3 configuring basic and dynamic disks
 
Chapter 8 - Multimedia Storage and Retrieval
Chapter 8 - Multimedia Storage and RetrievalChapter 8 - Multimedia Storage and Retrieval
Chapter 8 - Multimedia Storage and Retrieval
 
Storage Media and File Organisation.pptx
Storage Media and File Organisation.pptxStorage Media and File Organisation.pptx
Storage Media and File Organisation.pptx
 

Recently uploaded

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Recently uploaded (20)

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

CS 2212- UNIT -4.pptx

  • 1.
  • 2.
  • 3. Definition of RAID: • RAID refers to redundancy array of the independent disk. • It is a technology which is used to connect multiple secondary storage devices for increased performance, data redundancy or both. • It gives you the ability to survive one or more drive failure depending upon the RAID level used. • It consists of an array of disks in which multiple disks are connected to achieve different goals.
  • 4. RAID is used to backup the data when a disk fails for some reason. RAID 0 implements data striping. RAID 1 implements mirroring which creates redundant data. RAID 2 uses Hamming code Error Detection method to correct error in data. RAID 3 does byte-level data striping and has parity bits for each data word. RAID 4 does block-level data striping. RAID 5 has rotating parity across the disks. RAID 6 has two parity which can handle at most two disk failures.
  • 5. •RAID level 0 provides data stripping, i.e., a data can place across multiple disks. •It is based on stripping that means if one disk fails then all data in the array is lost. •This level doesn't provide fault tolerance but increases the system performance. Disk 0 (C:) Disk 1 (D:) Disk 2 (E:) Disk 3 (F:) A B C D E F G H I J K L M N O P
  • 6. •This level is called mirroring of data as it copies the data from drive 1 to drive 2. It provides 100% redundancy in case of a failure. Example: The main advantage of RAID 1 is fault tolerance. In this level, if one disk fails, then the other automatically takes over Disk 0 (C:) Disk 1 (D:) Disk 2 (E:) Disk 3 (F:) A A B B C C D D E E F F G G H H 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.
  • 7. • RAID 2 consists of bit-level striping using hamming code parity. • Hamming (7, 4) code: It is a linear error-correcting code that encodes four bits of data into seven bits, by adding three parity bits. • In this level, each data bit in a word is recorded on a separate disk and Error correction code (ECC) of data words is stored on different set disks. • Due to its high cost and complex structure, this level is not commercially used. This same performance can be achieved by RAID 3 at a lower cost • Cons: It requires an additional drive for error detection.
  • 8.
  • 9. • In this figure, we can observe one disk dedicated to parity. • In this level, parity can be calculated using an XOR function. • If the data bits are 0,0,0,1 then the parity bits is XOR(0,1,0,0) = 1. • If the parity bits are 0,0,1,1 then the parity bit is XOR(0,0,1,1)= 0. That means, even number of one results in parity 0 and an odd number of one results in parity 1. C1 C2 C3 C4 Parity 0 1 0 0 1 0 0 1 1 0 • Suppose that in the above figure, C2 is lost due to some disk failure. Then using the values of all the other columns and the parity bit, we can recompute the data bit stored in C2. This level allows us to recover lost data.
  • 10. •RAID 3 consists of byte-level striping with dedicated parity. In this level, the parity information is stored for each disk section and written to a dedicated parity drive. •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 can be transferred in bulk. Thus high-speed data transmission is possible. Disk 0 Disk 1 Disk 2 Disk 3 A B C P(A, B, C) D E F P(D, E, F) G H I P(G, H, I) J K L P(J, K, L)
  • 11. •RAID 4 consists of block-level stripping with a parity disk.(fixed-length storage units known as Blocks) 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. •Level 3 and level 4 both are required at least three disks to implement RAID. Disk 0 Disk 1 Disk 2 Disk 3 A B C P0 D E F P1 G H I P2 J K L P3
  • 12. •RAID 5 is a slight modification of the RAID 4 system. The only difference is that in RAID 5, the parity rotates among the drives. •It consists of block-level striping with DISTRIBUTED parity. •Same as RAID 4, this level allows recovery of at most 1 disk failure. If more than one disk fails, then there is no way for data recovery. Disk 0 Disk 1 Disk 2 Disk 3 Disk 4 0 1 2 3 P0 5 6 7 P1 4 10 11 P2 8 9 15 P3 12 13 14 P4 16 17 18 19
  • 13. • •This level is an extension of RAID 5. It contains block-level stripping with 2 parity bits. •In RAID 6, you can survive 2 concurrent disk failures. •Suppose you are using RAID 5, and RAID 1. When your disks fail, you need to replace the failed disk because if simultaneously another disk fails then you won't be able to recover any of the data, so in this case RAID 6 plays its part where you can survive two concurrent disk failures before you run out of options. Disk 1 Disk 2 Disk 3 Disk 4 A0 B0 Q0 P0 A1 Q1 P1 D1 Q2 P2 C2 D2 P3 B3 C3 Q3
  • 14. • There are different ways of storing data in the database. •Storing data in files is one of them. A user can store the data in files in an organized manner. •These files are organized logically as a sequence of records and reside permanently on disks. Each file is divided into fixed-length storage units known as Blocks. • These blocks are the units of storage allocation as well as data transfer. •Although the default block size in the database is 4 to 8 kilobytes, many databases allow specifying the size at the time of creating the database instance. There are two possible ways of representing the records: 4.3.1. Fixed-length records 4.3.2. Variable-length records
  • 15. Fixed-length records means setting a length and storing the records into the file. If the record size exceeds the fixed size, it gets divided into more than one block. Due to the fixed size there occurs following two problems: 1. Partially storing subparts of the record in more than one block requires access to all the blocks containing the subparts to read or write in it. 2. It is difficult to delete a record in such a file organization because if the size of the existing record is smaller than the block size, then another record or a part fills up the block.
  • 16. Variable-length records are the records that vary in size. It requires the creation of multiple blocks of multiple sizes to store them.
  • 17. • Indexes can be created using some database columns. What is Indexing in DBMS? Indexing is a technique for improving database performance by reducing the number of disk accesses necessary when a query is run.
  • 18. •Search Key: The first column of the database is the search key that contains a copy of the primary key or candidate key of the table. The values of the primary key are stored in sorted order so that the corresponding data can be accessed easily. •Data Reference: The second column of the database is the data reference. It contains a set of pointers holding the address of the disk block where the value of the particular key can be found.
  • 19.
  • 20. • Definition: If the index is created on the basis of the primary key of the table, then it is known as primary indexing. • These primary keys are unique to each record and contain 1:1 relation between the records. • As primary keys are stored in sorted order, the performance of the searching operation is quite efficient. • It is classified into two types: 1. Dense index and 2. Sparse index.
  • 21. • The dense index contains an index record for every search key value in the data file. It makes searching faster. • In this, the number of records in the index table is same as the number of records in the main table. • It needs more space to store index record itself. The index records have the search key and a pointer to the actual record on the disk.
  • 22. •In the data file, index record appears only for a few items. Each item points to a block. •In this, instead of pointing to each record in the main table, the index points to the records in the main table in a gap.
  • 23. • 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).
  • 24.
  • 25.
  • 26.  The B+ tree is a balanced binary search tree. It follows a multi-level index format.  In the B+ tree, leaf nodes denote actual data pointers. B+ tree ensures that all leaf nodes remain at the same height.  In the B+ tree, the leaf nodes are linked using a link list. Therefore, a B+ tree can support random access as well as sequential access.
  • 27.  In a huge database structure, it is very inefficient to search all the index values and reach the desired data.  Hashing technique is used to calculate the direct location of a data record on the disk without using index structure. Two types  1. Static hashing  2. Dynamic hashing
  • 28.  In static hashing, the resultant data bucket address will always be the In static hashing, the resultant data bucket address will always be the same  That means if we generate an address for EMP_ID =103 using the hash function mod (5) then it will always result in same bucket address 3.  Here, there will be no change in the bucket address.  Hence in this static hashing, the number of data buckets in memory remains constant throughout.  In this example, we will have five data buckets in the memory used to store the data.
  • 29.
  • 30.  The dynamic hashing method is used to overcome the problems of static hashing like bucket overflow.  In this method, data buckets grow or shrink as the record increases or decreases. This method is also known as Extendable hashing method.  This method makes hashing dynamic, i.e., it allows insertion or deletion without resulting in poor performance.
  • 31. The last two bits of 2 and 4 are 00. So it will go into bucket B0. The last two bits of 5 and 6 are 01, so it will go into bucket B1. The last two bits of 1 and 3 are 10, so it will go into bucket B2. The last two bits of 7 are 11, so it will go into B3. Empid 26 0 30 0 9 21 23
  • 32. 1. Overview 2. Measures of Query Cost 3. Selection Operation 4. Sorting 5. Join Operation 6. Evaluation of Expressions
  • 33. Basic Steps in Query Processing 1. Parsing and translation 2. Evaluation 3. Optimization Query: Select book, title, price from book where price >30
  • 34.
  • 35.
  • 36. Basic Steps in Query Processing (Cont.)  1. Parsing and translation translate the query into its internal form. This is then translated into relational algebra. Parser checks syntax, verifies relations  2. Evaluation The query-execution engine takes a query- evaluation plan, executes that plan, and returns the answers to the query.
  • 37. Basic Steps in Query Processing : 3. Optimization  A relational algebra expression may have many equivalent expressions  E.g., price>30 (book,titile,price(Book)) is equivalent to book,titile,price (price>30 (Book))  Query Optimization: Amongst all equivalent evaluation plans choose the one with lowest cost.  Cost is estimated using statistical information from the database catalog  e.g. number of tuples in each relation, size of tuples, etc.
  • 38. 2. Measures of Query Cost  Cost is generally measured as total elapsed time for answering query  Many factors contribute to time cost disk accesses, CPU cycles, or even transit time in network communication  Measured by  Number of seeks  Number of blocks read  Number of blocks written Cost to write a block is greater than cost to read a block data is read back after being written to ensure that the write was successful Seek time is the time it takes for the read/write heads to move from their current position to the desired track
  • 39. 3. Selection Operation Linear search can be applied selection condition or ordering of records in the file, or availability of indices binary search executed when data is stored consecutively when there is an index available,
  • 40. 4. Sorting- Quick sort is used  We may build an index on the relation, and then use the index to read the relation in sorted order. May lead to one disk block access for each tuple.  For relations that fit in memory, techniques like quicksort can be used.
  • 41. Join Operation  Several different algorithms to implement joins  Nested-loop join  Block nested-loop join  Indexed nested-loop join  Merge-join  Hash-join  Choice based on cost estimate
  • 42. Evaluation of Expressions  Alternatives for evaluating an entire expression tree  Materialization: generate results of an expression whose inputs are relations or are already computed, materialize (store) it on disk.  Pipelining: pass on tuples to parent operations even as an operation is being executed