Re: Help with many updates - Mailing list pgsql-sql

From Oliver Elphick
Subject Re: Help with many updates
Date
Msg-id 1014325782.3217.823.camel@linda
Whole thread Raw
In response to Help with many updates  ("Glenn MacGregor" <gtm@oracom.com>)
List pgsql-sql
On Thu, 2002-02-21 at 16:31, Glenn MacGregor wrote:
> What is the preferred way to do many updates.  Right now I am just doing
> each row at a time, is there a better way?  I have about 1000 or so and it
> takes a good 45 seconds

If you are currently doing:
  INSERT...  INSERT...

you can speed it up by enclosing the whole lot in a single transaction:
  BEGIN  INSERT...  INSERT...  COMMIT

You can get it even faster by formatting the input data in a text file
and using the COPY command (not in a transaction).

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
    "My sheep hear my voice, and I know them, and they      follow me; And I give unto them eternal life; and they
shallnever perish, neither shall any man pluck them      out of my hand."          John 10:27,28 
 



pgsql-sql by date:

Previous
From: Richard Emberson
Date:
Subject: Finding matching columns from two tables
Next
From: Jie Liang
Date:
Subject: Re: all tables in a DB\?