SlideShare uma empresa Scribd logo
1 de 10
 Query Optimization
 Why Query Optimization?
 Join Size Estimation?
 Estimation of Number of Distinct Values.
 Query optimization is the process of selecting
the most efficient query-evaluation plan from
among the many strategies usually possible
for processing a given query, especially if the
query is complex.
 In simple scenes the query optimizer come
up with query-evaluation plan that computes
the same result as a given expression, but it
is a least costly way of generating result.
 Faster processing of a query.
 Lesser cost per query.
 High performance of the system.
 Lesser stress on the database.
 Efficient use of database engine.
 Lesser memory is consumed.
 Catalog information:-
 nr : number of tuples in a relation r.
 br : number of blocks containing tuples of r.
 sr : size of a tuple of r.
 fr : blocking factor of r — i.e., the number of tuples of r that fit into one block.
 V(A, r): number of distinct values that appear in r for attribute A; same as the size
of A(r).
 SC(A, r): selection cardinality of attribute A of relation r; average number of
records that satisfy equality on A.
 If tuples of r are stored together physically in a file, then:











rf
rn
rb
 The Cartesian product r x s contains nr .ns tuples; each
tuple occupies sr + ss bytes.
 If R  S = , then r s is the same as r x s. i.e. the
relation has no attributes in common.
 If R  S is a key for R, then a tuple of s will join with at
most one tuple from r
◦ therefore, the number of tuples in r s is no greater than the
number of tuples in s.
 If R  S forms a foreign key in S referencing R, then the
number of tuples in r s is exactly the same as the
number of tuples in s.
 In the example query depositor customer, customer-
name in depositor is a foreign key of customer
◦ hence, the result has exactly ndepositor tuples, which is 5000
 If R  S = {A} is not a key for R or S.
