SQL Server 2000 视图中的连接提示有任何问题吗?
我有一些临时报告用户访问一些 SQL Server 视图。有时,这些用户对特别长的查询采取的读锁定会导致系统其他地方出现问题。
我正在考虑向视图添加一些策略性 with(nolock)
提示,但想知道是否存在与视图中的提示相关的问题。
请忽略让用户运行如此接近 SQL 金属的查询的明显问题:)。
另外,我知道 nolock 提示是一项高级功能,不能轻易使用,而且我很清楚它们引入了有趣的东西,例如脏读。最后,如果您认为 read_comfilled_snapshot 在这里有意义,我必须遗憾地说它不适用于 2000。
I have some ad-hoc reporting users hitting some SQL Server views. Occasionally the read locks taken by these users for particularly lengthy queries causes trouble elsewhere in the system.
I am considering adding some strategic with(nolock)
hints to the views but wanted to know if there are any gotchas associated with hints in views.
Please ignore the obvious issues with letting users run queries this close to the SQL metal :).
Also, I know that nolock hints are an advanced feature not to be used lightly and I am well aware that they introduce fun things like dirty reads. Finally, if you're thinking that read_committed_snapshot makes sense here, I must sadly say that it's not available for 2000.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
报告可能会显示不一致的数据视图。不过,这种事情很少见。
不过,更好的策略是使用复制来创建完全独立的报告数据库。
There is a potential for the report to show an inconsistent view of data. That kind of thing is rare, though.
Still, a better strategy is to use replication to create a completely separate reports database.