are there any Query Optimization Tools for SQL Ser

2019-02-03 12:22发布

问题:

Are there any tools that do Query Optimizations for SQL Server 2005 and above?

I've searched & didn't find anything.

What do you recommend?

If this Question was repeated before you can close it but I didn't see anything similar

回答1:

The best tool I've ever used for optimizing queries in MS SQL Server, by far, is the "Include Actual Execution Plan" option in Microsoft SQL Server Management Studio. It displays detailed information about the execution path taken by the server when running your query. (Note that this works best when there's data in the tables. Of course, without a good bit of test data, any optimization is purely theoretical anyway.)

It basically gives you three very important things:

  1. It tells you which steps take the most processing time and what they're doing at that step.
  2. It tells you which steps carry the most data to the next step, including how many records, which helps identify places where you can be more specific about the data you want and exclude unnecessary records.
  3. It gives you a ton of insight into the inner workings of SQL Server and what it does with your queries. This knowledge will help you optimize things a lot over time.


回答2:

In SSMS - Tools | Database Engine Tuning Advisor - Does not work on Express versions.



回答3:

One very good tool and now free for use is Plan Explorer from SentryOne: https://sentryone.com/plan-explorer

(they also have many other optimization software, like Azure specific software etc.)



回答4:

One of the best query optimizers is just running the query in SQL Management Studio, and then inspecting the query plan. This will give you clues as to what indexes it is (or is not) using, and how you can change the query to take advantage of those.



回答5:

As John Saunders commented, the best tool at your disposal is your own mind. Following bernd_k's comment, here are a few suggestions for sharpening that tool.

  • SQL Server 2008 Query Performance Tuning Distilled
  • Professional SQL Server 2008 Internals and Troubleshooting
  • SQL Server MVP Deep Dives


回答6:

Also this is a good tool for monitor and optimize queries:

Sql Monitor by Red Gate