On 10 Jun 2015, at 5:42pm, Clemens Ladisch <clemens at ladisch.de> wrote:

> The documentation talks about writing as the primary reason for locks,
> but read-only transactions need to take a read lock.  Two (automatic)
> transactions imply two lock/unlock operations.

True.  But still a bad reason to use BEGIN and END.  Locking is a side-effect, 
a detail of implementation.  Minor differences between speed of execution 
hardly ever matter.

Transactions are about data.  Use transactions if the two commands go together. 
 In the case of the two SELECTs, does it matter if the data gets changed 
between the two commands ?  If so, they belong in the same transaction.  If 
not, they don't.  Speed doesn't enter into it.

Simon.

Reply via email to