SlideShare a Scribd company logo
1 of 16
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

Target language in compiler design
Target language in compiler designTarget language in compiler design
Target language in compiler designMuhammad Haroon
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on SegmentationPriyanka bisht
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architecturesPooja Dixit
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mountingrajshreemuthiah
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database SystemSulemang
 
Data Integration and Transformation in Data mining
Data Integration and Transformation in Data miningData Integration and Transformation in Data mining
Data Integration and Transformation in Data miningkavitha muneeshwaran
 

What's hot (20)

Client Server Architecture ppt
Client Server Architecture pptClient Server Architecture ppt
Client Server Architecture ppt
 
Target language in compiler design
Target language in compiler designTarget language in compiler design
Target language in compiler design
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 
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
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
 
Heap Management
Heap ManagementHeap Management
Heap Management
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mounting
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
Query processing
Query processingQuery processing
Query processing
 
Memory management
Memory managementMemory management
Memory management
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database System
 
Data Integration and Transformation in Data mining
Data Integration and Transformation in Data miningData Integration and Transformation in Data mining
Data Integration and Transformation in Data mining
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
DDBMS Paper with Solution
DDBMS Paper with SolutionDDBMS Paper with Solution
DDBMS Paper with Solution
 

Similar to IT department document on query processing

LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxLECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptxAthosBeatus
 
Enterprise resource planning_system
Enterprise resource planning_systemEnterprise resource planning_system
Enterprise resource planning_systemJithin Zcs
 
Query optimization
Query optimizationQuery optimization
Query optimizationPooja Dixit
 
Issues in Query Processing and Optimization
Issues in Query Processing and OptimizationIssues in Query Processing and Optimization
Issues in Query Processing and OptimizationEditor IJMTER
 
Process management seminar
Process management seminarProcess management seminar
Process management seminarapurva_naik
 
Database Management Systems 2
Database Management Systems 2Database Management Systems 2
Database Management Systems 2Nickkisha Farrell
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database SystemMeghaj Mallick
 
rizwan cse exp resume
rizwan cse exp resumerizwan cse exp resume
rizwan cse exp resumeshaik 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/12cRonald 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.pdfRAVALCHIRAG1
 
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.pdfRayWill4
 
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
 
Improving Reporting Performance
Improving Reporting PerformanceImproving Reporting Performance
Improving Reporting PerformanceDhiren Gala
 
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 baseshindhe1098cv
 
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
 

Similar to IT department document on 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
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
 
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
 
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
 
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
 

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

Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 

Recently uploaded (20)

Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 

IT department document on 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