尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
Department of Information Technology 1Data base Technologies (ITB4201)
Query Processing
Dr. C.V. Suresh Babu
Professor
Department of IT
Hindustan Institute of Science & Technology
Department of Information Technology 2Data base Technologies (ITB4201)
Action Plan
• Introduction to Query Processing
• Need for Query processing
• Architecture of Query Processing
• Query Processing Steps
• Phases in a typical query processing
• Represented in relational structures
• Translating SQL Queries into Relational Algebra
• Query Optimization
• Importance of Query Optimization
• Actions of Query Optimization
• Quiz
Department of Information Technology 3Data base Technologies (ITB4201)
Introduction to Query Processing
• Query Processing is a translation of high-level queries into low-level expression.
• It is a step wise process that can be used at the physical level of the file system,
query optimization and actual execution of the query to get the result.
• It requires the basic concepts of relational algebra and file structure.
• It refers to the range of activities that are involved in extracting data from the
database.
• It includes translation of queries in high-level database languages into
expressions that can be implemented at the physical level of the file system.
• In query processing, we will actually understand how these queries are
processed and how they are optimized.
Department of Information Technology 4Data base Technologies (ITB4201)
Need for Query processing
• Is to transform a query in a high level declarative language (such as SQL) into a
correct and efficient execution strategy. It includes query decomposition
(analysis, conjunctive and disjunctive normalization and semantic analysis),
query optimization and query evaluation (execution).
• Query processing refers to the process to answer a query to a database or an
information system, which usually involves interpreting the query, searching
through the space storing data, and retrieving the results satisfying the query.
• Extracting information from a large amount of data without actually changing
the underlying database where the data are organized.
• The process of how queries are processed and optimized within the database
management system. It consists of a series of steps that take the query as input
and produce its result as output
4
Department of Information Technology 5Data base Technologies (ITB4201)
Architecture of Query Processing
• The first step is to transform the query into a
standard form.
• A query is translated into SQL and into a relational
algebraic expression. During this process, Parser
checks the syntax and verifies the relations and
the attributes which are used in the query.
• The second step is Query Optimizer. In this, it
transforms the query into equivalent expressions
that are more efficient to execute.
• The third step is Query evaluation. It executes the
above query execution plan and returns the
result.
Department of Information Technology 6Data base Technologies (ITB4201)
Query Processing Steps
6
It is the step by step process of breaking the high level language into low level language which machine can understand
and perform the requested action for user. Query processor in the DBMS performs this task.
Department of Information Technology 7Data base Technologies (ITB4201)
Phases in a typical query processing
• Parsing and Translation
• Query Optimization
• Evaluation or query code generation
• Execution in DB’s runtime processor
7
Department of Information Technology 8Data base Technologies (ITB4201)
Represented in relational structures
∏ STD_ID, STD_NAME, ADDRESS, DOB (σ CLASS_NAME = ‘DESIGN_01’ (STUDENT ∞CLASS))
Or
σ CLASS_NAME = ‘DESIGN_01’ (∏ STD_ID, STD_NAME, ADDRESS, DOB (STUDENT ∞CLASS))
Department of Information Technology 9Data base Technologies (ITB4201)
Translating SQL Queries into Relational Algebra
• SELECT Ename FROM Employee WHERE Salary > 5000;
Translated into Relational Algebra Expression
σ Salary > 5000 (π Ename (Employee))
OR
π Ename (σ Salary > 5000 (Employee))
Department of Information Technology 10Data base Technologies (ITB4201)
• A sequence of primitive operations that can be
used to evaluate a query is a Query Execution
Plan or Query Evaluation Plan.
• The diagram indicates that the query execution
engine takes a query execution plan and returns
the answers to the query.
• Query Execution Plan minimizes the cost of
query evaluation
Translating SQL Queries into Relational Algebra
Department of Information Technology 11Data base Technologies (ITB4201)
Query Optimization
Department of Information Technology 12Data base Technologies (ITB4201)
Introduction to Query Optimization
• Query optimization is a difficult part of the query processing.
• It determines the efficient way to execute a query with different possible query plans.
• It cannot be accessed directly by users once the queries are submitted to the database
server or parsed by the parser.
• A query is passed to the query optimizer where optimization occurs.
• Main aim of Query Optimization is to minimize the cost function,
I/O Cost + CPU Cost + Communication Cost
• It defines how an RDBMS can improve the performance of the query by re-ordering the
operations.
• It is the process of selecting the most efficient query evaluation plan from among various
strategies if the query is complex.
• It computes the same result as per the given expression, but it is a least costly way of
generating result.
12
Department of Information Technology 13Data base Technologies (ITB4201)
Importance of Query Optimization
• Query optimization provides faster query processing.
• It requires less cost per query.
• It gives less stress to the database.
• It provides high performance of the system.
• It consumes less memory.
Department of Information Technology 14Data base Technologies (ITB4201)
Some Actions of Query Optimization
• Reordering joins.
• Changing the positions of projects and selects.
• Changing the access structures used to read data.
Department of Information Technology 15Data base Technologies (ITB4201)
Test Yourself
1. Which is one of the major important components of the relational database:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
2. Which in the database which is a software component in the RDBMS that carries out analysis of SQL statement for finding the best
way for its execution:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
3. Which can be defined as the method in which the selected plan is executed at the query optimization stages:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
4. Which refers to technique of maintaining, managing and manipulating data store within the computer system by using SQL queries:
a. Query execution
b. Query processing
c. Query optimizer
d. Query transaction
5. Which is the method of processing the plan selected throughout query optimization:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
Department of Information Technology 16Data base Technologies (ITB4201)
Answers
1. Which is one of the major important components of the relational database:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
2. Which in the database which is a software component in the RDBMS that carries out analysis of SQL statement for finding the best
way for its execution:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
3. Which can be defined as the method in which the selected plan is executed at the query optimization stages:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction
4. Which refers to technique of maintaining, managing and manipulating data store within the computer system by using SQL queries:
a. Query execution
b. Query processing
c. Query optimizer
d. Query transaction
5. Which is the method of processing the plan selected throughout query optimization:
a. Query execution
b. Query process
c. Query optimizer
d. Query transaction

