From the course: SQL Server 2022 Administration

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Use execution plans

Use execution plans

So behind SQL Server is a thing called the query optimizer. And essentially what this is doing is every time you run a query, it's trying to figure out the best way to access the data in the database. And it's making use of things like indexes and statistics, and it's making all these choices to try to figure out a way to execute your query efficiently. You can see the plan that it's putting together using a thing called execution plans, and that information can help you to tune your database and or your queries to get the best performance out of them. So that's what we're going to take a look at here. So I'm just going to fire up a new query in my WideWorldImporters database here. And I'm just going to do a simple select statement and I will select all from Sales.OrdersCopy. Now, I'm using this table because it's raw data with no indexes or anything else on it. And before I run this, I want to do a couple of things. One, I want to go over to the query menu and I want to check include…

Contents