0

Is a bad practice to create a transaction always?

I mean is a good practice to create a transaction only for one simple select.

how much is the cost of creating a transaction when is not really necessary?

Even if you are using an isolation level read_uncomitted. Is a bad practice? because it shouldn't have problems with locking.

Update: Better answer here: https://dba.stackexchange.com/questions/43254/is-a-bad-practice-to-create-a-transaction-always

4

1 回答 1

4

事务是资源密集型的,并且在此过程中还会记录元数据。我建议不要在简单的 SELECT 语句上使用事务。我建议在复杂的存储过程上使用事务。您必须记住,如果您一直在使用事务,那么您将面临锁定资源的风险。

在这里快速阅读以获得进一步的解释 - SQL 推荐的事务最佳实践

于 2013-05-28T15:21:36.847 回答