事务回滚时更新统计信息的行为 [英] Behaviour of update statistics in case when is transaction rollback

查看:92
本文介绍了事务回滚时更新统计信息的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的应用程序中,我们正在运行查询使用样本30%进行更新统计信息。

In our application we are running query 'update statistics with sample 30 percent'.

我们的系统设计是每天必须使用一次更新统计信息查询为了提高查询性能。

Our system design is such that we have to use update statistics query once a day to improve query performance.

我们将autocommit设置为false,运行更​​新统计信息,然后执行一些失败的查询,导致连接回滚。

We are setting autocommit as false, running 'update statistics' and then some queries which are failing causing a connection rollback.

在这种情况下,更新统计信息查询也会回滚吗?是否应该第二次再次运行update statistics命令? 更新统计信息会自动提交,还是应该在更新统计信息之后提交,然后执行其余查询?

In this case does 'update statistics' query rollback as well? Should I again run update statistics command the second time? Does 'update statistics' auto commit, or should I commit after 'update statistics' and then execute the remaining queries?

谢谢。

推荐答案

更新统计信息将与事务的其余部分一起回滚。

Update statistics will rollback back with the rest of the transaction.

这篇关于事务回滚时更新统计信息的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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