SlideShare a Scribd company logo
1 of 9
Query Optimization
BY,
K.B.Snega,M.sc(cs),
Nadar Saraswathi College of Arts and Science.
Objectives Of Topic
• Introduction
• Steps of Query Processing
• Query Blocks
• Query Optimization Criteria
• Query Optimization Issues
• Advantages
Introduction
• Query:
A query is a request for information from a
database.
• Query Processing:
It is a translation of high-level queries into low
level expressions . It is a step wise process that
can be used at the physical level of the file
system.
Cont..
Query Optimization:
It is a process in which multiple query-execution
plans for satisfying a query are examined and
the most efficient query plan is identified
GOAL:
The goal of query optimization is to reduce the
system resources required to fulfill a query, and
ultimately provide the user with the correct
result set faster.
Query Block
• It is the basic unit of SQL that operates on tables
on the results of other queries by performing
join, grouping, projection, or selection
operations.
• The result of a query block is a table that is
known as a derived table.
Optimization Criteria
• Reduce total execution time of the query:
• Minimize the sum of the execution times of all
individual operations
• Reduce the number of disk access
• Reduce response time of the query:
• Maximize parallel operations.
Query Optimization Issues
• Query Rewriting:
• Transformation from one SQL query to another
one using semantic properties.
• Selecting query execution plan:
• Done on single query block.
• Cost estimation:
• To compare between plans we need to estimate
their cost using statistics on database.
Advantages
1. Faster processing of query
2. Lesser cost per query
3. High performance of the system
4. Lesser stress on database
5. Efficient usage of database engine
6. Lesser memory is consumed
Query optimization

More Related Content

Similar to Query optimization

Bb world 2012 using database statistics to make capacity planning decisions...
Bb world 2012   using database statistics to make capacity planning decisions...Bb world 2012   using database statistics to make capacity planning decisions...
Bb world 2012 using database statistics to make capacity planning decisions...Geoff Mower
 
DBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfDBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfChristalin Nelson
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureDAGEOP LTD
 
Query optimization
Query optimizationQuery optimization
Query optimizationPooja Dixit
 
Database Systems Design, Implementation, and Management
Database Systems Design, Implementation, and ManagementDatabase Systems Design, Implementation, and Management
Database Systems Design, Implementation, and ManagementOllieShoresna
 
Fusion 3 Overview Webinar
Fusion 3 Overview Webinar Fusion 3 Overview Webinar
Fusion 3 Overview Webinar Lucidworks
 
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxLECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxAthosBeatus
 
Why new hardware may not make SQL Server faster
Why new hardware may not make SQL Server fasterWhy new hardware may not make SQL Server faster
Why new hardware may not make SQL Server fasterSolarWinds
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewSachin Khosla
 
Database Development Lifecycle (DBMS DDLC)
Database Development Lifecycle (DBMS DDLC)Database Development Lifecycle (DBMS DDLC)
Database Development Lifecycle (DBMS DDLC)sankalpkumarsahoo174
 
Database management system (part 1)
Database management system (part 1)Database management system (part 1)
Database management system (part 1)KavithaA19
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database SystemMeghaj Mallick
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2Nickkisha Farrell
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxNurulIzrin
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingAbouzar Noori
 
Performing Oracle Health Checks Using APEX
Performing Oracle Health Checks Using APEXPerforming Oracle Health Checks Using APEX
Performing Oracle Health Checks Using APEXDatavail
 

Similar to Query optimization (20)

Bb world 2012 using database statistics to make capacity planning decisions...
Bb world 2012   using database statistics to make capacity planning decisions...Bb world 2012   using database statistics to make capacity planning decisions...
Bb world 2012 using database statistics to make capacity planning decisions...
 
DBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfDBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdf
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser Architecture
 
Query optimization
Query optimizationQuery optimization
Query optimization
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
Database Systems Design, Implementation, and Management
Database Systems Design, Implementation, and ManagementDatabase Systems Design, Implementation, and Management
Database Systems Design, Implementation, and Management
 
Fusion 3 Overview Webinar
Fusion 3 Overview Webinar Fusion 3 Overview Webinar
Fusion 3 Overview Webinar
 
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxLECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
 
dd presentation.pdf
dd presentation.pdfdd presentation.pdf
dd presentation.pdf
 
Why do Users kill HPC Jobs?
Why do Users kill HPC Jobs?Why do Users kill HPC Jobs?
Why do Users kill HPC Jobs?
 
Why new hardware may not make SQL Server faster
Why new hardware may not make SQL Server fasterWhy new hardware may not make SQL Server faster
Why new hardware may not make SQL Server faster
 
Building information systems
Building information systemsBuilding information systems
Building information systems
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of view
 
Database Development Lifecycle (DBMS DDLC)
Database Development Lifecycle (DBMS DDLC)Database Development Lifecycle (DBMS DDLC)
Database Development Lifecycle (DBMS DDLC)
 
Database management system (part 1)
Database management system (part 1)Database management system (part 1)
Database management system (part 1)
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and Profiling
 
Performing Oracle Health Checks Using APEX
Performing Oracle Health Checks Using APEXPerforming Oracle Health Checks Using APEX
Performing Oracle Health Checks Using APEX
 

More from snegacmr

Process improvement
Process improvementProcess improvement
Process improvementsnegacmr
 
Rest based xml web services
Rest based xml web servicesRest based xml web services
Rest based xml web servicessnegacmr
 
Business intelligence
Business intelligenceBusiness intelligence
Business intelligencesnegacmr
 
Basic concepts of parallelization
Basic concepts of parallelizationBasic concepts of parallelization
Basic concepts of parallelizationsnegacmr
 
Deepi rdbms
Deepi rdbmsDeepi rdbms
Deepi rdbmssnegacmr
 
Computer network
Computer networkComputer network
Computer networksnegacmr
 
Dm powerpoint
Dm powerpointDm powerpoint
Dm powerpointsnegacmr
 
Data mining
Data miningData mining
Data miningsnegacmr
 
Network security
Network securityNetwork security
Network securitysnegacmr
 
Discretization and concept hierarchy(os)
Discretization and concept hierarchy(os)Discretization and concept hierarchy(os)
Discretization and concept hierarchy(os)snegacmr
 
System components (os)
System components (os)System components (os)
System components (os)snegacmr
 

More from snegacmr (14)

Process improvement
Process improvementProcess improvement
Process improvement
 
Rest based xml web services
Rest based xml web servicesRest based xml web services
Rest based xml web services
 
Business intelligence
Business intelligenceBusiness intelligence
Business intelligence
 
Basic concepts of parallelization
Basic concepts of parallelizationBasic concepts of parallelization
Basic concepts of parallelization
 
Deepi rdbms
Deepi rdbmsDeepi rdbms
Deepi rdbms
 
Computer network
Computer networkComputer network
Computer network
 
Os
OsOs
Os
 
Dm powerpoint
Dm powerpointDm powerpoint
Dm powerpoint
 
Sql
SqlSql
Sql
 
Data mining
Data miningData mining
Data mining
 
Cn
CnCn
Cn
 
Network security
Network securityNetwork security
Network security
 
Discretization and concept hierarchy(os)
Discretization and concept hierarchy(os)Discretization and concept hierarchy(os)
Discretization and concept hierarchy(os)
 
System components (os)
System components (os)System components (os)
System components (os)
 

Recently uploaded

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesChandrakantDivate1
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptAfnanAhmad53
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...ronahami
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...vershagrag
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 

Recently uploaded (20)

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 

Query optimization

  • 2. Objectives Of Topic • Introduction • Steps of Query Processing • Query Blocks • Query Optimization Criteria • Query Optimization Issues • Advantages
  • 3. Introduction • Query: A query is a request for information from a database. • Query Processing: It is a translation of high-level queries into low level expressions . It is a step wise process that can be used at the physical level of the file system.
  • 4. Cont.. Query Optimization: It is a process in which multiple query-execution plans for satisfying a query are examined and the most efficient query plan is identified GOAL: The goal of query optimization is to reduce the system resources required to fulfill a query, and ultimately provide the user with the correct result set faster.
  • 5. Query Block • It is the basic unit of SQL that operates on tables on the results of other queries by performing join, grouping, projection, or selection operations. • The result of a query block is a table that is known as a derived table.
  • 6. Optimization Criteria • Reduce total execution time of the query: • Minimize the sum of the execution times of all individual operations • Reduce the number of disk access • Reduce response time of the query: • Maximize parallel operations.
  • 7. Query Optimization Issues • Query Rewriting: • Transformation from one SQL query to another one using semantic properties. • Selecting query execution plan: • Done on single query block. • Cost estimation: • To compare between plans we need to estimate their cost using statistics on database.
  • 8. Advantages 1. Faster processing of query 2. Lesser cost per query 3. High performance of the system 4. Lesser stress on database 5. Efficient usage of database engine 6. Lesser memory is consumed