小编Ham*_*thi的帖子

添加两列时查询没有响应

当我将两列添加到我的选择中时,查询没有响应。列的类型是nvarchar(2000)。这有点不寻常。

  • SQL Server 版本是 2014。
  • 只有一个主索引。
  • 整个记录只有 1000 行。

这是之前的执行计划(XML showplan):

在此处输入图片说明

之后的执行计划(XML showplan):

在此处输入图片说明

这是查询:

select top(100)
  Batch_Tasks_Queue.id,
  btq.id,
  Batch_Tasks_Queue.[Parameters], -- this field
  btq.[Parameters]  -- and this field
from
        Batch_Tasks_Queue with(nolock)
    inner join  Batch_Tasks_Queue btq with(nolock)  on  Batch_Tasks_Queue.Start_Time < btq.Start_Time
                            and btq.Start_Time < Batch_Tasks_Queue.Finish_Time
                            and Batch_Tasks_Queue.id <> btq.id                            
                            and btq.Start_Time is not null
                            and btq.State in (3, 4)                          
where
    Batch_Tasks_Queue.Start_Time is not null      
    and Batch_Tasks_Queue.State in (3, 4)
    and Batch_Tasks_Queue.Operation_Type = btq.Operation_Type
    and Batch_Tasks_Queue.Operation_Type not …
Run Code Online (Sandbox Code Playgroud)

performance sql-server sql-server-2014 query-performance

9
推荐指数
1
解决办法
258
查看次数

限制用户内存使用

我使用的是 SQL Server 2014。有一些用户可以查询表。问题是,大多数时候这些查询使用大量内存。我想知道是否有任何方法可以限制每个用户的资源?

没有特定的查询。我只想控制用户。有时他们会做一些疯狂的事情。

sql-server memory sql-server-2014

5
推荐指数
1
解决办法
5048
查看次数