Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Wall <d.wall@xxxxxxxxxxxx> 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux