Re: [PERFORM] Cost of opening and closing an empty transaction

2013-05-21 Thread Ross Reedstrom
N.B. I realize this is an ancient email, but there's a significant issue that didn't get raised. Opening a transaction and leaving it idle can be a major pain on a MVCC database like PostgreSQL. The reason is that this is the dreaded 'idle in transaction' state. If these tranactions become long l

Re: [PERFORM] Cost of opening and closing an empty transaction

2012-09-24 Thread Albe Laurenz
Jon Leighton wrote: > I'm one of the developers of the Ruby on Rails web framework. > > In some situations, the framework generates an empty transaction block. > I.e. we sent a BEGIN and then later a COMMIT, with no other queries in > the middle. > > We currently can't avoid doing this, because a

Re: [PERFORM] Cost of opening and closing an empty transaction

2012-09-21 Thread Claudio Freire
On Fri, Sep 21, 2012 at 7:46 AM, Jon Leighton wrote: > So my question is: is this a worthwhile optimisation to make? In > particular, I am wondering whether empty transactions increase the work > the database has to do when there are several other connections open? > I.e. does it cause contention?

[PERFORM] Cost of opening and closing an empty transaction

2012-09-21 Thread Jon Leighton
Hello! I'm one of the developers of the Ruby on Rails web framework. In some situations, the framework generates an empty transaction block. I.e. we sent a BEGIN and then later a COMMIT, with no other queries in the middle. We currently can't avoid doing this, because a user *may* send queries i