问题
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...
来源:https://stackoverflow.com/questions/5485421/control-the-cpu-usage-during-tsql-query-sql-2008