Presentation is loading. Please wait.

Presentation is loading. Please wait.

Summary of query compilers (Section16.8) Varun Gupta Department of Computer Science ID-216 CS 257.

Similar presentations


Presentation on theme: "Summary of query compilers (Section16.8) Varun Gupta Department of Computer Science ID-216 CS 257."— Presentation transcript:

1 Summary of query compilers (Section16.8) Varun Gupta Department of Computer Science ID-216 CS 257

2 Compilation of Queries Turns a query into physical query. Executed by Query execution-engine. CS 257

3 Steps of Query Compilation CS 257

4 1. Parsing Parsing is similar to coding in programming language. Result is a parse tree with SQL constructs as nodes. CS 257

5 2. Semantic Checking The name is self explanatory. Used for checking the semantics like: – Attributes – Relation names – Resolving attribute references. CS 257

6 3. Conversion to Logical Query plan. Conversion of the semantic parse tree is a must. Sub queries creates problems. – Use two argument selection. – Apply appropriate transformation. CS 257

7 4. Selection of a logical query plan. Select a plan which gives an efficient physical plan. Group associative and commutative operators. This makes physical plan to choose the best order of these operations. CS 257

8 5. Estimate the sizes of relation This gives a surrogate for the true running time. Size of relation + number of distinct values Good estimate of size of intermediate relations. CS 257

9 6. Plan enumeration strategies Dynamic programming. Selinger-style dynamic programming. Greedy approaches. Branch-and-bound. CS 257

10 7. Physical plans for selection Break the index-scan of the relation and apply selection to it and then do filter operation. The filter examines the tuples. CS 257

11 Conclusion Both pipelining and materialization give some advantages. So, physical query-plan should consider both pipelining and materialization. CS 257

12 Thank You !!!!! CS 257


Download ppt "Summary of query compilers (Section16.8) Varun Gupta Department of Computer Science ID-216 CS 257."

Similar presentations


Ads by Google