More Related Content

What's hot

Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
Mythili Kannan
 
SQL Views
SQL ViewsSQL Views
Parallel Database
Parallel DatabaseParallel Database
Parallel Database
VESIT/University of Mumbai
 
Characteristic of dabase approach
Characteristic of dabase approachCharacteristic of dabase approach
Characteristic of dabase approach
Luina Pani
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Meghaj Mallick
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
Ali Usman
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
Gyanmanjari Institute Of Technology
 
DDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed QueriesDDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed Queries
Khushali Kathiriya
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
myrajendra
 
Database users
Database usersDatabase users
Database users
Param Radadiya
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
Meghaj Mallick
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
Aprajita (Abbey) Singh
 
Normalization in databases
Normalization in databasesNormalization in databases
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
pusp220
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
Damian T. Gordon
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
Kevin Jadiya
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
swapnac12
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
Bhargav Amin
 
Database language
Database languageDatabase language
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
Bushra M
 

What's hot (20)

Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Parallel Database
Parallel DatabaseParallel Database
Parallel Database
 
Characteristic of dabase approach
Characteristic of dabase approachCharacteristic of dabase approach
Characteristic of dabase approach
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
 
DDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed QueriesDDBMS_ Chap 7 Optimization of Distributed Queries
DDBMS_ Chap 7 Optimization of Distributed Queries
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
 
Database users
Database usersDatabase users
Database users
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Database language
Database languageDatabase language
Database language
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 

Similar to Query processing

dd presentation.pdf
dd presentation.pdfdd presentation.pdf
dd presentation.pdf
AnSHiKa187943
 
