我创建了以下更新,但性能很差。我觉得可能有一种更简单或更有效的方式来进行查询,而不是我的蛮力尝试。请帮忙。
Update LocalServers
set MustIPL = 1
where LocalServerID IN (SELECT distinct olu.LocationID
from OfferLocUpdate olu with (NoLock)
Join LocalServers ls WITH (NOLOCK) on olu.LocationID = ls.LocationID
Join CPE_IncentiveDLBuffer DLB with (NoLock) on olu.OfferID = dlb.OfferID
where
olu.LastSent > IncentiveLastHeard
and CreationDate < dateadd(d, -@Days, getdate())
and DLB.FileName LIKE '%IDL-A')