Re: Postgres and multiple updates in one statement

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Jamie Lawrence-Jenner <jamie(dot)jenner(at)autovhc(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres and multiple updates in one statement
Date: 2009-07-27 13:07:46
Message-ID: 4A6DA6A2.1080307@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 27/07/2009 09:10, Jamie Lawrence-Jenner wrote:

> Apart from saving on the overhead of having to open up 5 separate
> connections, what are the benefits to passing in multiple updates in one
> statement?

If you do them all within one transaction -

begin;
update....
update...
...
commit;

- then you save on the overhead associated with beginning and committing
a transaction for each update.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-07-27 13:31:37 Re: Postgres and multiple updates in one statement
Previous Message MS 2009-07-27 11:36:58 Re: Very slow joins