Download presentation
Presentation is loading. Please wait.
Published byMartina Russell Modified over 9 years ago
1
Lecture 15: Query Optimization
2
Very Big Picture Usually, there are many possible query execution plans. The optimizer is trying to chose a good one. Key: cost model, search space.
3
More Detail, but Still Big Picture Parse the SQL query into a logical tree: –identify distinct blocks (corresponding to nested sub- queries or views). Query rewrite phase: SQL-to-SQL transforms –apply algebraic transformations to yield a cheaper plan. –Merge blocks and move predicates between blocks. Optimize each block: join ordering. Complete the optimization: select scheduling (pipelining strategy).
4
Query Rewrite Summary The optimizer can use any semantically correct rule to transform one query to another. Rules are used for: –moving constraints between blocks (because each will be optimized separately) –Un-nesting blocks Especially important in automatically generated queries, which may be very complex
5
The Course in Perspective The relational data model, SQL –Views, updates, transactions Conceptual design –Expressing the constraints on the domain –Using them to get good schema designs Building a database system: –Storage and indexing –Query execution (join algorithms) –Query optimization
6
Perspective (continued) Data integration and sharing: –Databases were created independently –Schemas need to be matched –Need to access multiple databases in one query.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.