Control the CPU usage during TSQL query- sql 2008

2019-07-19 16:00发布

问题:

I have some heavy queries that are running offline on a sql database to manipulate data. the queries are running and sometimes take a significant part of the computer resources. Is there a way to control/adjust the CPU usage on in a given query / stored procedure?

thanks

回答1:

Per query you can use MAXDOP to limit number of CPUs used queries (when parallelism applies)

You can't throttle CPU time or %

If you have one CPU only, then your option is upgrade. However, CPU bound queries generally indicate poor quality code ir lack of indexes etc...