通过Service Broker通知的SqlCacheDependency-仅在特定列上选择敏感 [英] SqlCacheDependency via Service Broker Notifications - SELECT sensitive ONLY on particular columns

查看:95
本文介绍了通过Service Broker通知的SqlCacheDependency-仅在特定列上选择敏感的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在SELECT上定义一个Notification,但以这种方式:只有在select中写入的列发生更改时,Broker才会重置Cache.因此,列敏感方法.如果表中的一些不重要的列被更改,我不希望缓存重置.我将使用INNER JOIN进行SELECT.

Is it possible to define a Notification on SELECT, but in that way: the Broker would reset Cache only if columns written in select has changed. So Column Sensitive approach. I don't want the cache resets if some unimportant column in the table are changed. I will have a SELECT with INNER JOIN.

预先感谢您的帮助.

推荐答案

理论认为,如果将SELECT列限制为仅包含感兴趣的列,则仅当这些列发生更改时才应通知您.但是了解查询通知的发生时间出现此警告:

The theory goes that if you restrict your SELECT columns to contain only the columns of interest, you should be notified only if those columns changed. However the Understanding When Query Notifications Occur has this warning:

请注意,SQL Server可能会生成查询通知以响应 不会更改数据的事件,或响应于更改的事件 实际上并不会影响查询结果.例如,当 UPDATE语句更改查询返回的行之一, 即使该行的更新未更改 查询结果中的列.

Notice that SQL Server may produce a query notification in response to events that do not change the data, or in response to a change that does not actually affect the results of the query. For example, when an UPDATE statement changes one of the rows returned by the query, the notification may fire even if the update to the row did not change the columns in the query results.

因此,您得到误报.

这篇关于通过Service Broker通知的SqlCacheDependency-仅在特定列上选择敏感的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