QUERY OPTIMIZATION
the query optimiser help us to determine the most efficient way to execute a given query. it does so by considering the most possible query plans. data plays an important role in information retrieval and with the increase in data there must be an outline solution to deal with it. In today's world data is stored in multiple languages and that data is known as multi-lingual data. with large amount of multi-lingual data its retrieval and storage should also be efficient. the retrieval of the data is done by passing the query and the type of data to be retrieved. a query is basically a request from data base for the information that we need. the result that we want only provide by the query when we access only the relevant database data. since most of the data base are complex and multi-lingual data, each query has different processing time. when the query is passed in the database, it is received by the query compiler. the query compiler is used for scanning the queries. after scanning it divides it into into individual tokens. all the tokens are verified by the parser. tokenised queries are transformed into relational expressions.graphs and relational trees. now there is role of query optimization technique.
the query optimiser checks the system catalog and indexes and then picks the best query plan to proceed. the goal of optimiser is to generate all query plans for all possible parameter value combinations. the time taken by the ideal optimiser must be in fraction of seconds which make the query even faster.
ways that the query can be optimised.
1) cost based optimisation - it is based on the cost of query. it is basically used in statistics like records. the optimiser generates the cost of plans based on statistics for the data distribution and storage characteristics.
query transformer - we passed the parsed query to the query transformer.
estimator - it estimate the overall cost of the plan.
plan generator - it try out different possible plans for the query.
2) logical based optimization - this optimiser is based on equivalence rules on relational expression. in this case the number of queries and the cost reduces. these equivalence rules provide a better path to evaluate the query.
the query optimiser help us to determine the most efficient way to execute a given query. it does so by considering the most possible query plans. data plays an important role in information retrieval and with the increase in data there must be an outline solution to deal with it. In today's world data is stored in multiple languages and that data is known as multi-lingual data. with large amount of multi-lingual data its retrieval and storage should also be efficient. the retrieval of the data is done by passing the query and the type of data to be retrieved. a query is basically a request from data base for the information that we need. the result that we want only provide by the query when we access only the relevant database data. since most of the data base are complex and multi-lingual data, each query has different processing time. when the query is passed in the database, it is received by the query compiler. the query compiler is used for scanning the queries. after scanning it divides it into into individual tokens. all the tokens are verified by the parser. tokenised queries are transformed into relational expressions.graphs and relational trees. now there is role of query optimization technique.
the query optimiser checks the system catalog and indexes and then picks the best query plan to proceed. the goal of optimiser is to generate all query plans for all possible parameter value combinations. the time taken by the ideal optimiser must be in fraction of seconds which make the query even faster.
ways that the query can be optimised.
1) cost based optimisation - it is based on the cost of query. it is basically used in statistics like records. the optimiser generates the cost of plans based on statistics for the data distribution and storage characteristics.
query transformer - we passed the parsed query to the query transformer.
estimator - it estimate the overall cost of the plan.
plan generator - it try out different possible plans for the query.
2) logical based optimization - this optimiser is based on equivalence rules on relational expression. in this case the number of queries and the cost reduces. these equivalence rules provide a better path to evaluate the query.
Comments
Post a Comment