 Hello, welcome to SSUriTech, so see in this side and this is part 4 of SQL Server Performance Training. So today we gonna discuss about the query optimizer. In our last video we have discussed about the execution plans. So if you haven't watched last video of this video series, so I would strongly recommend to watch that video before going to watch this video. So let's start with query optimizer. So what query optimizer is? So let's move to query optimizer. So what query optimizer is? So it is part of SQL Server Engine that is used to determine the most efficient execution plan of the SQL queries. So it is part of SQL Server Engine that is used to determine the most efficient execution plan of the SQL queries. Like we have written a SQL query and that SQL query may have more than 1 execution plans. So query optimizer will decide the most efficient execution plan and that execution plan will be made by this query optimizer. So it does this by optimizing each SQL statement based on the stats. So basically as we can see over here so this is our simple query select first name last name from our table then the condition will be employee 10. So this is the condition. So this query will go to the query optimizer. So first query optimizer will validate and return the best execution plan of the query. So here as we can see it will use the stats to create the execution plans and in execution plan we can see and we have also seen our last video it will contain all the information related to the query like how many number of it will return and what will be the cost of the query and how would be the subtree cost, IO cost. All the information are available in execution plan. So we can see in the backtrack first execution plan will be created by query optimizer. So query optimizer is used the stats to create the execution plan. So first stats then query optimizer then execution plan. So thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos. Don't forget to press the bell icon to get the notification of our newly uploaded videos. Thank you so much.