SlideShare a Scribd company logo
1 of 20
Selection
(R)
value
R.attr op

 Tuple Length
◦ Reserves
 40 bytes
◦ Sailors
 50 bytes
 # of Tuples
◦ Reserves
 100,000
◦ Sailors
 40,000
 Page Size
◦ 4k
 Size on Disk
◦ Reserves ???
◦ Sailors ???
 Naive Approach (Heap File)
◦ 1000 pages
 Sorted File (on rname)
◦ ???
 Clustered Index
◦ ???
 Unclustered Index
◦ ???
(R)
value
R.attr op

 M:= Size of R on Disk (in pages)
 X:= # of tuples satisfying “R.attr op value”
 Y:= # of tuples per page
 No Index, Unsorted Data
◦ File Scan
 O(M)
 No Index, Sorted Data
◦ Sorted-file Scan
 Scan following a Binary Search
 O(log2 M) + O(X/Y)
(R)
value
R.attr op

 B+ Tree Index (Clustered)
◦ Alternative 1 (Data Entry == Data Record)
 O(1) + O(X/Y)
◦ Alternative 2,3
 O(1) + O(X/Z) + O(X/Y)
 Z:= # of Data Entries per Page
 Recall Z is much larger than Y
(R)
value
R.attr op

 B+ Tree Index (Unclustered)
◦ Alternative 1 (Data Entry == Data Record)
 ???
◦ Alternative 2,3
 O(1) + O(X/Z) + O(X)
 X can be much Larger than M
 Smart Approach
 Sort Data Entries on the basis of page-
id or their rids
 Any Gain???
(R)
value
R.attr op

 Hash Index (Only for Equality Selection)
◦ X is typically small
◦ X == 1 implies ???
(R)
value
R.attr op

 R.rnarne='Joe' AND R.bid=r
(R)
r
R.bid
Joe'
'
R.rname 



 CNF
◦ Collection of Conjuncts connected through Ʌ
Operator
 Conjunct
◦ One or more terms connected through V
Operator
◦ If a conjunct contains V then it is called
Disjunctive or containing Disjunction
◦ Primary Conjunct if an Index is available
 File Scan
 Single Index
◦ Selectivity
 Multiple Indexes
 File Scan
 Qualifying Tuples
 Union

More Related Content

More from Robbia Rana (12)

Technical Writing.pptx
Technical Writing.pptxTechnical Writing.pptx
Technical Writing.pptx
 
Increase the Effectiveness of Your Reading and Studying Skills.pptx
Increase the Effectiveness of Your Reading and Studying Skills.pptxIncrease the Effectiveness of Your Reading and Studying Skills.pptx
Increase the Effectiveness of Your Reading and Studying Skills.pptx
 
Professionalism in the office.pptx
Professionalism in the office.pptxProfessionalism in the office.pptx
Professionalism in the office.pptx
 
English Writing Skills.pptx
English Writing Skills.pptxEnglish Writing Skills.pptx
English Writing Skills.pptx
 
Principle of Accounting.pptx
Principle of  Accounting.pptxPrinciple of  Accounting.pptx
Principle of Accounting.pptx
 
Payroll Accounting.pptx
Payroll Accounting.pptxPayroll Accounting.pptx
Payroll Accounting.pptx
 
Fundamental of Accounting.pptx
Fundamental of Accounting.pptxFundamental of Accounting.pptx
Fundamental of Accounting.pptx
 
MS Excel 2013.pptx
MS Excel 2013.pptxMS Excel 2013.pptx
MS Excel 2013.pptx
 
Basic Accounting.pptx
Basic Accounting.pptxBasic Accounting.pptx
Basic Accounting.pptx
 
Financial Accounting .pptx
Financial Accounting .pptxFinancial Accounting .pptx
Financial Accounting .pptx
 
Cash Accounting.pptx
Cash Accounting.pptxCash Accounting.pptx
Cash Accounting.pptx
 
Relational Operators 2.pptx
Relational Operators 2.pptxRelational Operators 2.pptx
Relational Operators 2.pptx
 

Recently uploaded

Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 

Relational Operators (SELECTION).pptx

  • 2.
  • 3.  Tuple Length ◦ Reserves  40 bytes ◦ Sailors  50 bytes  # of Tuples ◦ Reserves  100,000 ◦ Sailors  40,000  Page Size ◦ 4k  Size on Disk ◦ Reserves ??? ◦ Sailors ???
  • 4.  Naive Approach (Heap File) ◦ 1000 pages  Sorted File (on rname) ◦ ???  Clustered Index ◦ ???  Unclustered Index ◦ ??? (R) value R.attr op 
  • 5.  M:= Size of R on Disk (in pages)  X:= # of tuples satisfying “R.attr op value”  Y:= # of tuples per page  No Index, Unsorted Data ◦ File Scan  O(M)  No Index, Sorted Data ◦ Sorted-file Scan  Scan following a Binary Search  O(log2 M) + O(X/Y) (R) value R.attr op 
  • 6.  B+ Tree Index (Clustered) ◦ Alternative 1 (Data Entry == Data Record)  O(1) + O(X/Y) ◦ Alternative 2,3  O(1) + O(X/Z) + O(X/Y)  Z:= # of Data Entries per Page  Recall Z is much larger than Y (R) value R.attr op 
  • 7.  B+ Tree Index (Unclustered) ◦ Alternative 1 (Data Entry == Data Record)  ??? ◦ Alternative 2,3  O(1) + O(X/Z) + O(X)  X can be much Larger than M  Smart Approach  Sort Data Entries on the basis of page- id or their rids  Any Gain??? (R) value R.attr op 
  • 8.  Hash Index (Only for Equality Selection) ◦ X is typically small ◦ X == 1 implies ??? (R) value R.attr op 
  • 9.  R.rnarne='Joe' AND R.bid=r (R) r R.bid Joe' ' R.rname    
  • 10.  CNF ◦ Collection of Conjuncts connected through Ʌ Operator  Conjunct ◦ One or more terms connected through V Operator ◦ If a conjunct contains V then it is called Disjunctive or containing Disjunction ◦ Primary Conjunct if an Index is available
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.  File Scan  Single Index ◦ Selectivity