在系统中,我使用以下查询来获取表格数据的一部分,以便实现分页。该表目前仅包含约100条记录,但稍后将增加到100万条记录。
SELECT
Id AS ActualMapping_Id,
BudgetPhase AS ActualMapping_BudgetPhase,
FromBH AS ActualMapping_FromBH,
ToBH AS ActualMapping_ToBH,
FromBI AS ActualMapping_FromBI,
ToBI AS ActualMapping_ToBI,
FromSI1 AS ActualMapping_FromSI1,
ToSI1 AS ActualMapping_ToSI2,
FromSI2 AS ActualMapping_FromSI2,
ToSI2 AS ActualMapping_ToSI2,
DataType AS ActualMapping_DataType,
Status AS ActualMapping_Status,
MappingType AS ActualMapping_MappingType,
LastMappedBy AS ActualMapping_LastMappedBy,
LastMappedDate AS ActualMapping_LastMappedDate
FROM
(
SELECT
Id,
BudgetPhase,
FromBH,
ToBH,
FromBI,
ToBI,
FromSI1,
ToSI1,
FromSI2,
ToSI2,
DataType,
Status,
MappingType,
LastMappedBy,
LastMappedDate,
ROW_NUMBER() OVER (ORDER BY FromBH) AS RowNumber
FROM
ActualMapping
WHERE
DataType = 'Cost' and
Status = 'Active' and
MappingType = 'Static' and
BudgetPhase like '%some_text%' and
ToBH like '%some_text%' and
ToBI like '%some_text%' and
ToSI1 like '%some_text%' and
ToSI2 like '%some_text%' and
FromBH like '%some_text%' and
FROMBI like '%some_text%' and
FROMSI1 like '%some_text%' and
FROMSI2 like '%$some_text%'
) AS NumberedTable
WHERE
RowNumber BETWEEN 1 AND 50
以上查询工作得很好(至少在约100条记录上),但过了一段时间它开始被阻止。我无法理解它被阻止的可能原因,但是当发生这种情况时,我无法从表中执行简单的选择查询,除非我杀死所有那些被堆积的被阻止的查询。
所以我的问题是: