Cost-based optimization is the de-facto standard way to optimize SQL queries in most modern databases. It is the reason why it is really hard to implement a complex, hand-written algorithm in a 3GL (third-generation programming language) such as Java that outperforms a dynamically calculated database execution plan that has been generated from a modern optimizer. I’ve recently delivered a talk about that topic:
Today, we don’t want to talk about cost-based optimization, i.e. optimizations that depend on a database’s cost model. We’ll look into much simpler optimizations that can be implemented purely based on metadata (i.e. constraints) and the query itself. They’re usually no-brainers for a database to optimize because the optimization will always lead to a better execution plan, independently of whether there are any indexes, or how much data you have, or how skewed your data distribution is.
No comments:
Post a Comment