SlideShare a Scribd company logo
SALMAN MEMON 2K12/IT/109
1
 Process of minimizing the resource usage.
 Aims of Query Decomposition
 To transform a high-level query into a Relational
Algebra query
&
 To check the query is syntactically and
semantically correct
 It is efficient way to retrieve data
from database.
2
select * from staff s, branch b
where s.branchNo=b.branchNo And
(s.position=‘Manager’ And b.city=‘London’);
 Three equivalent relational algebra queries
1. σ(position=‘Manager’)^(staff.branchNo=branc
h.branchNo)(staff x branch)
• Suppose staff have 1000 records and branch have 50 records
3
• This query calculates the Cartesian product of staff and branch,
(1000 + 50) disk accesses to read and creates relation with (1000*50)
tuples. We then have to read each of these tuples again to test them
against the selection predicate so it gives total cost of :
(1000+50)+2*(1000*50)=101050 disk access
2. σ(position=‘Manager’)^(city=‘London’)(staff∞staff.branchNo=bran
ch.branchNo branch)
Gives total cost of:
• 2*1000+(1000+50)=3050 disk accesses
3. (σposition=‘manager’(staff))∞staff.branchNo=branch.branchNo(σci
ty=‘London’(branch))
Gives total cost of:
• 1000+2*50+5+(50+5)=1160 disk accesses
4
1. Analysis
2. Normalization
3. Semantic Analysis
4. Simplification Or Redundancy eliminator
5. Query Restructuring
5
In this stage query is syntactically analyzed
 Verifies that the relations and attributes specified in
the query are defined in the system catalog
 Verifies that any operations applied to database
objects are appropriate for the object type
6
• SELECT staffNumber
FROM staff
where position >10;
This query would be rejected on two grounds
1. in SELECT list the attribute staffNumber is not defended for
staff relation(should be staffNo)
2. in WHERE clause comparison ’>10’ is incompatible with the
data type position, which is a variable character string
After completion this stage ,high level query has been transformed
internal representation that is some kind of query tree.
7
∞s.branchNo=b.branchNo Root
intermediate operations
σs.position=‘manager’ σb.city=‘london’
leaves
staff branch
• A leaf node is created for each base relation in query
• Each intermediate relation produced by a relational algebra operation
• The Root of the tree represents the result of the query
• The sequence of operation is directed from the leaves to the root
8
 It normalizes query for easy manipulation
 Arbitrarily complex predicate (in SQL, the WHERE
condition) can be converted into one of two forms by
applying few transformation rules:
1. Conjunctive Normal form:- A sequence of conjuncts that are
connected with the ^ (AND) operator. Each conjunct contains
one or more terms connected by the v (OR) operator
For Example :-
(position=‘manager’ v salary > 20000) ^ branchNo=‘B003’
A conjunctive selection contains only those tuples that satisfy all
conjuncts.
9
2. Disjunctive Normal form:- A sequence of disjuncts that
are connected with the v (OR) operator. Each disjunct
contains one or more terms connected by the ^ (AND)
operator
For Example : we can rewrite the above conjunctive
normal form into disjunctive
(position=‘manager’^ branchNo=‘B003’) v (salary >20000
^ branchNo=‘B003’)
A disjunctive selection contains those tuples formed by
the union of all tuples that satisfy the disjuncts
10
 It reject normalized queries that are incorrectly formulated or
contradictory.
 A query is incorrectly formulated if components do not contribute
to the generation of the result, a query is contradictory if its
predicate cannot be satisfied by any tuple.
 For Example: the predicate (position=‘manager’ ^
position=‘assistant’)on staff relation is contradictory b/c a person
can not the both manager and assistant simultaneously
 However, the predicate((position=‘manager’ ^position=‘assistant’)
v salary >2000) could be simplified
11
 Simplifying the qualification of user query to
eliminate redundancy
 Transform the query to a semantically equivalent
but more easily and efficiently computed form
 Queries on relation that satisfy certain integrity
and security constraints (access restriction)
12
 Before elimination of Redundancy
SELECT Position
FROM staff s, branch b
WHERE (NOT(b.Position = ‘manager’)
AND (b.Position = ‘manager’ OR b.Position=‘assistant’)
AND NOT(b.Position = ‘assistant’))
OR (b.BID = s.SID
AND s.Name = ‘Ali’)
 After Elimination of Redundancy
SELECT b.Position
FROM staff s, branch b
WHERE b.BID = s.SID AND s.Name = ‘ali
13
 The final stage of query decomposition.
 The query is restructured to provide a more
