当我将两列添加到我的选择中时,查询没有响应。列的类型是nvarchar(2000)
。这有点不寻常。
这是之前的执行计划(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) 我使用的是 SQL Server 2014。有一些用户可以查询表。问题是,大多数时候这些查询使用大量内存。我想知道是否有任何方法可以限制每个用户的资源?
没有特定的查询。我只想控制用户。有时他们会做一些疯狂的事情。