Posts

Showing posts with the label QUERYTRACEON 8675

Inside the SQL Server Query Optimizer - part 7 cost bases optimization phases

Image
Hi Guys, Welcome back! Are you ready for the last post of the series " Inside the SQL Server Query Optimizer "? Let's go! Introduction You will surely remeber that in a previous post Inside the SQL Server Query Optimizer - part 4 Trivial Plan we talked about trivial plans. Today we do another step forward. Consider infact that rarely a Query is eligible for a trivial plan. This is because as soon as we have an aggregate function or a union we can have multiple implementations and so a cost based decision is required. Well, we have that if a Query is not eligible for a trivial plan then the optimizer proceeds with next steps called phases. These Phases are: Transaction processing or Search 0 Quick plan or Search 1 Quick plan with parallelism  Full optimization or Search 2 Therefore we analyze each phase! Transaction processing (Search 0) The goal of this first phase is to find quickly an execution plan using only a limited set of rules. The ...