Posts

Showing posts with the label trace flag 8757

Inside the SQL Server Query Optimizer - part 4 Trivial Plan

Image
Welcome back Guys! Today, after going into the details of the cardinality estimate in a few posts ago, we will continue with the next step taken by the optimizer. So here the fourth part of the series Inside the SQL Server Query Optimizer . We will talk about Trivial plan . As usual I will try to explain myself in the simplest way possible. But tell me what doesn't seem clear to you  If you lost the previous parts you can click here: Inside the SQL Server Query Optimizer - part 1 Introduction and the input tree Inside the SQL Server Query Optimizer - part 2 All about the Simplification Inside the SQL Server Query Optimizer - part 3 Cardinality estimation   Enjoy the reading! What is a Trivial plan? A trivial plan is a mode to avoid the cost of the full “cost based optimization” . SQL Server Optimizer use a trivial plan when detect a Query with a simple structure For example: SELECT ID FROM ORDTES WHERE ID = 1 You can see if a trivial plan is ...