dbms ppt

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

DBMS

( D ATA B A S E M A N A G E M E N T S Y S T E M )
QUERY OPTIMIZATION
OVERVIEW ,
TRANSFORMATION OF
RELATIONAL EXPRESSION
By seshadri
QUERY:-
A query can either be a request for data results from
your database or for action on the data, or for both. A
query can give you an answer to a simple question,
perform calculations, combine data from different tables,
WHAT IS A add, change, or delete data from a database.
QUERY
&
WHAT IS
OPTMISATION OPTMISATION:-
In a database management system (DBMS),
optimization refers to the process of making a database
query run as efficiently as possible. This is important
because the faster a query runs, the less time it takes to
retrieve the requested data, and the less strain it puts on
the system.
O
WHAT IS QUERY OPTIMIZATION
P
Q T
I
U • Query optimization is the overall process
M
of choosing the most efficient means of
E executing a SQL statement. SQL is a I
nonprocedural language, so the optimizer
Z
R is free to merge, reorganize, and process
A
in any order. The database optimizes each
Y SQL statement based on statistics
collected about the accessed data.
T
I
O
N
When a SQL query is submitted to DB, it can be evaluated in number of
ways. For example, consider the below case:

Transformation
of Relational
Above query selects the EMP_ID and DEPT_NAME from EMP and
Expressions in DEPT table for DEPT_ID = 10. But when it is given to the DBMS, it
DBMS divides the query into tokens and sees how it can be put together so that
performance will be better. This is the duty of query optimizer. But
altering the order of tokens in the query should not change the result. In
either way it should give same result. Order of records can change and are
least important. This is called equivalent query. There is set of rules to put
tokens in the query. This is called equivalence rule.
Use Index − It can be using an index is the first
strategy one should use to speed up a query.
•Aggregate Table − It can be used to pre-
populating tables at higher levels so less amount of There are
information is required to be parsed. various query
•Vertical Partitioning − It can be used to partition
the table by columns. This method reduces the optimization
amount of information a SQL query required to strategies are
process. as follows
•Horizontal Partitioning − It can be used to partition the table by data
value, most often time. This method reduces the amount of information a
SQL query required to process.
•De-normalization − The process of de-normalization combines multiple
tables into a single table. This speeds up query implementation because
fewer table joins are required.
•Server Tuning − Each server has its parameters and provides tuning
server parameters so that it can completely take benefit of the hardware
resources that can significantly speed up query implementation.

You might also like