http://www.cmr-china.net/cmrchina/pdres/201009/20100901083342773

解决方案 »

  1.   


    哪位仁兄,能帮帮我解决这个问题啊?
    我问了老外,老外给我这样的回答,还是不懂:
    This means that you the SQL server decides how many processors to use for intra-query statements:
    max degree of parallelism            0              32           0              0You could turn it off, but that will hurt performance in other scenarios: 
    sp_configure 'max degree of parallelism',1
    Read also this:  http://www-01.ibm.com/support/docview.wss?uid=swg21371449Or you could try to change the threshold:
    sp_configure 'cost threshold for parallelism',??
    I can’t tell which value to put in, we haven’t seen this problem at lot, it seems to that Microsoft has fixed some in later releases.
    Are you running SQL 2000?
      

  2.   

    你的CPU是几核,这些值是用来控制并行,一般按照默认就可以了。
    是出了什么样的状况?
      

  3.   

    max degree of parallelism 选项 
    当 SQL Server 在具有多个微处理器或 CPU 的计算机上运行时,它将为每个并行计划执行检测最佳并行度(即运行一个语句所使用的处理器数)。您可以使用 max degree of parallelism 选项来限制并行计划执行时所用的处理器数。如果默认值为 0,则使用所有可用的处理器。将 max degree of parallelism 设置为 1 以取消生成并行计划。将该值设置为大于 1 的数字(最大为 64)来限制执行单个查询时所用的最大处理器数。如果指定的值比可用的处理器数大,则使用实际可用数量的处理器。如果计算机只有一个处理器,则将忽略 max degree of parallelism 值。明白不,你可以设置0-3的值;
    sp_configure 'show advanced options', 1;
    GO
    RECONFIGURE WITH OVERRIDE;
    GO
      

  4.   

    恩,谢谢仁兄,不过我的数据库是sql2000的,这样用可以吗?
      

  5.   

    那请教一下
    这两句sql是什么意思:
    sp_configure 'max degree of parallelism'
    sp_configure 'cost threshold for parallelism'
      

  6.   

    恩,我有查到了,是指 创建和执行并行计划时的阈值。仅当为同一查询执行串行计划的估计成本比在 cost threshold for parallelism 选项中设定的值大时,SQL Server 才为该查询创建并执行一个并行计划。此处成本指的是在特定硬件配置中执行串行计划估计需要花费的时间(以秒为单位)。cost threshold for parallelism 只能在对称多处理器 (SMP) 系统中设置。
     
     那针对我上面的出错情况,我应该设sp_configure 'cost threshold for parallelism',?? 后面这个参数为多少比较 合理啊