Alessandro Mortola graduated in Mathematics at the University of Genoa (Italy); during his career, he has always worked as a developer, analyst, database developer and DBA with an increasing interest in Sql Server with which he has been working since the 7.0 version. He is a Microsoft Certified Professional having earned the “SQL 2016 Database Development” certificate in 2018. He was one of the speakers in the Sql Satrurday's Editions in Parma 2018 and 2019. He sometimes writes articles for sqlservercentral.com. During his career, he has always been a person to refer to for his colleagues regarding data; he periodically carries out internal Sql Server courses for his company. Today he works in Zucchetti S.p.a. – BU Asset Management – mainly as DBA.
When we carry out a T-SQL statement, we expect to get the result as quickly as possible. T-SQL, like any other SQL dialects, is a declarative language that allows us to say WHAT we want the engine to do and NOT HOW it should perform the task. Basically, it is in the charge of the Query Optimizer to find, in a few fractions of second, a plan that can achieve the result quickly. In the first part of the session, we will discuss about all the possible plans related to a query analyzing both the logical and the physical plans, their characteristics and the rules that allows the creation of alternatives logically equivalent. In the second part, we will analyse all the optimization steps that the Query Optimizer really performs to find a “Good enough” plan that actually will be executed.