计划缓存大小是否在提高查询性能以及如何实现方面发挥作用?

时间:2015-12-18 10:53:04

标签: sql-server-2008

select 
    ev.iEventId, ev.iEntityId, ev.chAssignedTo, ev.iSourceId, 
    ev.iStatusId, ev.dtInsertDate,
    case 
       when ev.dtinsertdate > DATEADD(ms,-30,ev.dtinsertdate) 
          then ev.dtInsertDate 
       else DATEADD(hh, 3, ev.dtInsertDate)
    end
from 
    event ev WITH(NOLOCK)
left join 
    vehicle v WITH(NOLOCK) on ev.iEventId = v.iSalesNo 
                           and v.tiRecordStatus = 1 
                           and v.iSiteId = 1359 
                           and ev.iSiteId = 1359  
                           and ev.tiRecordStatus = 1
                           and ev.iEventCategory = 1
                           and ev.iStatusId <> 0

0 个答案:

没有答案