Mechanics of the Query Optimizer
The next step in our journey to writing efficient T-SQL queries is understanding how the SQL Database Engine optimizes a query by exploring T-SQL query optimization internals and architecture, starting with the infamous cardinality estimation process and its building blocks. From there, understand how the Query Optimizer uses that information to produce a just-in-time good-enough execution plan. This chapter will be referenced throughout all chapters, as we bridge architectural topics to real-world uses.
In this chapter, we’re going to cover the following main topics:
- Introducing the Cardinality Estimator (CE)
- Understanding the query optimization workflow