SlideShare a Scribd company logo
Projection
)
(
,...,
, 2
1 R
m
attr
attr
attr

1
2
 Tuple Length
◦ Reserves
 40 bytes
◦ Sailors
 50 bytes
 # of Tuples
◦ Reserves
 100,000
◦ Sailors
 40,000
 Page Size
◦ 4k
 Size on Disk
◦ Reserves ???
◦ Sailors ???
3
 SELECT DISTINCT R.sid, R.bid
FROM Reserves R
)
(
,...,
, 2
1 R
m
attr
attr
attr

Reserves
bid
sid,

4
 M:= # of pages of R
 T:= M*F
 Scan and Project (in Temp)
◦ O(M)+O(T)
 Sort (Temp)
◦ O (TlogT)
 2-Way Sort
 Scan (Temp) and Eliminate Duplicates
◦ O(T)
h
TupleLengt
attr
of
Size
F
m
i
i /
)
(
_
1




5
 sid+bid = 10 bytes
 Buffer Pages = 20
 Scan and Project (in Temp)
◦ 1000+250 = 1250
 Sort (Temp)
◦ Two passes
 Pass 0 (⌈250/20⌉ = 13 runs)
 Pass 1 (13 Way Merges)
◦ 2(2*250) = 1000
 Scan (Temp) and Eliminate Duplicates
◦ 250
Total I/Os:
1250
1000
250
2500
6
 Buffer Pages = B
 Pass 0
◦ Project Out Unwanted Attributes
◦ Read B Pages Write run of B*F Pages
 Runs of 2B pages with aggressive implementation
 Subsequent Passes
◦ Eliminate Duplicates while Merging
h
TupleLengt
attr
of
Size
F
m
i
i /
)
(
_
1




7
◦ sid+bid = 10 bytes
◦ Buffer Pages = 20
 Pass 0
◦ 1000+250 = 1250
◦ 50 Reads of 20 Pages each
◦ 50 Writes of 5 Pages each
 Pass 1
◦ 250*2 = 500
◦ 19-Way Merges with Duplicates Elimination
◦ Two runs of 19*5 pages, One run of 60 pages
 Pass 2
◦ 250*1 = 250
◦ 3-Way Merge with Duplicates Elimination
Total I/Os:
1250
500
250
2000
8
 Using Aggressive Implementation
 Pass 0
◦ 1000+250 = 1250
◦ 6 runs of 40 pages each
◦ 1 run of 10 pages
 Pass 1
◦ 250*1 = 250
◦ 7-Way Merge with Duplicates Elimination
Total I/Os:
1250
250
1500
9
 B (buffer pages) is typically large
◦ f:= fudge factor
 2-Phase Process
◦ Phase 1
 Partitioning
 (After Projecting OUT Unwanted Attributes)
◦ Phase 2
 Duplicates Elimination
f
T
B .

10
 One input buffer page
 B −1 output buffer pages
 For each tuple
◦ Project out the unwanted attributes
◦ Apply a hash function h to the combination of all
remaining attributes
 h is chosen so that tuples are distributed
uniformly to one of B −1 partitions
11
12
At the end of the partitioning phase,
we have B −1 partitions
 X and Y are identical records only if
◦ hash(X) == hash(Y)
 For each Partition (made in phase 1)
◦ Insert each Tuple into an in-memory Hash table
 Using a different Hash function
 Why different ???
◦ Compare Colliding Tuples for Duplicates
◦ Discard Duplicates when Found
13
 Phase 1: Partitioning
◦ Read M Pages
◦ Write T Pages
 Phase 2: Duplicates Elimination
◦ Read T Pages
 Total I/Os
◦ M+2T
14
 Index-Only Scan
15

More Related Content

Similar to Relational Operators 2.pptx

Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
Satalia
 
Problemas resueltos de funciones lineales ccesa007
Problemas resueltos de  funciones lineales ccesa007Problemas resueltos de  funciones lineales ccesa007
Problemas resueltos de funciones lineales ccesa007
Demetrio Ccesa Rayme
 
ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...
ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...
ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...
Cyber Security Alliance
 
Generating and Analyzing Events
Generating and Analyzing EventsGenerating and Analyzing Events
Generating and Analyzing Events
ztellman
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
JAX London
 
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
GeeksLab Odessa
 
Lecture.1
Lecture.1Lecture.1
Lecture.1
Faiza Memon
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
Rabia Khalid
 
5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
Michal Malohlava presents: Open Source H2O and Scala
Michal Malohlava presents: Open Source H2O and Scala Michal Malohlava presents: Open Source H2O and Scala
Michal Malohlava presents: Open Source H2O and Scala
Sri Ambati
 
"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov
Yulia Shcherbachova
 
Scala Functional Patterns
Scala Functional PatternsScala Functional Patterns
Scala Functional Patterns
league
 
Platoon Control of Nonholonomic Robots using Quintic Bezier Splines
Platoon Control of Nonholonomic Robots using Quintic Bezier SplinesPlatoon Control of Nonholonomic Robots using Quintic Bezier Splines
Platoon Control of Nonholonomic Robots using Quintic Bezier Splines
Kaustav Mondal
 
A Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with MultithreadingA Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with Multithreading
Matsuo and Tsumura lab.
 
1.2 matlab numerical data
1.2  matlab numerical data1.2  matlab numerical data
1.2 matlab numerical data
TANVIRAHMED611926
 
Kuliah teori dan analisis jaringan - linear programming
Kuliah teori dan analisis jaringan - linear programmingKuliah teori dan analisis jaringan - linear programming
Kuliah teori dan analisis jaringan - linear programming
Harun Al-Rasyid Lubis
 
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
Alex Pruden
 
Всеволод Поляков (DevOps Team Lead в Grammarly)
Всеволод Поляков (DevOps Team Lead в Grammarly)Всеволод Поляков (DevOps Team Lead в Grammarly)
Всеволод Поляков (DevOps Team Lead в Grammarly)
Provectus
 
Metrics: where and how
Metrics: where and howMetrics: where and how
Metrics: where and how
Vsevolod Polyakov
 
bode_plot By DEV
 bode_plot By DEV bode_plot By DEV
bode_plot By DEV
Devchandra Thakur
 

Similar to Relational Operators 2.pptx (20)

Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
 
Problemas resueltos de funciones lineales ccesa007
Problemas resueltos de  funciones lineales ccesa007Problemas resueltos de  funciones lineales ccesa007
Problemas resueltos de funciones lineales ccesa007
 
ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...
ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...
ASFWS 2012 - Hash-flooding DoS reloaded: attacks and defenses par Jean-Philip...
 
Generating and Analyzing Events
Generating and Analyzing EventsGenerating and Analyzing Events
Generating and Analyzing Events
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
 
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
 
Lecture.1
Lecture.1Lecture.1
Lecture.1
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
 
5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
5th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
 
Michal Malohlava presents: Open Source H2O and Scala
Michal Malohlava presents: Open Source H2O and Scala Michal Malohlava presents: Open Source H2O and Scala
Michal Malohlava presents: Open Source H2O and Scala
 
"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov
 
Scala Functional Patterns
Scala Functional PatternsScala Functional Patterns
Scala Functional Patterns
 
Platoon Control of Nonholonomic Robots using Quintic Bezier Splines
Platoon Control of Nonholonomic Robots using Quintic Bezier SplinesPlatoon Control of Nonholonomic Robots using Quintic Bezier Splines
Platoon Control of Nonholonomic Robots using Quintic Bezier Splines
 
A Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with MultithreadingA Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with Multithreading
 
1.2 matlab numerical data
1.2  matlab numerical data1.2  matlab numerical data
1.2 matlab numerical data
 
Kuliah teori dan analisis jaringan - linear programming
Kuliah teori dan analisis jaringan - linear programmingKuliah teori dan analisis jaringan - linear programming
Kuliah teori dan analisis jaringan - linear programming
 
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
 
Всеволод Поляков (DevOps Team Lead в Grammarly)
Всеволод Поляков (DevOps Team Lead в Grammarly)Всеволод Поляков (DevOps Team Lead в Grammarly)
Всеволод Поляков (DevOps Team Lead в Grammarly)
 
Metrics: where and how
Metrics: where and howMetrics: where and how
Metrics: where and how
 
bode_plot By DEV
 bode_plot By DEV bode_plot By DEV
bode_plot By DEV
 

More from Robbia Rana

CRIMINOLOGY PRESENTATION-2.pptx
CRIMINOLOGY PRESENTATION-2.pptxCRIMINOLOGY PRESENTATION-2.pptx
CRIMINOLOGY PRESENTATION-2.pptx
Robbia Rana
 
Build Your Self Esteem.pptx
Build Your Self Esteem.pptxBuild Your Self Esteem.pptx
Build Your Self Esteem.pptx
Robbia Rana
 
Motivation.pptx
Motivation.pptxMotivation.pptx
Motivation.pptx
Robbia Rana
 
Reaching your true Potential.pptx
Reaching your true Potential.pptxReaching your true Potential.pptx
Reaching your true Potential.pptx
Robbia Rana
 
Learn How to Build and Cultivate Self-Discipline.pptx
Learn How to Build and Cultivate Self-Discipline.pptxLearn How to Build and Cultivate Self-Discipline.pptx
Learn How to Build and Cultivate Self-Discipline.pptx
Robbia Rana
 
Improving Self Discipline.pptx
Improving Self Discipline.pptxImproving Self Discipline.pptx
Improving Self Discipline.pptx
Robbia Rana
 
Goals setting and Avoid Procrastination.pptx
Goals setting and Avoid Procrastination.pptxGoals setting and Avoid Procrastination.pptx
Goals setting and Avoid Procrastination.pptx
Robbia Rana
 
Writing Better Emails.pptx
Writing Better Emails.pptxWriting Better Emails.pptx
Writing Better Emails.pptx
Robbia Rana
 
Technical Writing.pptx
Technical Writing.pptxTechnical Writing.pptx
Technical Writing.pptx
Robbia Rana
 
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
Robbia Rana
 
Professionalism in the office.pptx
Professionalism in the office.pptxProfessionalism in the office.pptx
Professionalism in the office.pptx
Robbia Rana
 
English Writing Skills.pptx
English Writing Skills.pptxEnglish Writing Skills.pptx
English Writing Skills.pptx
Robbia Rana
 
Principle of Accounting.pptx
Principle of  Accounting.pptxPrinciple of  Accounting.pptx
Principle of Accounting.pptx
Robbia Rana
 
Payroll Accounting.pptx
Payroll Accounting.pptxPayroll Accounting.pptx
Payroll Accounting.pptx
Robbia Rana
 
Fundamental of Accounting.pptx
Fundamental of Accounting.pptxFundamental of Accounting.pptx
Fundamental of Accounting.pptx
Robbia Rana
 
MS Excel 2013.pptx
MS Excel 2013.pptxMS Excel 2013.pptx
MS Excel 2013.pptx
Robbia Rana
 
Basic Accounting.pptx
Basic Accounting.pptxBasic Accounting.pptx
Basic Accounting.pptx
Robbia Rana
 
Financial Accounting .pptx
Financial Accounting .pptxFinancial Accounting .pptx
Financial Accounting .pptx
Robbia Rana
 
Cash Accounting.pptx
Cash Accounting.pptxCash Accounting.pptx
Cash Accounting.pptx
Robbia Rana
 
Relational Operators (SELECTION).pptx
Relational Operators (SELECTION).pptxRelational Operators (SELECTION).pptx
Relational Operators (SELECTION).pptx
Robbia Rana
 

More from Robbia Rana (20)

CRIMINOLOGY PRESENTATION-2.pptx
CRIMINOLOGY PRESENTATION-2.pptxCRIMINOLOGY PRESENTATION-2.pptx
CRIMINOLOGY PRESENTATION-2.pptx
 
Build Your Self Esteem.pptx
Build Your Self Esteem.pptxBuild Your Self Esteem.pptx
Build Your Self Esteem.pptx
 
Motivation.pptx
Motivation.pptxMotivation.pptx
Motivation.pptx
 
Reaching your true Potential.pptx
Reaching your true Potential.pptxReaching your true Potential.pptx
Reaching your true Potential.pptx
 
Learn How to Build and Cultivate Self-Discipline.pptx
Learn How to Build and Cultivate Self-Discipline.pptxLearn How to Build and Cultivate Self-Discipline.pptx
Learn How to Build and Cultivate Self-Discipline.pptx
 
Improving Self Discipline.pptx
Improving Self Discipline.pptxImproving Self Discipline.pptx
Improving Self Discipline.pptx
 
Goals setting and Avoid Procrastination.pptx
Goals setting and Avoid Procrastination.pptxGoals setting and Avoid Procrastination.pptx
Goals setting and Avoid Procrastination.pptx
 
Writing Better Emails.pptx
Writing Better Emails.pptxWriting Better Emails.pptx
Writing Better Emails.pptx
 
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 (SELECTION).pptx
Relational Operators (SELECTION).pptxRelational Operators (SELECTION).pptx
Relational Operators (SELECTION).pptx
 

Recently uploaded

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

Relational Operators 2.pptx

  • 2. 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 ??? 3
  • 4.  SELECT DISTINCT R.sid, R.bid FROM Reserves R ) ( ,..., , 2 1 R m attr attr attr  Reserves bid sid,  4
  • 5.  M:= # of pages of R  T:= M*F  Scan and Project (in Temp) ◦ O(M)+O(T)  Sort (Temp) ◦ O (TlogT)  2-Way Sort  Scan (Temp) and Eliminate Duplicates ◦ O(T) h TupleLengt attr of Size F m i i / ) ( _ 1     5
  • 6.  sid+bid = 10 bytes  Buffer Pages = 20  Scan and Project (in Temp) ◦ 1000+250 = 1250  Sort (Temp) ◦ Two passes  Pass 0 (⌈250/20⌉ = 13 runs)  Pass 1 (13 Way Merges) ◦ 2(2*250) = 1000  Scan (Temp) and Eliminate Duplicates ◦ 250 Total I/Os: 1250 1000 250 2500 6
  • 7.  Buffer Pages = B  Pass 0 ◦ Project Out Unwanted Attributes ◦ Read B Pages Write run of B*F Pages  Runs of 2B pages with aggressive implementation  Subsequent Passes ◦ Eliminate Duplicates while Merging h TupleLengt attr of Size F m i i / ) ( _ 1     7
  • 8. ◦ sid+bid = 10 bytes ◦ Buffer Pages = 20  Pass 0 ◦ 1000+250 = 1250 ◦ 50 Reads of 20 Pages each ◦ 50 Writes of 5 Pages each  Pass 1 ◦ 250*2 = 500 ◦ 19-Way Merges with Duplicates Elimination ◦ Two runs of 19*5 pages, One run of 60 pages  Pass 2 ◦ 250*1 = 250 ◦ 3-Way Merge with Duplicates Elimination Total I/Os: 1250 500 250 2000 8
  • 9.  Using Aggressive Implementation  Pass 0 ◦ 1000+250 = 1250 ◦ 6 runs of 40 pages each ◦ 1 run of 10 pages  Pass 1 ◦ 250*1 = 250 ◦ 7-Way Merge with Duplicates Elimination Total I/Os: 1250 250 1500 9
  • 10.  B (buffer pages) is typically large ◦ f:= fudge factor  2-Phase Process ◦ Phase 1  Partitioning  (After Projecting OUT Unwanted Attributes) ◦ Phase 2  Duplicates Elimination f T B .  10
  • 11.  One input buffer page  B −1 output buffer pages  For each tuple ◦ Project out the unwanted attributes ◦ Apply a hash function h to the combination of all remaining attributes  h is chosen so that tuples are distributed uniformly to one of B −1 partitions 11
  • 12. 12 At the end of the partitioning phase, we have B −1 partitions
  • 13.  X and Y are identical records only if ◦ hash(X) == hash(Y)  For each Partition (made in phase 1) ◦ Insert each Tuple into an in-memory Hash table  Using a different Hash function  Why different ??? ◦ Compare Colliding Tuples for Duplicates ◦ Discard Duplicates when Found 13
  • 14.  Phase 1: Partitioning ◦ Read M Pages ◦ Write T Pages  Phase 2: Duplicates Elimination ◦ Read T Pages  Total I/Os ◦ M+2T 14