Search Postgresql Archives

Re: SELECT overhead in explicit transaction

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

 



"Blair Bethwaite" <blair.bethwaite@xxxxxxxxxxxxxxxxxxxxxx> writes:
> I'm wondering whether there would be any extra overhead (CPU, memory,
> io, etc), above and beyond the implicit ACCESS SHARE, incurred by
> putting a simple SELECT into a transaction block?

Every PG command is executed in a transaction, whether explicit or
implicit.  So there is not really any difference on the backend side
between "SELECT blah" and "BEGIN; SELECT blah; COMMIT".  However the
latter definitely can have some extra overhead.  At minimum the server
has got to parse two more statements, even though they don't do very
much when executed.  What is really likely to hurt, though, is if your
client-side code is such that you incur three round trips to the server
instead of just one ...

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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