If we assume that every tuple t in R produces
tuples in R S, the number of tuples in R S is
estimated to be:
If the reverse is true, the estimate obtained will
be:
The lower of these two estimates is probably the
more accurate one.
),( sAV
nn sr 
),( rAV
nn sr 
Selections:  (r)
 If  forces A to take a specified value: V(A, (r)) = 1.
 e.g., A = 3
 If  forces A to take on one of a specified set of
values:
V(A, (r)) = number of specified values.
 (e.g., (A = 1 V A = 3 V A = 4 )),
 If the selection condition  is of the form A op r
estimated V(A, (r)) = V(A.r) * s
 where s is the selectivity of the selection.
 In all the other cases: use approximate estimate of
min(V(A,r), n (r) )
◦ More accurate estimate can be got using probability theory,
but this one works fine generally
Joins: r s
 If all attributes in A are from r
estimated V(A, r s) = min (V(A,r), n r s)
 If A contains attributes A1 from r and A2
from s, then estimated V(A, r s) =
min(V(A1,r)*V(A2 – A1,s), V(A1 –
A2,r)*V(A2,s), nr s)
◦ More accurate estimate can be got using
probability theory, but this one works fine generally
THANKYOU…!!!

Mais conteúdo relacionado

Mais procurados

SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query OptimizationBrian Gallagher
 
Query optimization
Query optimizationQuery optimization
Query optimizationPooja Dixit
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management SystemHardik Patil
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Jotham Gadot
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architecturesPooja Dixit
 
Query processing and Query Optimization
Query processing and Query OptimizationQuery processing and Query Optimization
Query processing and Query OptimizationNiraj Gandha
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Gyanmanjari Institute Of Technology
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Garbage Collection
Garbage CollectionGarbage Collection
Garbage CollectionEelco Visser
 
Introduction to Map Reduce
Introduction to Map ReduceIntroduction to Map Reduce
Introduction to Map ReduceApache Apex
 
Ppt of dbms e r features
Ppt of dbms e r featuresPpt of dbms e r features
Ppt of dbms e r featuresNirali Akabari
 
Data base management systems ppt
Data base management systems pptData base management systems ppt
Data base management systems pptsuthi
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and propertiesChetan Mahawar
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimizationKumar
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Usman Tariq
 

Mais procurados (20)

SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query Optimization
 
Query optimization
Query optimizationQuery optimization
Query optimization
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
 
Query processing and Query Optimization
Query processing and Query OptimizationQuery processing and Query Optimization
Query processing and Query Optimization
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Garbage Collection
Garbage CollectionGarbage Collection
Garbage Collection
 
Introduction to Map Reduce
Introduction to Map ReduceIntroduction to Map Reduce
Introduction to Map Reduce
 
Ppt of dbms e r features
Ppt of dbms e r featuresPpt of dbms e r features
Ppt of dbms e r features
 
joins in database
 joins in database joins in database
joins in database
 
Data base management systems ppt
Data base management systems pptData base management systems ppt
Data base management systems ppt
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimization
 
Relational databases
Relational databasesRelational databases
Relational databases
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
 

Destaque

Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimizationWBUTTUTORIALS
 
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...Beat Signer
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query OptimizationAli Usman
 
Quarry Optimization Module
Quarry Optimization ModuleQuarry Optimization Module
Quarry Optimization Moduledeeptec
 
CEMEX_SeniorDesignPosterUpdate4.21.3.pptx
CEMEX_SeniorDesignPosterUpdate4.21.3.pptxCEMEX_SeniorDesignPosterUpdate4.21.3.pptx
CEMEX_SeniorDesignPosterUpdate4.21.3.pptxArda Onkol
 
Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...
Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...
Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...Venance Kitaly
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluationavniS
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query ProcessingMythili Kannan
 
Data warehouse architecture
Data warehouse architectureData warehouse architecture
Data warehouse architecturepcherukumalla
 
Introduction to Data Warehousing
Introduction to Data WarehousingIntroduction to Data Warehousing
Introduction to Data WarehousingJason S
 
Components of a Data-Warehouse
Components of a Data-WarehouseComponents of a Data-Warehouse
Components of a Data-WarehouseAbdul Aslam
 
Data Warehousing and Data Mining
Data Warehousing and Data MiningData Warehousing and Data Mining
Data Warehousing and Data Miningidnats
 

Destaque (16)

Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
Query Processing and Optimisation - Lecture 10 - Introduction to Databases (1...
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
Quarry Optimization Module
Quarry Optimization ModuleQuarry Optimization Module
Quarry Optimization Module
 
CEMEX_SeniorDesignPosterUpdate4.21.3.pptx
CEMEX_SeniorDesignPosterUpdate4.21.3.pptxCEMEX_SeniorDesignPosterUpdate4.21.3.pptx
CEMEX_SeniorDesignPosterUpdate4.21.3.pptx
 
Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...
Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...
Kitaly Venance D. - Blast Design Optimization to Improve Material Fragmentati...
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
 
Query processing
Query processingQuery processing
Query processing
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
Data Warehouse 101
Data Warehouse 101Data Warehouse 101
Data Warehouse 101
 
DATA WAREHOUSING
DATA WAREHOUSINGDATA WAREHOUSING
DATA WAREHOUSING
 
Data warehouse architecture
Data warehouse architectureData warehouse architecture
Data warehouse architecture
 
Introduction to Data Warehousing
Introduction to Data WarehousingIntroduction to Data Warehousing
Introduction to Data Warehousing
 
Components of a Data-Warehouse
Components of a Data-WarehouseComponents of a Data-Warehouse
Components of a Data-Warehouse
 
Data Warehousing and Data Mining
Data Warehousing and Data MiningData Warehousing and Data Mining
Data Warehousing and Data Mining
 

Semelhante a Query Optimization

2 data structure in R
2 data structure in R2 data structure in R
2 data structure in Rnaroranisha
 
MODULE 5- EDA.pptx
MODULE 5- EDA.pptxMODULE 5- EDA.pptx
MODULE 5- EDA.pptxnikshaikh786
 
Multinomial Model Simulations
Multinomial Model SimulationsMultinomial Model Simulations
Multinomial Model Simulationstim_hare
 
relational model.pptx
relational model.pptxrelational model.pptx
relational model.pptxThangamaniR3
 
Module 3 - Regular Expressions, Dictionaries.pdf
Module 3 - Regular  Expressions,  Dictionaries.pdfModule 3 - Regular  Expressions,  Dictionaries.pdf
Module 3 - Regular Expressions, Dictionaries.pdfGaneshRaghu4
 
relational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptrelational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptRoshni814224
 
Relational algebra operations
Relational algebra operationsRelational algebra operations
Relational algebra operationsSanthiNivas
 
Data Representation of Strings
Data Representation of StringsData Representation of Strings
Data Representation of StringsProf Ansari
 
4. SQL in DBMS
4. SQL in DBMS4. SQL in DBMS
4. SQL in DBMSkoolkampus
 
Relation model part 1
Relation model part 1Relation model part 1
Relation model part 1Siti Ismail
 
Query optimization in database
Query optimization in databaseQuery optimization in database
Query optimization in databaseRakesh Kumar
 

Semelhante a Query Optimization (20)

Ch14
Ch14Ch14
Ch14
 
1. linear model, inference, prediction
1. linear model, inference, prediction1. linear model, inference, prediction
1. linear model, inference, prediction
 
2 data structure in R
2 data structure in R2 data structure in R
2 data structure in R
 
relational algebra
relational algebrarelational algebra
relational algebra
 
MODULE 5- EDA.pptx
MODULE 5- EDA.pptxMODULE 5- EDA.pptx
MODULE 5- EDA.pptx
 
Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)
 
Multinomial Model Simulations
Multinomial Model SimulationsMultinomial Model Simulations
Multinomial Model Simulations
 
relational model.pptx
relational model.pptxrelational model.pptx
relational model.pptx
 
Cis435 week03
Cis435 week03Cis435 week03
Cis435 week03
 
Module 3 - Regular Expressions, Dictionaries.pdf
Module 3 - Regular  Expressions,  Dictionaries.pdfModule 3 - Regular  Expressions,  Dictionaries.pdf
Module 3 - Regular Expressions, Dictionaries.pdf
 
Ch2
Ch2Ch2
Ch2
 
relational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptrelational model in Database Management.ppt.ppt
relational model in Database Management.ppt.ppt
 
Relational algebra operations
Relational algebra operationsRelational algebra operations
Relational algebra operations
 
Data Representation of Strings
Data Representation of StringsData Representation of Strings
Data Representation of Strings
 
4. SQL in DBMS
4. SQL in DBMS4. SQL in DBMS
4. SQL in DBMS
 
Eryk_Kulikowski_a3
Eryk_Kulikowski_a3Eryk_Kulikowski_a3
Eryk_Kulikowski_a3
 
Programming Exam Help
Programming Exam Help Programming Exam Help
Programming Exam Help
 
Relation model part 1
Relation model part 1Relation model part 1
Relation model part 1
 
Query optimization in database
Query optimization in databaseQuery optimization in database
Query optimization in database
 
Lllll
LllllLllll
Lllll
 

Último

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Último (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Query Optimization

  • 1.
  • 2.  Query Optimization  Why Query Optimization?  Join Size Estimation?  Estimation of Number of Distinct Values.
  • 3.  Query optimization is the process of selecting the most efficient query-evaluation plan from among the many strategies usually possible for processing a given query, especially if the query is complex.  In simple scenes the query optimizer come up with query-evaluation plan that computes the same result as a given expression, but it is a least costly way of generating result.
  • 4.  Faster processing of a query.  Lesser cost per query.  High performance of the system.  Lesser stress on the database.  Efficient use of database engine.  Lesser memory is consumed.
  • 5.  Catalog information:-  nr : number of tuples in a relation r.  br : number of blocks containing tuples of r.  sr : size of a tuple of r.  fr : blocking factor of r — i.e., the number of tuples of r that fit into one block.  V(A, r): number of distinct values that appear in r for attribute A; same as the size of A(r).  SC(A, r): selection cardinality of attribute A of relation r; average number of records that satisfy equality on A.  If tuples of r are stored together physically in a file, then:            rf rn rb
  • 6.  The Cartesian product r x s contains nr .ns tuples; each tuple occupies sr + ss bytes.  If R  S = , then r s is the same as r x s. i.e. the relation has no attributes in common.  If R  S is a key for R, then a tuple of s will join with at most one tuple from r ◦ therefore, the number of tuples in r s is no greater than the number of tuples in s.  If R  S forms a foreign key in S referencing R, then the number of tuples in r s is exactly the same as the number of tuples in s.  In the example query depositor customer, customer- name in depositor is a foreign key of customer ◦ hence, the result has exactly ndepositor tuples, which is 5000
  • 7.  If R  S = {A} is not a key for R or S. If we assume that every tuple t in R produces tuples in R S, the number of tuples in R S is estimated to be: If the reverse is true, the estimate obtained will be: The lower of these two estimates is probably the more accurate one. ),( sAV nn sr  ),( rAV nn sr 
  • 8. Selections:  (r)  If  forces A to take a specified value: V(A, (r)) = 1.  e.g., A = 3  If  forces A to take on one of a specified set of values: V(A, (r)) = number of specified values.  (e.g., (A = 1 V A = 3 V A = 4 )),  If the selection condition  is of the form A op r estimated V(A, (r)) = V(A.r) * s  where s is the selectivity of the selection.  In all the other cases: use approximate estimate of min(V(A,r), n (r) ) ◦ More accurate estimate can be got using probability theory, but this one works fine generally
  • 9. Joins: r s  If all attributes in A are from r estimated V(A, r s) = min (V(A,r), n r s)  If A contains attributes A1 from r and A2 from s, then estimated V(A, r s) = min(V(A1,r)*V(A2 – A1,s), V(A1 – A2,r)*V(A2,s), nr s) ◦ More accurate estimate can be got using probability theory, but this one works fine generally