Query Optimization & Conclusion Flashcards
What are the steps in query processing
1.Query
2. Parsor and translator
3. Relational algebra expression
4. Optimiser
5. Execution plan
6. Evaluation engine
7. Query output
What are evaluation plans?
For the same sql query, there are many ways to achieve the same result. Each way is called an evaluation plan
What is query optimisation?
Choosing the evaluation plan with least cost among all equivalent evaluation plans
What could be thought of as cost to a query ?
Cost is generally measured as total time elapsed for answering query
Factors of time cost : Disk accesses, CPU or even network communication .
Typically , predominant cost is disk access.
How is disk access cost measured?
Number of seems *average week cost
Number of blocks read *average block-read cost
Number of block written *average block write cost
Which cost is bigger ? Cost to read or cost to write disk ?
Cost to write is bigger as after writing disk .. contents have to be read back for confirmation