Mc seminar
Mc seminarMc seminar
Mc seminar
Ankit Anand
 
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxLECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
AthosBeatus
 
Enterprise resource planning_system
Enterprise resource planning_systemEnterprise resource planning_system
Enterprise resource planning_system
Jithin Zcs
 
Query optimization
Query optimizationQuery optimization
Query optimization
Pooja Dixit
 
Issues in Query Processing and Optimization
Issues in Query Processing and OptimizationIssues in Query Processing and Optimization
Issues in Query Processing and Optimization
Editor IJMTER
 
Process management seminar
Process management seminarProcess management seminar
Process management seminar
apurva_naik
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2
Nickkisha Farrell
 
rizwan cse exp resume
rizwan cse exp resumerizwan cse exp resume
rizwan cse exp resume
shaik rizwan
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
SE_Unit 3_System & Requirement Engineering.pdf
SE_Unit 3_System & Requirement Engineering.pdfSE_Unit 3_System & Requirement Engineering.pdf
SE_Unit 3_System & Requirement Engineering.pdf
RAVALCHIRAG1
 
Development Guideline
Development GuidelineDevelopment Guideline
Development Guideline
Mohammad Nasir Uddin
 
Query Evaluation Techniques for Large Databases.pdf
Query Evaluation Techniques for Large Databases.pdfQuery Evaluation Techniques for Large Databases.pdf
Query Evaluation Techniques for Large Databases.pdf
RayWill4
 
Analysis of economic data using big data
Analysis of economic data using big data Analysis of economic data using big data
Analysis of economic data using big data
Shivu Manjesh
 
Ch-2-Query-Process.pptx advanced database
Ch-2-Query-Process.pptx advanced databaseCh-2-Query-Process.pptx advanced database
Ch-2-Query-Process.pptx advanced database
tasheebedane
 
700442110-advanced database Ch-2-Query-Process.pptx
700442110-advanced database Ch-2-Query-Process.pptx700442110-advanced database Ch-2-Query-Process.pptx
700442110-advanced database Ch-2-Query-Process.pptx
tasheebedane
 
Development Lifecycle
Development LifecycleDevelopment Lifecycle
Development Lifecycle
FA20BCS061GHANAKAMAL
 
Improving Reporting Performance
Improving Reporting PerformanceImproving Reporting Performance
Improving Reporting Performance
Dhiren Gala
 
Apsec 2014 Presentation
Apsec 2014 PresentationApsec 2014 Presentation
Apsec 2014 Presentation
Ahrim Han, Ph.D.
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
shindhe1098cv
 

Similar to Query processing (20)

dd presentation.pdf
dd presentation.pdfdd presentation.pdf
dd presentation.pdf
 
Mc seminar
Mc seminarMc seminar
Mc seminar
 
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxLECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
 
Enterprise resource planning_system
Enterprise resource planning_systemEnterprise resource planning_system
Enterprise resource planning_system
 
Query optimization
Query optimizationQuery optimization
Query optimization
 
Issues in Query Processing and Optimization
Issues in Query Processing and OptimizationIssues in Query Processing and Optimization
Issues in Query Processing and Optimization
 
Process management seminar
Process management seminarProcess management seminar
Process management seminar
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2
 
rizwan cse exp resume
rizwan cse exp resumerizwan cse exp resume
rizwan cse exp resume
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
SE_Unit 3_System & Requirement Engineering.pdf
SE_Unit 3_System & Requirement Engineering.pdfSE_Unit 3_System & Requirement Engineering.pdf
SE_Unit 3_System & Requirement Engineering.pdf
 
Development Guideline
Development GuidelineDevelopment Guideline
Development Guideline
 
Query Evaluation Techniques for Large Databases.pdf
Query Evaluation Techniques for Large Databases.pdfQuery Evaluation Techniques for Large Databases.pdf
Query Evaluation Techniques for Large Databases.pdf
 