efficient implementation.
14
Advantages:-
 all information required to select an optimum
strategy is up to date
Disadvantage:
 It takes time to decompose the query has to be
parsed, validated, and optimized before it can
be executed
15
 Query is optimized ,data can be retrieve easily
and more efficiently
16
17

More Related Content

What's hot

Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 ReliabilityAli Usman
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
AAKANKSHA JAIN
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Gyanmanjari Institute Of Technology
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
babak danyal
 
DDBMS Paper with Solution
DDBMS Paper with SolutionDDBMS Paper with Solution
DDBMS Paper with Solution
Gyanmanjari Institute Of Technology
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ravinder Kamboj
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
Mythili Kannan
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMSkoolkampus
 
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
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
Pooja Dixit
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
Md. Mashiur Rahman
 
Database , 4 Data Integration
Database , 4 Data IntegrationDatabase , 4 Data Integration
Database , 4 Data IntegrationAli Usman
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query OptimizationAli Usman
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
Janki Shah
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
Gyanmanjari Institute Of Technology
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
Join ordering in fragment queries
Join ordering in fragment queriesJoin ordering in fragment queries
Join ordering in fragment queries
Ifzalhussainkhan
 

What's hot (20)

Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
DDBMS Paper with Solution
DDBMS Paper with SolutionDDBMS Paper with Solution
DDBMS Paper with Solution
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMS
 
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 database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
 
Ddbms1
Ddbms1Ddbms1
Ddbms1
 
Database , 4 Data Integration
Database , 4 Data IntegrationDatabase , 4 Data Integration
Database , 4 Data Integration
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
Join ordering in fragment queries
Join ordering in fragment queriesJoin ordering in fragment queries
Join ordering in fragment queries
 

Similar to Query decomposition in data base

itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdfitm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
beshahashenafe20
 
dbms first unit
dbms first unitdbms first unit
dbms first unit
Raghu Bright
 
Query optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsQuery optimization and processing for advanced database systems
Query optimization and processing for advanced database systems
meharikiros2
 
Assignment#04
Assignment#04Assignment#04
Assignment#04
Sunita Milind Dol
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
Eddyzulham Mahluzydde
 
Relational algebr
Relational algebrRelational algebr
Relational algebr
Visakh V
 
UNIT 2 Structured query language commands
UNIT 2 Structured query language commandsUNIT 2 Structured query language commands
UNIT 2 Structured query language commands
Bhakti Pawar
 
ch14.ppt
ch14.pptch14.ppt
ch14.ppt
ssuser67281d
 
6 integrity and security
6 integrity and security6 integrity and security
6 integrity and securityDilip G R
 
Normalization
NormalizationNormalization
Normalization
Mohd Mastana
 
SQL PPT.ppt
SQL PPT.pptSQL PPT.ppt
SQL PPT.ppt
hemamalinikrishnan2
 
UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
hemamalinikrishnan2
 
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
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 
SQL3.pdf
SQL3.pdfSQL3.pdf
SQL3.pdf
ssuser6101e9
 
Sql (DBMS)
Sql (DBMS)Sql (DBMS)
Sql (DBMS)
Saransh Vijay
 
Database Modeling presentation
Database Modeling  presentationDatabase Modeling  presentation
Database Modeling presentation
Bhavishya Tyagi
 
Chapter 55.1 Describe the circumstances in which you would c.docx
Chapter 55.1 Describe the circumstances in which you would c.docxChapter 55.1 Describe the circumstances in which you would c.docx
Chapter 55.1 Describe the circumstances in which you would c.docx
DinahShipman862
 

Similar to Query decomposition in data base (20)

itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdfitm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
itm661-lecture0VBBBBBBBBBBBBBBM3-part2-2015.pdf
 
dbms first unit
dbms first unitdbms first unit
dbms first unit
 
Query optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsQuery optimization and processing for advanced database systems
Query optimization and processing for advanced database systems
 
Assignment#04
Assignment#04Assignment#04
Assignment#04
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
 
Unit04 dbms
Unit04 dbmsUnit04 dbms
Unit04 dbms
 
Relational algebr
Relational algebrRelational algebr
Relational algebr
 
UNIT 2 Structured query language commands
UNIT 2 Structured query language commandsUNIT 2 Structured query language commands
UNIT 2 Structured query language commands
 
ch14.ppt
ch14.pptch14.ppt
ch14.ppt
 
6 integrity and security
6 integrity and security6 integrity and security
6 integrity and security
 
Normalization
NormalizationNormalization
Normalization
 
SQL PPT.ppt
SQL PPT.pptSQL PPT.ppt
SQL PPT.ppt
 
UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
 
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
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 
SQL3.pdf
SQL3.pdfSQL3.pdf
SQL3.pdf
 
Sql (DBMS)
Sql (DBMS)Sql (DBMS)
Sql (DBMS)
 
Database Modeling presentation
Database Modeling  presentationDatabase Modeling  presentation
Database Modeling presentation
 
Chapter 55.1 Describe the circumstances in which you would c.docx
Chapter 55.1 Describe the circumstances in which you would c.docxChapter 55.1 Describe the circumstances in which you would c.docx
Chapter 55.1 Describe the circumstances in which you would c.docx
 

More from Salman Memon

PHP Array very Easy Demo
PHP Array very Easy DemoPHP Array very Easy Demo
PHP Array very Easy Demo
Salman Memon
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
How to Use Dreamweaver cs6
How to Use Dreamweaver cs6 How to Use Dreamweaver cs6
How to Use Dreamweaver cs6
Salman Memon
 
what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point
Salman Memon
 
Working with variables in PHP
Working with variables in PHPWorking with variables in PHP
Working with variables in PHP
Salman Memon
 
Web forms and html (lect 5)
Web forms and html (lect 5)Web forms and html (lect 5)
Web forms and html (lect 5)
Salman Memon
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
Salman Memon
 
Web forms and html (lect 3)
Web forms and html (lect 3)Web forms and html (lect 3)
Web forms and html (lect 3)
Salman Memon
 
Web forms and html (lect 2)
Web forms and html (lect 2)Web forms and html (lect 2)
Web forms and html (lect 2)
Salman Memon
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
Salman Memon
 
Managing in the Future Enterprise
Managing in the Future EnterpriseManaging in the Future Enterprise
Managing in the Future Enterprise
Salman Memon
 
Overview of Technology Management
Overview of Technology ManagementOverview of Technology Management
Overview of Technology Management
Salman Memon
 
Align Information Technology and Business Strategy
Align Information Technology and Business Strategy Align Information Technology and Business Strategy
Align Information Technology and Business Strategy
Salman Memon
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASE
Salman Memon
 
Email security netwroking
Email security  netwrokingEmail security  netwroking
Email security netwroking
Salman Memon
 
Email security - Netwroking
Email security - Netwroking Email security - Netwroking
Email security - Netwroking
Salman Memon
 
Time Management
Time Management Time Management
Time Management
Salman Memon
 
Multimedea device and routes
Multimedea device and routesMultimedea device and routes
Multimedea device and routes
Salman Memon
 
Hash function
Hash function Hash function
Hash function
Salman Memon
 
Data clustring
Data clustring Data clustring
Data clustring
Salman Memon
 

More from Salman Memon (20)

PHP Array very Easy Demo
PHP Array very Easy DemoPHP Array very Easy Demo
PHP Array very Easy Demo
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
How to Use Dreamweaver cs6
How to Use Dreamweaver cs6 How to Use Dreamweaver cs6
How to Use Dreamweaver cs6
 
what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point
 
Working with variables in PHP
Working with variables in PHPWorking with variables in PHP
Working with variables in PHP
 
Web forms and html (lect 5)
Web forms and html (lect 5)Web forms and html (lect 5)
Web forms and html (lect 5)
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
 
Web forms and html (lect 3)
Web forms and html (lect 3)Web forms and html (lect 3)
Web forms and html (lect 3)
 
Web forms and html (lect 2)
Web forms and html (lect 2)Web forms and html (lect 2)
Web forms and html (lect 2)
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
 
Managing in the Future Enterprise
Managing in the Future EnterpriseManaging in the Future Enterprise
Managing in the Future Enterprise
 
Overview of Technology Management
Overview of Technology ManagementOverview of Technology Management
Overview of Technology Management
 
Align Information Technology and Business Strategy
Align Information Technology and Business Strategy Align Information Technology and Business Strategy
Align Information Technology and Business Strategy
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASE
 
Email security netwroking
Email security  netwrokingEmail security  netwroking
Email security netwroking
 
Email security - Netwroking
Email security - Netwroking Email security - Netwroking
Email security - Netwroking
 
Time Management
Time Management Time Management
Time Management
 
Multimedea device and routes
Multimedea device and routesMultimedea device and routes
Multimedea device and routes
 
Hash function
Hash function Hash function
Hash function
 
