通过以下语句检查逻辑读较多的SPID

select SPID, KPID, BatchID, ContextID, DBID, ProcedureID, StartTime, ElapsedTime = datediff(ss, StartTime, max(EndTime)), CPUTime = sum(CpuTime), LogicalReads = sum(LogicalReads), PagesModified = sum(PagesModified) 
from master..monSysStatement 
group by SPID, KPID, BatchID, ContextID, DBID, ProcedureID, StartTime 
having datediff(ss, StartTime, max(EndTime)) > 0 
and sum(LogicalReads) > 0 
order by 7

在此查询语句中,通过计算每个会话(SPID)的CPU时间逻辑读数,可以筛选出那些在逻辑读方面负载较高的会话,以优化数据库性能。