Re: Savepoint performance

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Savepoint performance
Date: 2006-07-27 19:35:20
Message-ID: 20060727193520.GG18774@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Mark Lewis wrote:

> So my question is, how expensive is setting a savepoint in PG? If it's
> not too expensive, I'm wondering if it would be feasible to add a config
> parameter to psql or other client interfaces (thinking specifically of
> jdbc here) to do it automatically. Doing so would make it a little
> easier to work with PG in a multi-db environment.

It is moderately expensive. It's cheaper than starting/committing a
transaction, but certainly much more expensive than not setting a
savepoint.

In psql you can do what you want using \set ON_ERROR_ROLLBACK on. This
is clearly a client-only issue, so the server does not provide any
special support for it (just like autocommit mode).

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2006-07-27 20:18:07 Re: performance issue with a specific query
Previous Message Ioana Danes 2006-07-27 18:55:06 Re: Query plan issue when upgrading to postgres 8.14 (from