SlideShare a Scribd company logo
1. Query Processing
2. Translating SQL queries into RA
3. Evaluation Plan

4. Query Execution
5. Query Optimization
6. Translation Rules
7. Cost Estimations
1. Query Processing
1. Query Processing
▪ Aim of query processing
- to find information in one or more databases,
- and deliver it to the user quickly and efficiently.
- to choose the most cost effective.
▪ Translation of queries
- into expressions that can be used at physical level of file system.
- Includes query optimization and query evaluation.
1. Query Processing
1. Query Processing
▪ Typical steps when processing a high-level query (e.g. SQL query)
Query tree
internal representation
of the query
Execution strategy
how to retrieve
results of query
2. Translating SQL queries into RA
2. Translating SQL queries into RA
▪ Translate query into its internal form.
- This is then translated into Relational Algebra(RA).
- The parser checks syntax, verifies relations.
▪ A RA expression may have many equivalent expressions.
▪ Example
Σbalance<2500(πbalance(account))
Is equivalent to
Πbalance(σbalance<2500(account))

Each relational algebra operation can be evaluated using one of
several different algorithms. Correspondingly, a relational-algebra
expression can be evaluated in many ways.
3. Evaluation Plan
3. Evaluation Plan
▪ Annotated expression specifying detailed evaluation strategy.
▪ Example
Use an index on balance to find accounts with balance < 2500,
Or perform complete relation scan and discard accounts with balance ≥ 2500.
Initial canonical query tree
Book (access#, title)
Member (ticket#, name)
Loan(loanedbook,loanedto)

Select member.name
rom book, loan, member
where book.title = "dracula"
and member.ticket# = loan.loanedto
and loan.loanedbook = book.access#
4. Query Execution
4. Query Execution
For each operation (join, select, project, aggregation …)
- Typical algorithms (e.g. Binary search for simple selection)
- Specific or not to storage structure and access paths
Book (access#, title)
Member (ticket#, name)
Loan(loanedbook,loanedto)

Select member.name
From book, loan, member
where book.title = "dracula"
and member.ticket# = loan.loanedto
and loan.loanedbook = book.access#
4. Query Execution
4. Query Execution

More Related Content

Similar to 1 query processing (20)

PPTX
Query processing and Query Optimization
Niraj Gandha
 
PPTX
Query processing and Query Optimization
Niraj Gandha
 
PPTX
Ch-2-Query-Process.pptx advanced database
tasheebedane
 
PPTX
700442110-advanced database Ch-2-Query-Process.pptx
tasheebedane
 
PPT
Query optimization and processing for advanced database systems
meharikiros2
 
PPTX
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
AthosBeatus
 
PPT
QPOfutyfurfugfuyttruft7rfu65rfuyt PPT - Copy.ppt
ahmed518927
 
PPT
ch02-240507064009-ac337bf1 .ppt
iamayesha2526
 
PDF
Chapter 2.pdf WND FWKJFW KSD;KFLWHFB ASNK
alemunuruhak9
 
PPTX
DB LECTURE 5 QUERY PROCESSING.pptx
grahamoyigo19
 
PPT
9-Query Processing-05-06-2023.PPT
venkatapranaykumarGa
 
PPTX
Mc seminar
Ankit Anand
 
PDF
itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
beshahashenafe20
 
PPTX
Query processing
Ravinder Kamboj
 
PPTX
Query processing and optimization on dbms
ar1289589
 
PPT
Query processing-and-optimization
WBUTTUTORIALS
 
PPTX
Chapter 4 - Query Processing and Optimization.pptx
ahmed518927
 
PPTX
Advanced Database System Chapter Two Query processing and Optimization.pptx
mentesnotsibatuuu
 
PDF
CH5_Query Processing and Optimization.pdf
amariyarana
 
PPTX
Computer Science DBMS_Presentations_Unit-5.pptx
rituah
 
Query processing and Query Optimization
Niraj Gandha
 
Query processing and Query Optimization
Niraj Gandha
 
Ch-2-Query-Process.pptx advanced database
tasheebedane
 
700442110-advanced database Ch-2-Query-Process.pptx
tasheebedane
 
Query optimization and processing for advanced database systems
meharikiros2
 
LECTURE_06_DATABASE PROCESSING & OPTIMAZATION.pptx
AthosBeatus
 
QPOfutyfurfugfuyttruft7rfu65rfuyt PPT - Copy.ppt
ahmed518927
 
ch02-240507064009-ac337bf1 .ppt
iamayesha2526
 
Chapter 2.pdf WND FWKJFW KSD;KFLWHFB ASNK
alemunuruhak9
 
DB LECTURE 5 QUERY PROCESSING.pptx
grahamoyigo19
 
9-Query Processing-05-06-2023.PPT
venkatapranaykumarGa
 
Mc seminar
Ankit Anand
 
itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
beshahashenafe20
 
Query processing
Ravinder Kamboj
 
Query processing and optimization on dbms
ar1289589
 
Query processing-and-optimization
WBUTTUTORIALS
 
Chapter 4 - Query Processing and Optimization.pptx
ahmed518927
 
Advanced Database System Chapter Two Query processing and Optimization.pptx
mentesnotsibatuuu
 
CH5_Query Processing and Optimization.pdf
amariyarana
 
Computer Science DBMS_Presentations_Unit-5.pptx
rituah
 

More from Mr Patrick NIYISHAKA (20)

PPTX
3 summary
Mr Patrick NIYISHAKA
 
PPTX
2 ddb architecture
Mr Patrick NIYISHAKA
 
PPTX
2 countermeasures
Mr Patrick NIYISHAKA
 
PPTX
2 countermeasures
Mr Patrick NIYISHAKA
 
PPTX
3 summary
Mr Patrick NIYISHAKA
 
PPTX
1 db security
Mr Patrick NIYISHAKA
 
PPTX
4 summary
Mr Patrick NIYISHAKA
 
PPTX
3 summary
Mr Patrick NIYISHAKA
 
PPTX
2 con control
Mr Patrick NIYISHAKA
 
PPTX
1 con exe
Mr Patrick NIYISHAKA
 
PPTX
1 basic concepts
Mr Patrick NIYISHAKA
 
PPTX
2 recovery
Mr Patrick NIYISHAKA
 
PPTX
3 transaction
Mr Patrick NIYISHAKA
 
PPTX
3 summary
Mr Patrick NIYISHAKA
 
PPTX
1 query processing
Mr Patrick NIYISHAKA
 
PPTX
2 optimization
Mr Patrick NIYISHAKA
 
PPTX
2 collision
Mr Patrick NIYISHAKA
 
PPTX
4 summary
Mr Patrick NIYISHAKA
 
2 ddb architecture
Mr Patrick NIYISHAKA
 
2 countermeasures
Mr Patrick NIYISHAKA
 
2 countermeasures
Mr Patrick NIYISHAKA
 
1 db security
Mr Patrick NIYISHAKA
 
2 con control
Mr Patrick NIYISHAKA
 
1 basic concepts
Mr Patrick NIYISHAKA
 
3 transaction
Mr Patrick NIYISHAKA
 
1 query processing
Mr Patrick NIYISHAKA
 
2 optimization
Mr Patrick NIYISHAKA
 
Ad

Recently uploaded (20)

PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Ad

1 query processing

  • 1. 1. Query Processing 2. Translating SQL queries into RA 3. Evaluation Plan 4. Query Execution 5. Query Optimization 6. Translation Rules 7. Cost Estimations
  • 2. 1. Query Processing 1. Query Processing ▪ Aim of query processing - to find information in one or more databases, - and deliver it to the user quickly and efficiently. - to choose the most cost effective. ▪ Translation of queries - into expressions that can be used at physical level of file system. - Includes query optimization and query evaluation.
  • 3. 1. Query Processing 1. Query Processing ▪ Typical steps when processing a high-level query (e.g. SQL query) Query tree internal representation of the query Execution strategy how to retrieve results of query
  • 4. 2. Translating SQL queries into RA 2. Translating SQL queries into RA ▪ Translate query into its internal form. - This is then translated into Relational Algebra(RA). - The parser checks syntax, verifies relations. ▪ A RA expression may have many equivalent expressions. ▪ Example Σbalance<2500(πbalance(account)) Is equivalent to Πbalance(σbalance<2500(account)) Each relational algebra operation can be evaluated using one of several different algorithms. Correspondingly, a relational-algebra expression can be evaluated in many ways.
  • 5. 3. Evaluation Plan 3. Evaluation Plan ▪ Annotated expression specifying detailed evaluation strategy. ▪ Example Use an index on balance to find accounts with balance < 2500, Or perform complete relation scan and discard accounts with balance ≥ 2500. Initial canonical query tree Book (access#, title) Member (ticket#, name) Loan(loanedbook,loanedto) Select member.name rom book, loan, member where book.title = "dracula" and member.ticket# = loan.loanedto and loan.loanedbook = book.access#
  • 6. 4. Query Execution 4. Query Execution For each operation (join, select, project, aggregation …) - Typical algorithms (e.g. Binary search for simple selection) - Specific or not to storage structure and access paths Book (access#, title) Member (ticket#, name) Loan(loanedbook,loanedto) Select member.name From book, loan, member where book.title = "dracula" and member.ticket# = loan.loanedto and loan.loanedbook = book.access#
  • 7. 4. Query Execution 4. Query Execution