Re: SELECT overhead in explicit transaction

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SELECT overhead in explicit transaction
Дата
Msg-id 13197.1205302239@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SELECT overhead in explicit transaction  ("Blair Bethwaite" <blair.bethwaite@infotech.monash.edu.au>)
Список pgsql-general
"Blair Bethwaite" <blair.bethwaite@infotech.monash.edu.au> 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

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

Предыдущее
От: "Kakoli Sen"
Дата:
Сообщение: Re: Problem with starting PostgreSQL server 7.4.19
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Problem with starting PostgreSQL server 7.4.19