Analysis of economic data using big data
Analysis of economic data using big data Analysis of economic data using big data
Analysis of economic data using big data
 
Ch-2-Query-Process.pptx advanced database
Ch-2-Query-Process.pptx advanced databaseCh-2-Query-Process.pptx advanced database
Ch-2-Query-Process.pptx advanced database
 
700442110-advanced database Ch-2-Query-Process.pptx
700442110-advanced database Ch-2-Query-Process.pptx700442110-advanced database Ch-2-Query-Process.pptx
700442110-advanced database Ch-2-Query-Process.pptx
 
Development Lifecycle
Development LifecycleDevelopment Lifecycle
Development Lifecycle
 
Improving Reporting Performance
Improving Reporting PerformanceImproving Reporting Performance
Improving Reporting Performance
 
Apsec 2014 Presentation
Apsec 2014 PresentationApsec 2014 Presentation
Apsec 2014 Presentation
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
 

More from Dr. C.V. Suresh Babu

Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
Dr. C.V. Suresh Babu
 
Association rules
Association rulesAssociation rules
Association rules
Dr. C.V. Suresh Babu
 
Clustering
ClusteringClustering
Classification
ClassificationClassification
Classification
Dr. C.V. Suresh Babu
 
Blue property assumptions.
Blue property assumptions.Blue property assumptions.
Blue property assumptions.
Dr. C.V. Suresh Babu
 
Introduction to regression
Introduction to regressionIntroduction to regression
Introduction to regression
Dr. C.V. Suresh Babu
 
DART
DARTDART
Mycin
MycinMycin
Expert systems
Expert systemsExpert systems
Expert systems
Dr. C.V. Suresh Babu
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
Dr. C.V. Suresh Babu
 
Bayes network
Bayes networkBayes network
Bayes network
Dr. C.V. Suresh Babu
 
Bayes' theorem
Bayes' theoremBayes' theorem
Bayes' theorem
Dr. C.V. Suresh Babu
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
Dr. C.V. Suresh Babu
 
Rule based system
Rule based systemRule based system
Rule based system
Dr. C.V. Suresh Babu
 
Formal Logic in AI
Formal Logic in AIFormal Logic in AI
Formal Logic in AI
Dr. C.V. Suresh Babu
 
Production based system
Production based systemProduction based system
Production based system
Dr. C.V. Suresh Babu
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
Dr. C.V. Suresh Babu
 
Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AI
Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 

More from Dr. C.V. Suresh Babu (20)

Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
Association rules
Association rulesAssociation rules
Association rules
 
Clustering
ClusteringClustering
Clustering
 
Classification
ClassificationClassification
Classification
 
Blue property assumptions.
Blue property assumptions.Blue property assumptions.
Blue property assumptions.
 
Introduction to regression
Introduction to regressionIntroduction to regression
Introduction to regression
 
DART
DARTDART
DART
 
Mycin
MycinMycin
Mycin
 
Expert systems
Expert systemsExpert systems
Expert systems
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Bayes network
Bayes networkBayes network
Bayes network
 
Bayes' theorem
Bayes' theoremBayes' theorem
Bayes' theorem
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
Rule based system
Rule based systemRule based system
Rule based system
 
Formal Logic in AI
Formal Logic in AIFormal Logic in AI
Formal Logic in AI
 
Production based system
Production based systemProduction based system
Production based system
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
 
Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AI
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 

Recently uploaded

220711130095 Tanu Pandey message currency, communication speed & control EPC ...
220711130095 Tanu Pandey message currency, communication speed & control EPC ...220711130095 Tanu Pandey message currency, communication speed & control EPC ...
220711130095 Tanu Pandey message currency, communication speed & control EPC ...
Kalna College
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
The Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptxThe Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptx
PriyaKumari928991
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
EducationNC
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
khabri85
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
Forum of Blended Learning
 
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"
MJDuyan
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
Celine George
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
 
