Docsity

Query Optimization in Databases, Lecture notes of Database Management Systems (DBMS)

Partial preview of the text

Download Query Optimization in Databases and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

Contents

๏‚› Query optimization ๏‚› (^) Techniques of query optimization ๏‚› (^) Query optimizer ๏‚› (^) Query and query plan ๏‚› (^) SQL ๏‚› SQL server ๏‚› (^) Example ๏‚› importance

Query optimization

๏‚› There are multiple ways of executing a query known as execution strategy ๏‚› (^) Different execution strategy can have different cost ๏‚› (^) It is the responsibility of the query optimizer to choose least costly execution strategy

Techniques of implementing

query optimization

๏‚› The main aim of the query optimization to transform input query into faster equivalent query ๏‚› (^) There are two techniques of implementing query optimization

Heuristic (contโ€ฆโ€ฆ)

๏‚› The heuristic query optimizer simply apply these rules without finding out weather cost is reduced by this transformation ๏‚› It is based on query tree

Heuristic rules

๏‚› The heuristic rules are used as an optimization techniques to modify the internal representation of the query ๏‚› (^) Heuristic optimization transform the query tree by using the set of rules that Typically (but not in all cases) improve execution performance of the query

Contโ€ฆ..

๏‚› Size of files resulting from a binary operation like join is very large ๏‚› (^) Heuristic query optimizer transform the initial query tree into final query tree

Query optimizer

๏‚› The query optimizer attempt to determine the most efficient way to execute a given query by considering the possible query plan

importance

๏‚› Time is money ๏‚› (^) Queries are faster ๏‚› (^) Help everyone who uses the server ๏‚› (^) Different performance improvement with different database engine and schemas