Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?
Дата
Msg-id 1628.1566764868@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), isCOMMIT or ROLLBACK preferred?  (David Wall <d.wall@computer.org>)
Список pgsql-general
David Wall <d.wall@computer.org> writes:
> ... So we're trying to determine 
> if there's actually any difference between commit/rollback after SELECT 
> statements (with rows returned or not), a bit like if there's any 
> difference for an UPDATE statement that returns zero rows were updated.

They're different code paths, but I'd expect any performance difference
to be at the noise level; if nothing happened in the transaction then
no WAL traffic will be emitted in either case.

A more useful thing to think about, IMO, is this: if your app thinks
that the statement had no side-effects but actually it did (maybe it
called a volatile function that did something), would you want those
effects to be persisted or not?

            regards, tom lane



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

Предыдущее
От: David Wall
Дата:
Сообщение: Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), isCOMMIT or ROLLBACK preferred?
Следующее
От: Howard Wells
Дата:
Сообщение: Re: Postgres SQLSTATE[08006] [7] timeout expired