3

We are using SQL Server 2016 Standard Edition (SP2-CU2). We have a few servers hosting each between a few dozens to hundreds of databases. We have never enabled Query Store on our databases.

I know there are lots of advantages to turning on the Query Store for tuning. I was wondering, are there any cases when the query store should not be turned on? Or should I turn it on on all databases?

6

So you really have two questions:

  1. Are there any cases when Query Store should not be enabled?

Based on some reports of significant performance issues in the field when Query Store was enabled (although they are quite rare), one might infer that you should not enable Query Store on databases where it causes significant performance issues.

Of course the only way you'll know for sure whether it will cause a performance issue is to research all the known issues, make sure none of them will affect your system, and then enable it--but you still won't know if it will cause a performance issue until you enable it. For example, see FIX: Slow performance of SQL Server 2016 when Query Store is enabled. Note that enabling or changing settings in the query store can also flush the plan cache.

Secondly, if you aren't going to use the information and functionality it provides to improve the performance of the queries running on your server, then you shouldn't enable it. Some environments, particularly large, heavily regulated organizations, may have such strict change control that you can't realistically do anything with Query Store.

  1. Should I turn it on on all databases?

I would certainly not enable it on hundreds of databases all at once, due to the possibility of causing a lot of problems and having too much data to analyze. If your environment is such that you'll be able to use the Query Store to improve performance, then I would recommend enabling on a few database at a time.

If you have hundreds of databases, you probably don't have the staff to analyze all of the information, so it might make sense to enable it periodically on a few servers, see if there are any improvements to be made, then disable it and use it on some other servers for a while. Or, when an application upgrade takes place, enable it for a while to see if the new code is triggering anything that Query Store can help with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.