Data clustring
Data clustring Data clustring
Data clustring
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Query decomposition in data base

  • 2.  Process of minimizing the resource usage.  Aims of Query Decomposition  To transform a high-level query into a Relational Algebra query &  To check the query is syntactically and semantically correct  It is efficient way to retrieve data from database. 2
  • 3. select * from staff s, branch b where s.branchNo=b.branchNo And (s.position=‘Manager’ And b.city=‘London’);  Three equivalent relational algebra queries 1. σ(position=‘Manager’)^(staff.branchNo=branc h.branchNo)(staff x branch) • Suppose staff have 1000 records and branch have 50 records 3
  • 4. • This query calculates the Cartesian product of staff and branch, (1000 + 50) disk accesses to read and creates relation with (1000*50) tuples. We then have to read each of these tuples again to test them against the selection predicate so it gives total cost of : (1000+50)+2*(1000*50)=101050 disk access 2. σ(position=‘Manager’)^(city=‘London’)(staff∞staff.branchNo=bran ch.branchNo branch) Gives total cost of: • 2*1000+(1000+50)=3050 disk accesses 3. (σposition=‘manager’(staff))∞staff.branchNo=branch.branchNo(σci ty=‘London’(branch)) Gives total cost of: • 1000+2*50+5+(50+5)=1160 disk accesses 4
  • 5. 1. Analysis 2. Normalization 3. Semantic Analysis 4. Simplification Or Redundancy eliminator 5. Query Restructuring 5
  • 6. In this stage query is syntactically analyzed  Verifies that the relations and attributes specified in the query are defined in the system catalog  Verifies that any operations applied to database objects are appropriate for the object type 6
  • 7. • SELECT staffNumber FROM staff where position >10; This query would be rejected on two grounds 1. in SELECT list the attribute staffNumber is not defended for staff relation(should be staffNo) 2. in WHERE clause comparison ’>10’ is incompatible with the data type position, which is a variable character string After completion this stage ,high level query has been transformed internal representation that is some kind of query tree. 7
  • 8. ∞s.branchNo=b.branchNo Root intermediate operations σs.position=‘manager’ σb.city=‘london’ leaves staff branch • A leaf node is created for each base relation in query • Each intermediate relation produced by a relational algebra operation • The Root of the tree represents the result of the query • The sequence of operation is directed from the leaves to the root 8
  • 9.  It normalizes query for easy manipulation  Arbitrarily complex predicate (in SQL, the WHERE condition) can be converted into one of two forms by applying few transformation rules: 1. Conjunctive Normal form:- A sequence of conjuncts that are connected with the ^ (AND) operator. Each conjunct contains one or more terms connected by the v (OR) operator For Example :- (position=‘manager’ v salary > 20000) ^ branchNo=‘B003’ A conjunctive selection contains only those tuples that satisfy all conjuncts. 9
  • 10. 2. Disjunctive Normal form:- A sequence of disjuncts that are connected with the v (OR) operator. Each disjunct contains one or more terms connected by the ^ (AND) operator For Example : we can rewrite the above conjunctive normal form into disjunctive (position=‘manager’^ branchNo=‘B003’) v (salary >20000 ^ branchNo=‘B003’) A disjunctive selection contains those tuples formed by the union of all tuples that satisfy the disjuncts 10
  • 11.  It reject normalized queries that are incorrectly formulated or contradictory.  A query is incorrectly formulated if components do not contribute to the generation of the result, a query is contradictory if its predicate cannot be satisfied by any tuple.  For Example: the predicate (position=‘manager’ ^ position=‘assistant’)on staff relation is contradictory b/c a person can not the both manager and assistant simultaneously  However, the predicate((position=‘manager’ ^position=‘assistant’) v salary >2000) could be simplified 11
  • 12.  Simplifying the qualification of user query to eliminate redundancy  Transform the query to a semantically equivalent but more easily and efficiently computed form  Queries on relation that satisfy certain integrity and security constraints (access restriction) 12
  • 13.  Before elimination of Redundancy SELECT Position FROM staff s, branch b WHERE (NOT(b.Position = ‘manager’) AND (b.Position = ‘manager’ OR b.Position=‘assistant’) AND NOT(b.Position = ‘assistant’)) OR (b.BID = s.SID AND s.Name = ‘Ali’)  After Elimination of Redundancy SELECT b.Position FROM staff s, branch b WHERE b.BID = s.SID AND s.Name = ‘ali 13
  • 14.  The final stage of query decomposition.  The query is restructured to provide a more efficient implementation. 14
  • 15. Advantages:-  all information required to select an optimum strategy is up to date Disadvantage:  It takes time to decompose the query has to be parsed, validated, and optimized before it can be executed 15
  • 16.  Query is optimized ,data can be retrieve easily and more efficiently 16
  • 17. 17