在TSQL查询期间控制CPU使用率-SQL 2008 [英] Control the CPU usage during TSQL query- sql 2008

查看:95
本文介绍了在TSQL查询期间控制CPU使用率-SQL 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些繁重的查询正在sql数据库上脱机运行以处理数据. 查询正在运行,有时会占用很大一部分计算机资源. 有没有一种方法可以控制/调整给定查询/存储过程中的CPU使用率?

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?

谢谢

推荐答案

每个查询都可以使用

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

您无法限制CPU时间或%

You can't throttle CPU time or %

如果只有一个CPU,则选择升级.但是,受CPU约束的查询通常表示代码质量差,原因是缺少索引等.

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...

这篇关于在TSQL查询期间控制CPU使用率-SQL 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