On Tue, Aug 17, 2004 at 08:21:13PM -0300, Haroldo Stenger wrote: Hola,
> On Tue, 17 Aug 2004 16:58:56 -0400, Alvaro Herrera Munoz > <[EMAIL PROTECTED]> wrote: > > Establishing a savepoint is a non-trivial operation (cost-wise). Several > > internal server structures have to be prepared for it. It's way cheaper than > > normal transaction start and commit, but undesirable anyway if done once per > > query. Worse if it's going to be seldom used. > > I see. So, any heavy use of savepoints, say, issuing one before each > SQL command that might violate a restriction, would worsen a lot the > performance of my application? It depends. If you are going to establish savepoints just for the sake of it, and later release them, then yes --- there is no point in incurring in the overhead (and your application will be slower). But if the application has any chance to fail within the savepoint, and you can rollback to a savepoint to retry in a situation which would normally force you to rollback a transaction and start again, then you could _win_ performance. -- Alvaro Herrera (<alvherre[a]dcc.uchile.cl>) "I personally became interested in Linux while I was dating an English major who wouldn't know an operating system if it walked up and bit him." (Val Henson) ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend