我的查询似乎不会导致或使用过程缓存中的条目,但是当我查看统计信息时,我看不到任何资源用于解析等的证据。
我的问题是:
我可以使用哪种方法可以预测在执行时是否会使用缓存计划?
我应该担心我的查询没有被缓存,还是应该考虑强制选项?
我的查询是否有缓存的原因?
我的查询如下:
set statistics io on
set statistics time on
select
ps.permanentpolicyref,
pt.effdate,
pt.donedate,
a.agentref,
a.groupingcode,
pt.transactiontype,
pt.transactionstatus,
pt.BrokerQuoteSystem
from policytransaction pt
inner join PolicyStatic ps on ps.refno = pt.refno
inner join Policy p on pt.PolicyId = p.PolicyId
inner join Agents a on p.AgentID = a.AgentId
where
pt.transactiontype in ('nb', 'ab', 'rb')
and pt.transactionstatus in ('a', 'p')
and pt.policystatus <> 'd'
--and a.groupingcode = '79584'
and pt.schemecode in (45, 47, 48, 49, 50, 53, 54, 56)
and pt.donedate > '2009-12-01'
order by pt.donedate desc