Performance question: Commit or rollback?

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Performance question: Commit or rollback?
Дата
Msg-id CAPTjJmp1atMO-Jy+4O6zF2h8P8UxkX7321E3R_nvxqLbNe-ZNA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Performance question: Commit or rollback?  (Chris Travers <chris.travers@gmail.com>)
Список pgsql-general
Some of my code involves transactions which will not have significant
effect on the database. It might be a read-only transaction (possibly
declared as one, but possibly not), or perhaps a completely empty
transaction - I have a framework that will always open a transaction,
then call on other code, and then complete the transaction at the
bottom.

In these instances, is it better to commit or to rollback? Are there
performance penalties to either option?

Similarly, what about when the first action in a transaction puts it
in an error state? Is it better to commit (which should have no effect
- nothing succeeded) or to roll back?

I could test these things experimentally, but am afraid I'll skew my
results based on the data I use. Hoping that somebody here knows for
certain - there does seem to be a wealth of expertise here.

Chris Angelico

В списке pgsql-general по дате отправления:

Предыдущее
От: Robert James
Дата:
Сообщение: Re: Logical Aggregate Functions (eg ANY())
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Performance question: Commit or rollback?