How to Create a Stage or a Pipeline in Odoo 17 CRM
How to Create a Stage or a Pipeline in Odoo 17 CRMHow to Create a Stage or a Pipeline in Odoo 17 CRM
How to Create a Stage or a Pipeline in Odoo 17 CRM
Celine George
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
Kalna College
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
Non-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech ProfessionalsNon-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech Professionals
MattVassar1
 
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
yarusun
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
Celine George
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 

Recently uploaded (20)

220711130095 Tanu Pandey message currency, communication speed & control EPC ...
220711130095 Tanu Pandey message currency, communication speed & control EPC ...220711130095 Tanu Pandey message currency, communication speed & control EPC ...
220711130095 Tanu Pandey message currency, communication speed & control EPC ...
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
The Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptxThe Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptx
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
 
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
 
(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
 
How to Create a Stage or a Pipeline in Odoo 17 CRM
How to Create a Stage or a Pipeline in Odoo 17 CRMHow to Create a Stage or a Pipeline in Odoo 17 CRM
How to Create a Stage or a Pipeline in Odoo 17 CRM
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
Non-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech ProfessionalsNon-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech Professionals
 
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 

Query processing

  • 1. Department of Information Technology 1Data base Technologies (ITB4201) Query Processing Dr. C.V. Suresh Babu Professor Department of IT Hindustan Institute of Science & Technology
  • 2. Department of Information Technology 2Data base Technologies (ITB4201) Action Plan • Introduction to Query Processing • Need for Query processing • Architecture of Query Processing • Query Processing Steps • Phases in a typical query processing • Represented in relational structures • Translating SQL Queries into Relational Algebra • Query Optimization • Importance of Query Optimization • Actions of Query Optimization • Quiz
  • 3. Department of Information Technology 3Data base Technologies (ITB4201) Introduction to Query Processing • Query Processing is a translation of high-level queries into low-level expression. • It is a step wise process that can be used at the physical level of the file system, query optimization and actual execution of the query to get the result. • It requires the basic concepts of relational algebra and file structure. • It refers to the range of activities that are involved in extracting data from the database. • It includes translation of queries in high-level database languages into expressions that can be implemented at the physical level of the file system. • In query processing, we will actually understand how these queries are processed and how they are optimized.
  • 4. Department of Information Technology 4Data base Technologies (ITB4201) Need for Query processing • Is to transform a query in a high level declarative language (such as SQL) into a correct and efficient execution strategy. It includes query decomposition (analysis, conjunctive and disjunctive normalization and semantic analysis), query optimization and query evaluation (execution). • Query processing refers to the process to answer a query to a database or an information system, which usually involves interpreting the query, searching through the space storing data, and retrieving the results satisfying the query. • Extracting information from a large amount of data without actually changing the underlying database where the data are organized. • The process of how queries are processed and optimized within the database management system. It consists of a series of steps that take the query as input and produce its result as output 4
  • 5. Department of Information Technology 5Data base Technologies (ITB4201) Architecture of Query Processing • The first step is to transform the query into a standard form. • A query is translated into SQL and into a relational algebraic expression. During this process, Parser checks the syntax and verifies the relations and the attributes which are used in the query. • The second step is Query Optimizer. In this, it transforms the query into equivalent expressions that are more efficient to execute. • The third step is Query evaluation. It executes the above query execution plan and returns the result.
  • 6. Department of Information Technology 6Data base Technologies (ITB4201) Query Processing Steps 6 It is the step by step process of breaking the high level language into low level language which machine can understand and perform the requested action for user. Query processor in the DBMS performs this task.
  • 7. Department of Information Technology 7Data base Technologies (ITB4201) Phases in a typical query processing • Parsing and Translation • Query Optimization • Evaluation or query code generation • Execution in DB’s runtime processor 7
  • 8. Department of Information Technology 8Data base Technologies (ITB4201) Represented in relational structures ∏ STD_ID, STD_NAME, ADDRESS, DOB (σ CLASS_NAME = ‘DESIGN_01’ (STUDENT ∞CLASS)) Or σ CLASS_NAME = ‘DESIGN_01’ (∏ STD_ID, STD_NAME, ADDRESS, DOB (STUDENT ∞CLASS))
  • 9. Department of Information Technology 9Data base Technologies (ITB4201) Translating SQL Queries into Relational Algebra • SELECT Ename FROM Employee WHERE Salary > 5000; Translated into Relational Algebra Expression σ Salary > 5000 (π Ename (Employee)) OR π Ename (σ Salary > 5000 (Employee))
  • 10. Department of Information Technology 10Data base Technologies (ITB4201) • A sequence of primitive operations that can be used to evaluate a query is a Query Execution Plan or Query Evaluation Plan. • The diagram indicates that the query execution engine takes a query execution plan and returns the answers to the query. • Query Execution Plan minimizes the cost of query evaluation Translating SQL Queries into Relational Algebra
  • 11. Department of Information Technology 11Data base Technologies (ITB4201) Query Optimization
  • 12. Department of Information Technology 12Data base Technologies (ITB4201) Introduction to Query Optimization • Query optimization is a difficult part of the query processing. • It determines the efficient way to execute a query with different possible query plans. • It cannot be accessed directly by users once the queries are submitted to the database server or parsed by the parser. • A query is passed to the query optimizer where optimization occurs. • Main aim of Query Optimization is to minimize the cost function, I/O Cost + CPU Cost + Communication Cost • It defines how an RDBMS can improve the performance of the query by re-ordering the operations. • It is the process of selecting the most efficient query evaluation plan from among various strategies if the query is complex. • It computes the same result as per the given expression, but it is a least costly way of generating result. 12
  • 13. Department of Information Technology 13Data base Technologies (ITB4201) Importance of Query Optimization • Query optimization provides faster query processing. • It requires less cost per query. • It gives less stress to the database. • It provides high performance of the system. • It consumes less memory.
  • 14. Department of Information Technology 14Data base Technologies (ITB4201) Some Actions of Query Optimization • Reordering joins. • Changing the positions of projects and selects. • Changing the access structures used to read data.
  • 15. Department of Information Technology 15Data base Technologies (ITB4201) Test Yourself 1. Which is one of the major important components of the relational database: a. Query execution b. Query process c. Query optimizer d. Query transaction 2. Which in the database which is a software component in the RDBMS that carries out analysis of SQL statement for finding the best way for its execution: a. Query execution b. Query process c. Query optimizer d. Query transaction 3. Which can be defined as the method in which the selected plan is executed at the query optimization stages: a. Query execution b. Query process c. Query optimizer d. Query transaction 4. Which refers to technique of maintaining, managing and manipulating data store within the computer system by using SQL queries: a. Query execution b. Query processing c. Query optimizer d. Query transaction 5. Which is the method of processing the plan selected throughout query optimization: a. Query execution b. Query process c. Query optimizer d. Query transaction
  • 16. Department of Information Technology 16Data base Technologies (ITB4201) Answers 1. Which is one of the major important components of the relational database: a. Query execution b. Query process c. Query optimizer d. Query transaction 2. Which in the database which is a software component in the RDBMS that carries out analysis of SQL statement for finding the best way for its execution: a. Query execution b. Query process c. Query optimizer d. Query transaction 3. Which can be defined as the method in which the selected plan is executed at the query optimization stages: a. Query execution b. Query process c. Query optimizer d. Query transaction 4. Which refers to technique of maintaining, managing and manipulating data store within the computer system by using SQL queries: a. Query execution b. Query processing c. Query optimizer d. Query transaction 5. Which is the method of processing the plan selected throughout query optimization: a. Query execution b. Query process c. Query optimizer d. Query transaction
  翻译: